OS: WIN 10 x64 1709 16299.64
Selenium Version:
Server 3.8.1
Client 3.8.0
IEDriverServer.exe 3.80
Browser:
Internet Explorer 11
Browser Version:
11.64.16299.0
The browser starts with clean cookie, localstorage, history and etc
The browser starts with the data from the last session
https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver
Follow the instructions Required Configuration and Multiple instances of InternetExplorerDriver
>>> import selenium
>>> selenium.__version__
'3.8.0'
>>> from selenium import webdriver
>>> opt = webdriver.ie.options.Options()
>>> opt.force_create_process_api=True
>>> opt.add_argument('-private')
>>> caps = webdriver.DesiredCapabilities.INTERNETEXPLORER.copy()
>>> caps.update(opt.to_capabilities())
>>> caps
{'platform': 'WINDOWS', 'browserName': 'internet explorer', 'se:ieOptions': {'ie.browserCommandLineSwitches': '-private', 'ie.forceCreateProcessApi': True}, 'version': ''}
>>> driver = webdriver.Remote(command_executor='http://host:4445/wd/hub', desired_capabilities=caps)
>>> driver.get('https://google.com')
**Enter your login and password to log in to your account**
>>> driver.quit()
>>> driver = webdriver.Remote(command_executor='http://host:4445/wd/hub', desired_capabilities=caps)
>>> driver.get('https://google.com')
**Authentication already passed**
The same thing you need to repeat with the option ie.ensureCleanSession
opt.ensure_clean_session = True
@cgoldberg
I tried the following options:
opt.force_create_process_api=True
opt.add_argument('-private')
opt.ensure_clean_session = True
or
opt.ensure_clean_session = True
without
opt.force_create_process_api=True and private switch
this does not work.
Any update on this?
From what I can tell, python should be sending over the correct option for ensure_clean_session
I reproduced the same issue under Java. Looks like not only Pyton specific.
It is very important because tests give unacceptable results without ensureCleanSession option. Please, increase a priority of this issue!
IE starts with all previosly cached data with this code:
hub = "http://selenium-hub:4444/wd/hub"
caps = DesiredCapabilities.INTERNETEXPLORER
caps["se:ieOptions"] = {}
caps["se:ieOptions"]["ie.ensureCleanSession"] = True
driver = webdriver.Remote(command_executor=hub, desired_capabilities=caps)
We might need to get used to the idea that there is nothing the driver can do about this, especially if Microsoft has closed the hack loophole that allowed the use of CreateProcess to accurately launch IE and control the subsequent instance of IE. Remember that using that API is not a supported way of launching IE because of the introduction of multiprocess IE (so-called “Loosely Coupled Internet Explorer”) and the use of mandatory integrity levels of processes. Using CreateProcess is not supported by Microsoft for launching IE. So asking for us to “increase a priority” of this issue, as @dev-e does, may be a non-starter.
@jimevans, so there is no way to workaround this issue?
@dev-e From here in my hospital bed without access to my laptop and only mobile devices to hand, I’d be hard-pressed to say for certain. I do know that the API used to start IE, IELaunchURL, is the “correct” way to launch IE and get the process ID of the “real” IE process back, but it allows no way to pass command line arguments to IE. Using CreateProcess after IE6 to attempt to launch IE was, is, and will always be a hack. It will not yield the correct process ID of the launched browser, and we need the process ID to connect to the browser to be able to automate it.
Thanks for explanations, @jimevans, get well soon.
@dev-e Are you on 32-bit or 64-bit Windows? My psychic debugging powers tell me that you're running on 64-bit Windows and using the 32-bit IEDriverServer.exe. Can you try using the 64-bit driver executable and report back whether that starts up in InPrivate mode?
Additionally, I'd really like to know what the "unacceptable results" are that result from using ensureCleanSession. Is something not properly getting cleared before the browser starts? Or is it simply that the process is too slow for your liking? If the former, it may be necessary to change the options passed into the Control Panel applet that is invoked in cleaning the temporary files (the relevant options that are being cleared are listed here). If the latter, there is no good answer for that issue.
@jimevans, I use Windows Server 2012 R2 for tests with 32-bit driver. Also tried with 64-bit driver and it seems to be that Selenium hub or Selenium node does not correctly proxying capabilities to the driver.
Logs from the hub:
10:20:52.614 INFO - Got a request to create a new session: Capabilities {browserName: internet explorer, platform: WINDOWS, se:ieOptions: {ie.browserCommandLineSwitches: -private, ie.ensureCleanSession: true}, version: }
10:20:52.614 DEBUG - Available nodes: [http://10.64.215.5:5555, http://172.16.110.8:5554, http://10.64.209.21:5555]
10:20:52.614 DEBUG - Trying to create a new session on node http://10.64.215.5:5555
10:20:52.614 DEBUG - Node http://10.64.215.5:5555 has no matching capability
10:20:52.615 DEBUG - Trying to create a new session on node http://172.16.110.8:5554
10:20:52.615 INFO - Trying to create a new session on test slot {seleniumProtocol=WebDriver, se:CONFIG_UUID=88d5ac71-8751-47bb-b222-5857a46cf651, browserName=internet explorer, maxInstances=1, version=11, platform=WINDOWS}
10:20:52.617 DEBUG - Closing connections idle longer than 100 MILLISECONDS
10:20:52.618 DEBUG - http-outgoing-11117: Close connection
10:20:52.620 DEBUG - CookieSpec selected: default
10:20:52.620 DEBUG - Auth cache not set in the context
10:20:52.620 DEBUG - Connection request: [route: {}->http://172.16.110.8:5554][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
10:20:52.621 DEBUG - Connection leased: [id: 11118][route: {}->http://172.16.110.8:5554][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
10:20:52.621 DEBUG - Opening connection {}->http://172.16.110.8:5554
10:20:52.622 DEBUG - Connecting to /172.16.110.8:5554
10:20:52.625 DEBUG - Connection established 10.64.214.26:38558<->172.16.110.8:5554
10:20:52.625 DEBUG - http-outgoing-11118: set socket timeout to 530000
10:20:52.625 DEBUG - Executing request POST /wd/hub/session HTTP/1.1
10:20:52.625 DEBUG - Target auth state: UNCHALLENGED
10:20:52.626 DEBUG - Proxy auth state: UNCHALLENGED
10:20:52.626 DEBUG - http-outgoing-11118 >> POST /wd/hub/session HTTP/1.1
10:20:52.626 DEBUG - http-outgoing-11118 >> Accept: application/json
10:20:52.626 DEBUG - http-outgoing-11118 >> Connection: close
10:20:52.626 DEBUG - http-outgoing-11118 >> X-Forwarded-Host: selenium-hub-test.amis.vesta.ru
10:20:52.627 DEBUG - http-outgoing-11118 >> X-Forwarded-Proto: http
10:20:52.627 DEBUG - http-outgoing-11118 >> X-Original-URI: /wd/hub/session
10:20:52.627 DEBUG - http-outgoing-11118 >> User-Agent: Python http auth
10:20:52.627 DEBUG - http-outgoing-11118 >> Host: selenium-hub-test.amis.vesta.ru
10:20:52.627 DEBUG - http-outgoing-11118 >> Accept-Encoding: identity
10:20:52.628 DEBUG - http-outgoing-11118 >> X-Forwarded-Port: 80
10:20:52.628 DEBUG - http-outgoing-11118 >> X-Forwarded-For: 172.16.111.28
10:20:52.628 DEBUG - http-outgoing-11118 >> X-Real-IP: 172.16.111.28
10:20:52.629 DEBUG - http-outgoing-11118 >> X-Scheme: http
10:20:52.629 DEBUG - http-outgoing-11118 >> Content-Type: application/json;charset=UTF-8
10:20:52.629 DEBUG - http-outgoing-11118 >> Content-Length: 749
10:20:52.629 DEBUG - http-outgoing-11118 >> "POST /wd/hub/session HTTP/1.1[\r][\n]"
10:20:52.630 DEBUG - http-outgoing-11118 >> "Accept: application/json[\r][\n]"
10:20:52.630 DEBUG - http-outgoing-11118 >> "Connection: close[\r][\n]"
10:20:52.630 DEBUG - http-outgoing-11118 >> "X-Forwarded-Host: selenium-hub-test.amis.vesta.ru[\r][\n]"
10:20:52.630 DEBUG - http-outgoing-11118 >> "X-Forwarded-Proto: http[\r][\n]"
10:20:52.631 DEBUG - http-outgoing-11118 >> "X-Original-URI: /wd/hub/session[\r][\n]"
10:20:52.631 DEBUG - http-outgoing-11118 >> "User-Agent: Python http auth[\r][\n]"
10:20:52.631 DEBUG - http-outgoing-11118 >> "Host: selenium-hub-test.amis.vesta.ru[\r][\n]"
10:20:52.631 DEBUG - http-outgoing-11118 >> "Accept-Encoding: identity[\r][\n]"
10:20:52.635 DEBUG - http-outgoing-11118 >> "X-Forwarded-Port: 80[\r][\n]"
10:20:52.636 DEBUG - http-outgoing-11118 >> "X-Forwarded-For: 172.16.111.28[\r][\n]"
10:20:52.637 DEBUG - http-outgoing-11118 >> "X-Real-IP: 172.16.111.28[\r][\n]"
10:20:52.637 DEBUG - http-outgoing-11118 >> "X-Scheme: http[\r][\n]"
10:20:52.638 DEBUG - http-outgoing-11118 >> "Content-Type: application/json;charset=UTF-8[\r][\n]"
10:20:52.638 DEBUG - http-outgoing-11118 >> "Content-Length: 749[\r][\n]"
10:20:52.638 DEBUG - http-outgoing-11118 >> "[\r][\n]"
10:20:52.639 DEBUG - http-outgoing-11118 >> "{[\n]"
10:20:52.639 DEBUG - http-outgoing-11118 >> " "desiredCapabilities": {"browserName":"internet explorer","platform":"WINDOWS","se:CONFIG_UUID":"88d5ac71-8751-47bb-b222-5857a46cf651","se:ieOptions":{"ie.browserCommandLineSwitches":"-private","ie.ensureCleanSession":true},"version":""},[\n]"
10:20:52.639 DEBUG - http-outgoing-11118 >> " "capabilities": {[\n]"
10:20:52.639 DEBUG - http-outgoing-11118 >> " "desiredCapabilities": {"browserName":"internet explorer","platform":"WINDOWS","se:CONFIG_UUID":"88d5ac71-8751-47bb-b222-5857a46cf651","se:ieOptions":{"ie.browserCommandLineSwitches":"-private","ie.ensureCleanSession":true},"version":""},[\n]"
10:20:52.639 DEBUG - http-outgoing-11118 >> " "firstMatch": [[\n]"
10:20:52.640 DEBUG - http-outgoing-11118 >> " {"browserName":"internet explorer","platformName":"windows","se:CONFIG_UUID":"88d5ac71-8751-47bb-b222-5857a46cf651","se:ieOptions":{"ie.browserCommandLineSwitches":"-private","ie.ensureCleanSession":true}}[\n]"
10:20:52.640 DEBUG - http-outgoing-11118 >> " ][\n]"
10:20:52.641 DEBUG - http-outgoing-11118 >> " }[\n]"
10:20:52.641 DEBUG - http-outgoing-11118 >> "}"
Logs from the driver:
13:20:53.392 INFO - /session: Executing POST on /session (handler: BeginSession)
13:20:53.483 INFO - Capabilities are: Capabilities {browserName: internet explor
er, platform: WINDOWS, version: }
13:20:53.488 INFO - Capabilities {browserName: internet explorer, platform: WIND
OWS, version: } matched class org.openqa.selenium.remote.server.ServicedSession$
Factory (provider: org.openqa.selenium.ie.InternetExplorerDriverService)
13:20:53.517 DEBUG - Waiting for [http://localhost:17350/status]
13:20:53.519 DEBUG - Polling http://localhost:17350/status
Started InternetExplorerDriver server (64-bit)
3.8.0.0
Listening on port 17350
Only local connections are allowed
13:20:54.045 DEBUG - Polling http://localhost:17350/status
13:20:54.048 DEBUG - sun.net.www.MessageHeader@68f2b0215 pairs: {GET /status HTT
P/1.1: null}{User-Agent: Java/1.8.0_161}{Host: localhost:17350}{Accept: text/htm
l, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
13:20:54.051 DEBUG - sun.net.www.MessageHeader@2df0235b7 pairs: {null: HTTP/1.1
200 OK}{Content-Length: 190}{Content-Type: application/json; charset=UTF-8}{Cach
e-Control: no-cache}{Vary: Accept-Charset, Accept-Encoding, Accept-Language, Acc
ept}{Accept-Ranges: bytes}{Connection: close}
13:20:54.079 DEBUG - CookieSpec selected: default
13:20:54.080 DEBUG - Auth cache not set in the context
13:20:54.081 DEBUG - Connection request: [route: {}->http://localhost:17350][tot
al kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
13:20:54.082 DEBUG - Connection leased: [id: 2][route: {}->http://localhost:1735
0][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
13:20:54.083 DEBUG - Opening connection {}->http://localhost:17350
13:20:54.084 DEBUG - Connecting to localhost/127.0.0.1:17350
13:20:54.086 DEBUG - Connection established 127.0.0.1:33369<->127.0.0.1:17350
13:20:54.087 DEBUG - http-outgoing-2: set socket timeout to 10800000
13:20:54.087 DEBUG - Executing request POST /session HTTP/1.1
13:20:54.088 DEBUG - Target auth state: UNCHALLENGED
13:20:54.089 DEBUG - Proxy auth state: UNCHALLENGED
13:20:54.090 DEBUG - http-outgoing-2 >> POST /session HTTP/1.1
13:20:54.091 DEBUG - http-outgoing-2 >> Content-Type: application/json; charset=
utf-8
13:20:54.092 DEBUG - http-outgoing-2 >> Content-Length: 314
13:20:54.093 DEBUG - http-outgoing-2 >> Host: localhost:17350
13:20:54.094 DEBUG - http-outgoing-2 >> Connection: Keep-Alive
13:20:54.094 DEBUG - http-outgoing-2 >> User-Agent: Apache-HttpClient/4.5.3 (Jav
a/1.8.0_161)
13:20:54.095 DEBUG - http-outgoing-2 >> Accept-Encoding: gzip,deflate
13:20:54.096 DEBUG - http-outgoing-2 >> "POST /session HTTP/1.1[\r][\n]"
13:20:54.096 DEBUG - http-outgoing-2 >> "Content-Type: application/json; charset
=utf-8[\r][\n]"
13:20:54.098 DEBUG - http-outgoing-2 >> "Content-Length: 314[\r][\n]"
13:20:54.098 DEBUG - http-outgoing-2 >> "Host: localhost:17350[\r][\n]"
13:20:54.099 DEBUG - http-outgoing-2 >> "Connection: Keep-Alive[\r][\n]"
13:20:54.099 DEBUG - http-outgoing-2 >> "User-Agent: Apache-HttpClient/4.5.3 (Ja
va/1.8.0_161)[\r][\n]"
13:20:54.100 DEBUG - http-outgoing-2 >> "Accept-Encoding: gzip,deflate[\r][\n]"
13:20:54.101 DEBUG - http-outgoing-2 >> "[\r][\n]"
13:20:54.101 DEBUG - http-outgoing-2 >> "{[\n]"13:20:53.392 INFO - /session: Executing POST on /session (handler: BeginSession)
13:20:53.483 INFO - Capabilities are: Capabilities {browserName: internet explor
er, platform: WINDOWS, version: }
13:20:53.488 INFO - Capabilities {browserName: internet explorer, platform: WIND
OWS, version: } matched class org.openqa.selenium.remote.server.ServicedSession$
Factory (provider: org.openqa.selenium.ie.InternetExplorerDriverService)
13:20:53.517 DEBUG - Waiting for [http://localhost:17350/status]
13:20:53.519 DEBUG - Polling http://localhost:17350/status
Started InternetExplorerDriver server (64-bit)
3.8.0.0
Listening on port 17350
Only local connections are allowed
13:20:54.045 DEBUG - Polling http://localhost:17350/status
13:20:54.048 DEBUG - sun.net.www.MessageHeader@68f2b0215 pairs: {GET /status HTT
P/1.1: null}{User-Agent: Java/1.8.0_161}{Host: localhost:17350}{Accept: text/htm
l, image/gif, image/jpeg, *; q=.2, */*; q=.2}{Connection: keep-alive}
13:20:54.051 DEBUG - sun.net.www.MessageHeader@2df0235b7 pairs: {null: HTTP/1.1
200 OK}{Content-Length: 190}{Content-Type: application/json; charset=UTF-8}{Cach
e-Control: no-cache}{Vary: Accept-Charset, Accept-Encoding, Accept-Language, Acc
ept}{Accept-Ranges: bytes}{Connection: close}
13:20:54.079 DEBUG - CookieSpec selected: default
13:20:54.080 DEBUG - Auth cache not set in the context
13:20:54.081 DEBUG - Connection request: [route: {}->http://localhost:17350][tot
al kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
13:20:54.082 DEBUG - Connection leased: [id: 2][route: {}->http://localhost:1735
0][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
13:20:54.083 DEBUG - Opening connection {}->http://localhost:17350
13:20:54.084 DEBUG - Connecting to localhost/127.0.0.1:17350
13:20:54.086 DEBUG - Connection established 127.0.0.1:33369<->127.0.0.1:17350
13:20:54.087 DEBUG - http-outgoing-2: set socket timeout to 10800000
13:20:54.087 DEBUG - Executing request POST /session HTTP/1.1
13:20:54.088 DEBUG - Target auth state: UNCHALLENGED
13:20:54.089 DEBUG - Proxy auth state: UNCHALLENGED
13:20:54.090 DEBUG - http-outgoing-2 >> POST /session HTTP/1.1
13:20:54.091 DEBUG - http-outgoing-2 >> Content-Type: application/json; charset=
utf-8
13:20:54.092 DEBUG - http-outgoing-2 >> Content-Length: 314
13:20:54.093 DEBUG - http-outgoing-2 >> Host: localhost:17350
13:20:54.094 DEBUG - http-outgoing-2 >> Connection: Keep-Alive
13:20:54.094 DEBUG - http-outgoing-2 >> User-Agent: Apache-HttpClient/4.5.3 (Jav
a/1.8.0_161)
13:20:54.095 DEBUG - http-outgoing-2 >> Accept-Encoding: gzip,deflate
13:20:54.096 DEBUG - http-outgoing-2 >> "POST /session HTTP/1.1[\r][\n]"
13:20:54.096 DEBUG - http-outgoing-2 >> "Content-Type: application/json; charset
=utf-8[\r][\n]"
13:20:54.098 DEBUG - http-outgoing-2 >> "Content-Length: 314[\r][\n]"
13:20:54.098 DEBUG - http-outgoing-2 >> "Host: localhost:17350[\r][\n]"
13:20:54.099 DEBUG - http-outgoing-2 >> "Connection: Keep-Alive[\r][\n]"
13:20:54.099 DEBUG - http-outgoing-2 >> "User-Agent: Apache-HttpClient/4.5.3 (Ja
va/1.8.0_161)[\r][\n]"
13:20:54.100 DEBUG - http-outgoing-2 >> "Accept-Encoding: gzip,deflate[\r][\n]"
13:20:54.101 DEBUG - http-outgoing-2 >> "[\r][\n]"
13:20:54.102 DEBUG - http-outgoing-2 >> " "desiredCapabilities": {"browserName"
:"internet explorer","platform":"WINDOWS","version":""},[\n]"
13:20:54.103 DEBUG - http-outgoing-2 >> " "capabilities": {[\n]"
13:20:54.103 DEBUG - http-outgoing-2 >> " "desiredCapabilities": {"browserNam
e":"internet explorer","platform":"WINDOWS","version":""},[\n]"
13:20:54.104 DEBUG - http-outgoing-2 >> " "firstMatch": [[\n]"
13:20:54.105 DEBUG - http-outgoing-2 >> " {"browserName":"internet explorer
","platformName":"windows"}[\n]"
13:20:54.105 DEBUG - http-outgoing-2 >> " ][\n]"
13:20:54.106 DEBUG - http-outgoing-2 >> " }[\n]"
13:20:54.107 DEBUG - http-outgoing-2 >> "}"
13:20:55.505 DEBUG - CookieSpec selected: default
13:20:55.506 DEBUG - Auth cache not set in the context
13:20:55.507 DEBUG - Connection request: [route: {}->http://selenium-hub-test.am
is.vesta.ru:80][total kept alive: 1; route allocated: 2 of 2000; total allocated
: 2 of 2000]
13:20:55.510 DEBUG - http-outgoing-1 << "[read] I/O error: Read timed out"
13:20:55.511 DEBUG - Connection leased: [id: 1][route: {}->http://selenium-hub-t
est.amis.vesta.ru:80][total kept alive: 0; route allocated: 2 of 2000; total all
ocated: 2 of 2000]
13:20:55.512 DEBUG - Stale connection check
13:20:55.515 DEBUG - http-outgoing-1 << "[read] I/O error: Read timed out"
13:20:55.515 DEBUG - http-outgoing-1: set socket timeout to 10800000
13:20:55.516 DEBUG - Executing request GET /grid/api/proxy?id=http://172.16.110.
8:5554 HTTP/1.1
13:20:55.517 DEBUG - Target auth state: UNCHALLENGED
13:20:55.518 DEBUG - Proxy auth state: UNCHALLENGED
13:20:55.518 DEBUG - http-outgoing-1 >> GET /grid/api/proxy?id=http://172.16.110
.8:5554 HTTP/1.1
13:20:55.519 DEBUG - http-outgoing-1 >> Host: selenium-hub-test.amis.vesta.ru
13:20:55.519 DEBUG - http-outgoing-1 >> Connection: Keep-Alive
13:20:55.520 DEBUG - http-outgoing-1 >> User-Agent: Apache-HttpClient/4.5.3 (Jav
a/1.8.0_161)
13:20:55.521 DEBUG - http-outgoing-1 >> Accept-Encoding: gzip,deflate
13:20:55.521 DEBUG - http-outgoing-1 >> "GET /grid/api/proxy?id=http://172.16.11
0.8:5554 HTTP/1.1[\r][\n]"
13:20:55.522 DEBUG - http-outgoing-1 >> "Host: selenium-hub-test.amis.vesta.ru[\
r][\n]"
13:20:55.523 DEBUG - http-outgoing-1 >> "Connection: Keep-Alive[\r][\n]"
13:20:55.523 DEBUG - http-outgoing-1 >> "User-Agent: Apache-HttpClient/4.5.3 (Ja
va/1.8.0_161)[\r][\n]"
13:20:55.524 DEBUG - http-outgoing-1 >> "Accept-Encoding: gzip,deflate[\r][\n]"
13:20:55.524 DEBUG - http-outgoing-1 >> "[\r][\n]"
13:20:55.529 DEBUG - http-outgoing-1 << "HTTP/1.1 200 OK[\r][\n]"
13:20:55.529 DEBUG - http-outgoing-1 << "Server: nginx/1.9.13[\r][\n]"
13:20:55.530 DEBUG - http-outgoing-1 << "Date: Tue, 22 May 2018 10:20:55 GMT[\r]
[\n]"
13:20:55.531 DEBUG - http-outgoing-1 << "Content-Type: application/json;charset=
utf-8[\r][\n]"
13:20:55.531 DEBUG - http-outgoing-1 << "Content-Length: 991[\r][\n]"
13:20:55.532 DEBUG - http-outgoing-1 << "Connection: keep-alive[\r][\n]"
13:20:55.532 DEBUG - http-outgoing-1 << "[\r][\n]"
13:20:55.533 DEBUG - http-outgoing-1 << "{"success":true,"msg":"proxy found !","
id":"http://172.16.110.8:5554","request":{"class":"org.openqa.grid.common.Regist
rationRequest","name":null,"description":null,"configuration":{"remoteHost":"htt
p://172.16.110.8:5554","hubHost":"selenium-hub-test.amis.vesta.ru","hubPort":-1,
"id":"http://172.16.110.8:5554","capabilities":[{"browserName":"internet explore
r","maxInstances":1,"platform":"WINDOWS","se:CONFIG_UUID":"88d5ac71-8751-47bb-b2
22-5857a46cf651","seleniumProtocol":"WebDriver","version":"11"}],"downPollingLim
it":2,"hub":"http://selenium-hub-test.amis.vesta.ru","nodePolling":5000,"nodeSta
tusCheckTimeout":5000,"proxy":"org.openqa.grid.selenium.proxy.DefaultRemoteProxy
","register":true,"registerCycle":5000,"unregisterIfStillDownAfter":60000,"clean
UpCycle":null,"custom":{},"host":"172.16.110.8","maxSession":1,"servlets":[],"wi
thoutServlets":[],"browserTimeout":240,"debug":true,"jettyMaxThreads":null,"log"
:null,"port":5554,"role":"node","timeout":15,"enablePassThrough":true}}}"
13:20:55.537 DEBUG - http-outgoing-1 << HTTP/1.1 200 OK
13:20:55.537 DEBUG - http-outgoing-1 << Server: nginx/1.9.13
13:20:55.538 DEBUG - http-outgoing-1 << Date: Tue, 22 May 2018 10:20:55 GMT
13:20:55.538 DEBUG - http-outgoing-1 << Content-Type: application/json;charset=u
tf-8
13:20:55.539 DEBUG - http-outgoing-1 << Content-Length: 991
13:20:55.540 DEBUG - http-outgoing-1 << Connection: keep-alive
13:20:55.540 DEBUG - Connection can be kept alive indefinitely
13:20:55.541 DEBUG - Connection [id: 1][route: {}->http://selenium-hub-test.amis
.vesta.ru:80] can be kept alive indefinitely
13:20:55.542 DEBUG - Connection released: [id: 1][route: {}->http://selenium-hub
-test.amis.vesta.ru:80][total kept alive: 1; route allocated: 2 of 2000; total a
llocated: 2 of 2000]
13:20:55.543 DEBUG - The node is already present on the hub. Skipping registrati
on.
13:20:55.747 DEBUG - http-outgoing-2 << "HTTP/1.1 200 OK[\r][\n]"
13:20:55.748 DEBUG - http-outgoing-2 << "Content-Length: 692[\r][\n]"
13:20:55.749 DEBUG - http-outgoing-2 << "Content-Type: application/json; charset
=UTF-8[\r][\n]"
13:20:55.749 DEBUG - http-outgoing-2 << "Cache-Control: no-cache[\r][\n]"
13:20:55.750 DEBUG - http-outgoing-2 << "Vary: Accept-Charset, Accept-Encoding,
Accept-Language, Accept[\r][\n]"
13:20:55.751 DEBUG - http-outgoing-2 << "Accept-Ranges: bytes[\r][\n]"
13:20:55.751 DEBUG - http-outgoing-2 << "Connection: close[\r][\n]"
13:20:55.752 DEBUG - http-outgoing-2 << "[\r][\n]"
13:20:55.752 DEBUG - http-outgoing-2 << "{"value":{"capabilities":{"acceptInsecu
reCerts":false,"browserName":"internet explorer","browserVersion":"11","pageLoad
Strategy":"normal","platformName":"windows","proxy":{},"se:ieOptions":{"browserA
ttachTimeout":0,"elementScrollBehavior":0,"enablePersistentHover":true,"ie.brows
erCommandLineSwitches":"","ie.ensureCleanSession":false,"ie.fileUploadDialogTime
out":3000,"ie.forceCreateProcessApi":false,"ignoreProtectedModeSettings":false,"
ignoreZoomSetting":false,"initialBrowserUrl":"http://localhost:17350/","nativeEv
ents":true,"requireWindowFocus":false},"setWindowRect":true,"timeouts":{"implici
t":0,"pageLoad":300000,"script":30000}},"sessionId":"218b4c30-38d1-4755-8f1f-ee6
a8aafda94"}}[\n]"
13:20:55.754 DEBUG - http-outgoing-2 << "[\r][\n]"
13:20:55.755 DEBUG - http-outgoing-2 << HTTP/1.1 200 OK
13:20:55.755 DEBUG - http-outgoing-2 << Content-Length: 692
13:20:55.756 DEBUG - http-outgoing-2 << Content-Type: application/json; charset=
UTF-8
13:20:55.757 DEBUG - http-outgoing-2 << Cache-Control: no-cache
13:20:55.757 DEBUG - http-outgoing-2 << Vary: Accept-Charset, Accept-Encoding, A
ccept-Language, Accept
13:20:55.758 DEBUG - http-outgoing-2 << Accept-Ranges: bytes
13:20:55.759 DEBUG - http-outgoing-2 << Connection: close
13:20:55.760 DEBUG - http-outgoing-2: Close connection
13:20:55.761 DEBUG - Connection discarded
13:20:55.761 DEBUG - Connection released: [id: 2][route: {}->http://localhost:17
350][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000
]
13:20:55.776 INFO - Detected dialect: W3C
13:20:55.791 DEBUG - Executing: newSession [null, newSession {desiredCapabilitie
s=Capabilities {acceptInsecureCerts: false, browserName: internet explorer, brow
serVersion: 11, pageLoadStrategy: normal, platformName: windows, proxy: Proxy(),
se:ieOptions: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersist
entHover: true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, i
e.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtecte
dModeSettings: false, ignoreZoomSetting: false, initialBrowserUrl: http://localh
ost:17350/, nativeEvents: true, requireWindowFocus: false}, setWindowRect: true,
timeouts: {implicit: 0, pageLoad: 300000, script: 30000}}}]
13:20:55.794 DEBUG - Executed: [null, newSession {desiredCapabilities=Capabiliti
es {acceptInsecureCerts: false, browserName: internet explorer, browserVersion:
11, pageLoadStrategy: normal, platformName: windows, proxy: Proxy(), se:ieOption
s: {browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: tr
ue, ie.browserCommandLineSwitches: , ie.ensureCleanSession: false, ie.fileUpload
DialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtectedModeSetting
s: false, ignoreZoomSetting: false, initialBrowserUrl: http://localhost:17350/,
nativeEvents: true, requireWindowFocus: false}, setWindowRect: true, timeouts: {
implicit: 0, pageLoad: 300000, script: 30000}}}]
"Unacceptable results" means that IE is started with all previously cached content, saved values in form fields, preselected options on web pages etc.
@dev-e Can we simplify the repro case a bit? There are too many moving parts here to be sure where the issue is. Take grid out of the equation, and run locally on a machine.
It’s also unclear to me what code you’re using to attempt to launch IE. For example, if you’re sending the -private command line argument without specifying the ie.forceCreateProcess option, no, that will never work.
Also, when you launch IE with the ie.ensureCleanSession flag, you should see the cache-clearing Control Panel applet execute. It’s unclear whether you’re seeing that happen.
@jimevans, I do not know what is "the cache-clearing Control Panel applet", but
Driver 64 bit:
caps = DesiredCapabilities.INTERNETEXPLORER
caps["se:ieOptions"] = {}
caps["se:ieOptions"]['ie.forceCreateProcessApi'] = True
caps["se:ieOptions"]['ie.browserCommandLineSwitches'] ='-private'
caps["se:ieOptions"]["ie.ensureCleanSession"] = True
driver = webdriver.Ie(executable_path='C:\selenium\IEDriverServer_x64_3_8.exe', capabilities=caps)
This code works correctly (both ensureCleanSession and -private options )
Driver 32 bit:
Works only ensureCleanSession. When trying to launch with -private, IEDriverServer.exe starts, it launches iexplore.exe, but than iexplore.exe quits and the test hangs on getting driver
Log from IEDriverServer_32_3_8.exe:
I 2018-05-22 17:30:29:488 server.cc(86) Starting WebDriver server on port: '51386' on host: ''
T 2018-05-22 17:30:29:488 server.cc(634) Entering Server::PopulateCommandRepository
T 2018-05-22 17:30:29:488 IEServer.cpp(32) Entering IEServer::IEServer
I 2018-05-22 17:30:29:488 IEServer.cpp(33) Driver version: 3.8.0.0 (32-bit)
T 2018-05-22 17:30:29:488 server.cc(121) Entering Server::Start
D 2018-05-22 17:30:29:488 server.cc(148) Civetweb ACL is -0.0.0.0/0,+127.0.0.1
T 2018-05-22 17:30:32:435 server.cc(174) Entering Server::ProcessRequest
T 2018-05-22 17:30:32:435 server.cc(238) Entering Server::ReadRequestBody
T 2018-05-22 17:30:32:435 server.cc(183) Process request with: URI: /session HTTP verb: POST
body: {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "internet explorer", "platformName": "windows", "se:ieOptions": {"ie.forceCreateProcessApi": true, "ie.browserCommandLineSwitches": "-private", "ie.ensureCleanSession": true}}}, "desiredCapabilities": {"browserName": "internet explorer", "version": "", "platform": "WINDOWS", "se:ieOptions": {"ie.forceCreateProcessApi": true, "ie.browserCommandLineSwitches": "-private", "ie.ensureCleanSession": true}}}
T 2018-05-22 17:30:32:436 server.cc(272) Entering Server::DispatchCommand
T 2018-05-22 17:30:32:436 server.cc(583) Entering Server::LookupCommand
D 2018-05-22 17:30:32:436 server.cc(281) Command: POST /session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "internet explorer", "platformName": "windows", "se:ieOptions": {"ie.forceCreateProcessApi": true, "ie.browserCommandLineSwitches": "-private", "ie.ensureCleanSession": true}}}, "desiredCapabilities": {"browserName": "internet explorer", "version": "", "platform": "WINDOWS", "se:ieOptions": {"ie.forceCreateProcessApi": true, "ie.browserCommandLineSwitches": "-private", "ie.ensureCleanSession": true}}}
T 2018-05-22 17:30:32:436 IEServer.cpp(42) Entering IEServer::InitializeSession
T 2018-05-22 17:30:32:436 IESession.cpp(38) Entering IESession::Initialize
D 2018-05-22 17:30:32:436 IESession.cpp(53) Mutex acquired for session initalization
T 2018-05-22 17:30:32:436 IECommandExecutor.cpp(386) Entering IECommandExecutor::ThreadProc
T 2018-05-22 17:30:32:439 IECommandExecutor.cpp(47) Entering IECommandExecutor::OnCreate
T 2018-05-22 17:30:32:439 IECommandExecutor.cpp(756) Entering IECommandExecutor::PopulateElementFinderMethods
T 2018-05-22 17:30:32:439 InputManager.cpp(40) Entering InputManager::InputManager
T 2018-05-22 17:30:32:439 InputManager.cpp(75) Entering InputManager::Initialize
T 2018-05-22 17:30:32:439 BrowserFactory.cpp(999) Entering BrowserFactory::GetExecutableLocation
T 2018-05-22 17:30:32:439 BrowserFactory.cpp(1040) Entering BrowserFactory::GetIEVersion
T 2018-05-22 17:30:32:440 CommandHandlerRepository.cpp(108) Entering CommandHandlerRepository::PopulateCommandHandlers
T 2018-05-22 17:30:32:440 IESession.cpp(99) Created thread for command executor returns HWND: '03D5021C'
T 2018-05-22 17:30:32:440 IESession.cpp(103) Session id is retrived from command executor window: 'babc82bd-dc3f-45df-a851-78b2e3760166'
D 2018-05-22 17:30:32:440 IESession.cpp(109) Releasing session initialization mutex
T 2018-05-22 17:30:32:440 IESession.cpp(191) Entering IESession::ExecuteCommand
T 2018-05-22 17:30:32:440 IECommandExecutor.cpp(122) Entering IECommandExecutor::OnSetCommand
T 2018-05-22 17:30:32:440 command.cc(31) Entering Command::Deserialize
D 2018-05-22 17:30:32:440 command.cc(36) Raw JSON command: { "name" : "newSession", "locator" : { }, "parameters" : {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "internet explorer", "platformName": "windows", "se:ieOptions": {"ie.forceCreateProcessApi": true, "ie.browserCommandLineSwitches": "-private", "ie.ensureCleanSession": true}}}, "desiredCapabilities": {"browserName": "internet explorer", "version": "", "platform": "WINDOWS", "se:ieOptions": {"ie.forceCreateProcessApi": true, "ie.browserCommandLineSwitches": "-private", "ie.ensureCleanSession": true}}} }
T 2018-05-22 17:30:32:441 IECommandExecutor.cpp(133) Entering IECommandExecutor::OnExecCommand
T 2018-05-22 17:30:32:441 IESession.cpp(212) Beginning wait for response length to be not zero
T 2018-05-22 17:30:32:441 IECommandExecutor.cpp(454) Entering IECommandExecutor::DispatchCommand
D 2018-05-22 17:30:32:441 CommandHandlers\NewSessionCommandHandler.cpp(46) Found W3C capabilities structure
D 2018-05-22 17:30:32:441 CommandHandlers\NewSessionCommandHandler.cpp(208) Found alwaysMatch in capabilities
D 2018-05-22 17:30:32:441 CommandHandlers\NewSessionCommandHandler.cpp(572) Validating capabilities object
D 2018-05-22 17:30:32:441 CommandHandlers\NewSessionCommandHandler.cpp(607) Found browserName capability. Validating value type is string.
D 2018-05-22 17:30:32:441 CommandHandlers\NewSessionCommandHandler.cpp(636) Found platformName capability. Validating value type is string.
D 2018-05-22 17:30:32:441 CommandHandlers\NewSessionCommandHandler.cpp(869) Found se:ieOptions capability. Validating value type is object.
D 2018-05-22 17:30:32:441 CommandHandlers\NewSessionCommandHandler.cpp(572) Validating capabilities object
W 2018-05-22 17:30:32:441 CommandHandlers\NewSessionCommandHandler.cpp(105) Invalid capability setting: timeouts is type null instead of object. Default value will be used: null
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(114) Entering BrowserFactory::Initialize
T 2018-05-22 17:30:32:441 IECommandExecutor.cpp(634) Entering IECommandExecutor::CreateNewBrowser
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(143) Entering BrowserFactory::LaunchBrowserProcess
D 2018-05-22 17:30:32:441 BrowserFactory.cpp(147) Ignoring Protected Mode Settings: 0
D 2018-05-22 17:30:32:441 BrowserFactory.cpp(150) Checking validity of Protected Mode settings.
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(1059) Entering BrowserFactory::ProtectedModeSettingsAreValid
D 2018-05-22 17:30:32:441 BrowserFactory.cpp(1062) Detected IE version: 11, Windows version supports Protected Mode: 1
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(1136) Entering BrowserFactory::GetZoneProtectedModeSetting
D 2018-05-22 17:30:32:441 BrowserFactory.cpp(1153) Found Protected Mode setting value of 3 for zone 1
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(1136) Entering BrowserFactory::GetZoneProtectedModeSetting
D 2018-05-22 17:30:32:441 BrowserFactory.cpp(1157) RegQueryValueEx failed for getting Protected Mode setting for a zone: 2
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(1136) Entering BrowserFactory::GetZoneProtectedModeSetting
D 2018-05-22 17:30:32:441 BrowserFactory.cpp(1157) RegQueryValueEx failed for getting Protected Mode setting for a zone: 3
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(1136) Entering BrowserFactory::GetZoneProtectedModeSetting
D 2018-05-22 17:30:32:441 BrowserFactory.cpp(1157) RegQueryValueEx failed for getting Protected Mode setting for a zone: 4
D 2018-05-22 17:30:32:441 BrowserFactory.cpp(153) Has Valid Protected Mode Settings: 1
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(264) Entering BrowserFactory::IsCreateProcessApiAvailable
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(131) Entering BrowserFactory::ClearCache
D 2018-05-22 17:30:32:441 BrowserFactory.cpp(134) Clearing cache with low mandatory integrity level as required on Windows Vista or later.
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(811) Entering BrowserFactory::InvokeClearCacheUtility
T 2018-05-22 17:30:32:441 BrowserFactory.cpp(762) Entering BrowserFactory::CreateLowIntegrityLevelToken
D 2018-05-22 17:30:32:442 BrowserFactory.cpp(851) Launching inetcpl.cpl via rundll32.exe to clear cache
D 2018-05-22 17:30:32:448 BrowserFactory.cpp(891) Waiting for rundll32.exe process to exit.
D 2018-05-22 17:30:32:717 BrowserFactory.cpp(896) Cache clearing complete.
D 2018-05-22 17:30:32:717 BrowserFactory.cpp(137) Clearing cache with normal process execution.
T 2018-05-22 17:30:32:717 BrowserFactory.cpp(811) Entering BrowserFactory::InvokeClearCacheUtility
D 2018-05-22 17:30:32:717 BrowserFactory.cpp(851) Launching inetcpl.cpl via rundll32.exe to clear cache
D 2018-05-22 17:30:32:722 BrowserFactory.cpp(891) Waiting for rundll32.exe process to exit.
D 2018-05-22 17:30:33:548 BrowserFactory.cpp(896) Cache clearing complete.
T 2018-05-22 17:30:33:548 BrowserFactory.cpp(289) Entering BrowserFactory::LaunchBrowserUsingCreateProcess
D 2018-05-22 17:30:33:548 BrowserFactory.cpp(290) Starting IE using the CreateProcess API
T 2018-05-22 17:30:33:548 BrowserFactory.cpp(304) IE starting command line is: 'C:\Program Files (x86)\Internet Explorer\ielowutil.exe -private http://localhost:51386/'.
D 2018-05-22 17:30:33:567 BrowserFactory.cpp(203) IE launched successfully with process ID 574740
D 2018-05-22 17:30:33:567 BrowserFactory.cpp(209) Process with ID 574740 is executing ielowutil.exe
T 2018-05-22 17:30:33:567 BrowserFactory.cpp(366) Entering BrowserFactory::AttachToBrowser
D 2018-05-22 17:30:33:567 BrowserFactory.cpp(376) Using Active Accessibility to find IWebBrowser2 interface
T 2018-05-22 17:30:33:567 BrowserFactory.cpp(415) Entering BrowserFactory::AttachToBrowserUsingActiveAccessibility
@dev-e "The cache-clearing Control Panel applet” is the same utility that is used when opening the old Control Panel, going to Internet Settings, and manually clearing the cookies, cache, etc. You can see from your posted log that it’s getting executed in this line:
D 2018-05-22 17:30:32:717 BrowserFactory.cpp(851) Launching inetcpl.cpl via rundll32.exe to clear cache
In any case, the commit referenced above should provide some relief for starting IE in private mode, but I would encourage you to read the information in the commit message of f4676fb for the particulars of what you need to be aware of.
@jimevans, so we got that this options works correctly with local IEDriverServer.exe, but what about the initial question of issue about RemoteWebDriver?
@dev-e Until and unless you use a version of IE driver that includes the change I added two days ago, it won’t work, regardless of whether you’re running remote or local.
@jimevans, why this options work with local test with x64 bit driver v3.8.0 and do not work via hub-node? If you have a look on my previous comment you will see that the IEDriverServer starts with default options (without "se:ieOptions" section) when launching from selenium node. How is it related to your commit?
Most helpful comment
Any update on this?