1

I am stuck for good. I use the python client of selenium3.0 with Mozilla Firefox 49.0.2 and phantomjs 2.1.1.

the problem is that the site has not valid certificates thus it is stuck in a page "Your connection is not secure". i cant remember what was different before but this used to work with the following code

profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
profile.assume_untrusted_cert_issuer = False
profile.set_preference("network.proxy.no_proxies_on","localhost,127.0.0.1,"+url)
driver = webdriver.Firefox(profile)
drive.get('https://'+url'+'port)

but not anymore. i should have upgraded Firefox in some point. Btw the error is

Traceback (most recent call last):
  File "seleniumtest.py", line 75, in <module>
    open_browser(url,port,"user","rZMBlg4ZpOX")
  File "seleniumtest.py", line 52, in open_browser
    driver.get(g)
  File "/home/iob/Envs/selenium/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 248, in get
    self.execute(Command.GET, {'url': url})
  File "/home/iob/Envs/selenium/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute
    self.error_handler.check_response(response)
  File "/home/iob/Envs/selenium/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 196, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Error loading page

I found that Firefox uses marionette as the default FirefoxDriver since F38, i think. i dont know if this has to do anything with the problem. I tried to debug the issue and see the response. i found that the response is like that:

{u'sessionId': u'7334d50d-f188-4c70-be4e-3d1440cf21ec', u'value': {u'processId': 32334, u'browserVersion': u'49.0.2', u'takesScreenshot': True, u'acceptSslCerts': False, u'appBuildId': u'20161025170400', u'XULappId': u'{ec8030f7-c20a-464f-9b0e-13a3a9e97384}', u'javascriptEnabled': True, u'raisesAccessibilityExceptions': False, u'specificationLevel': 0, u'platform': u'LINUX', u'browserName': u'firefox', u'version': u'', u'proxy': {}, u'marionette': True, u'rotatable': False, u'device': u'desktop', u'takesElementScreenshot': True, u'platformName': u'linux', u'platformVersion': u'4.4.0-47-generic', u'command_id': 1}

i noticed u'acceptSslCerts': False so i thought that this is what I need to set for it to work. But I am not sure how exactly and whatever I tried doesnt seem to work (ex: capabilities["acceptSslCerts"]= True)

With phantomjs i use the code below

service_args = ['--proxy=https://10.241.226.200:5601',
'--proxy-type=https',
'--proxy-auth='+username+':'+password,
'--ignore-ssl-errors=true', '--ssl-protocol=any'] 
driver=webdriver.PhantomJS(service_args=service_args)                         

driver.get("https://"+url+":"+port)

That doesnt raise any error but neither returns the title so i assume that something is wrong and it didnt open the link properly.

Any idea? Any link for elaboration would be helpful

b10n1k
  • 567
  • 5
  • 21
  • Try to follow the step I mentioned here-http://stackoverflow.com/questions/40467460/firefox-error-your-connection-is-not-secure-while-launching-driver-with-selen/40882513#40882513 – Shoaib Akhtar Nov 30 '16 at 07:39

0 Answers0