Python, Selenium and the case of the unelevated privilege winerror 740

(John) #1

The paranoia of writing up anything for people in the same profession is real. I can get into specifics if it’s helpful but this feels like a common issue, yet my attempts to research it, led to a dead end. Hopefully, someone recognizes it. My google fu up to and including working has failed me:)

Up until a couple of weeks back I had working tests with the following set up.
win7, python 3.7, Selenium they had been working for several months
When calling Chromedriver, “winerror 740” requires elevated permissions. I am a local admin on the system, the effective file permissions for python , chromedriver and selenium folders should allow everything

(I can also get it to work on my home machine,

at it’s simplest

Typing that into Python command line.

from selenium import webdriver
driver = webdriver.Chrome(executable_path = “c:/pytest/chromedriver.exe”)

soon as I enter that into the console, or it’s called by a test I get the 740 error as it can’t import webdriver, or if I import all of selenium, it can’t execute it
Ty in advance for any pointers

(Faith Roberts) #2


I had a similar problem on Windows and I needed to remove my chrome driver and reinstall it.

Is it definitely up-to-date etc?

Most of my issues were because my Chrome updates automatically but my driver doesn’t and it just falls over. Eventually it got so far behind it threw a wobbly and just stopped working entirely. I never worked out the exact reason why.


(Ady Stokes) #3

Sorry I missed this and this is really unhelpful but your opening statement @haltse sounds like either a book or comic that I want to read. I hope you find a resolution to your issue but as a plot involving mystery problems, an unassuming protagonist and a geeky background is interesting. That said, I have had a drink this Sunday night and may be reading more into it than is on the surface!

(John) #4

Faith, thank you for the reply, I forgot to update how I solved it.

I’d replaced chromedriver with the latest version prior, but while troubleshooting this I’d pretty much replaced every part of the process, Updated / reinstalled python, selenium, chromedriver etc to no avail. Was able to get the same scripts working on another profile etc. E.G., proving it could work to those doubters in IT:)

In the end, moving the working directory the script was called from, cured it. Same user, same effective permissions, no reason. So once more I helped out the helpdesk by improving their clearance rate:)

(John) #5


Yes I’ll start out with the ending and work my backwards.

The crime was committed by enterprise security software , in the working folder with permissions.
Hopefully the drink was not scotch I fear running out :slight_smile:

(Jason) #6

In our environment we avoid this kind of issue via the established principle that we do all engineering and development work on Linux virtual machines where we control the permissions. For us, Windows is for Office and email.

(John) #7

I asked them last week if they had any objections to us using Linux. So far no news is good news

(Jason) #8

If you’ve been provided with a reasonable spec PC, you could frame the question as “would you allow Oracle VirtualBox?”

Using that gets us around a host of corporate IT restrictions that would simply close our office down.