I'm trying to help run my selenium (Python bindings version 2) tests on someone else setup.
It works with the Firefox esr(on both machines), it works with the latest phantomjs on my machine. It hangs on his machine.
Only obvious difference between is he's on Windows 10 and I'm on Windows 7. I don't think it's the firewall or proxy cause I took care of it ( enabling everything for the firewall and running it with --proxy-type=none
).
How do I debug it?
More details could help. Do you get an error message? How is your code?
In any case, some ideas that may help to figure out what is happening are:
Set the window size to something appropriate for your tests.
driver.set_window_size(900, 800)
Save screenshots.
driver.save_screenshot('screen.png')
Check if the page source matches your expectations.
with open('temp.html', 'w') as f:
f.write(driver.page_source)
You may try to see if upgrading Selenium helps.
pip install selenium --upgrade
You may test other versions of PhantomJS, by downloading and specifying the path. Version 1.9.8 helped me with bypassing some security restrictions in the past.
driver = webdriver.PhantomJS(
executable_path='/path/to/the/downloaded/phantomjs19',
# you can specify args, such as:
service_args=[
'--ignore-ssl-errors=true',
'--ssl-protocol=any',
'--web-security=false',
],
# and also other capabilities:
desired_capabilities={
'phantomjs.page.settings.resourceTimeout': '5000',
'phantomjs.page.settings.userAgent': (
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/53 "
"(KHTML, like Gecko) Chrome/15.0.87"
),
},
)
Please, let me know if this helps!