Selenium - Remote Control - Unable to create new service: ChromeDriverService - selenium

When I start the selenium test with gird (Remote control), I see this ERROR on log. The browser is not able to open. I did check and tried the following things:
Stop and start both hub and node. I use the default commands to start hub and node. From command prompt, I see that the node was registered successfully and ready to use
Clean Eclipse Project at Project>Clean
Restart my PC
Disconnect VPN
Use latest selenium standalone 3.6; chromedriver.exe
Check the path to chromedriver.exe
Use my PC as hub and another PC as node
Please note that this issue only happen if I run the test with grid (remote control). The test can run normally locally.
2017-10-20 15:23:37,805 ERROR [Log] Class Utils | Method OpenBrowser | Exception desc : Unable to create new service: ChromeDriverService
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T16:15:40.131Z'
System info: host: 'MY-PC', ip: 'xx.xxx.xxx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_121'
Driver info: driver.version: unknown
Command duration or timeout: 319 milliseconds
Please give me advice in this case. Thanks!

Related

Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN10

I am getting following error. Can you advice.
`Exception in thread "main" org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure firefox is installed. OS appears to be: WIN10
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-25T15:32:14.902Z'
System info: host: 'CTSAUS-LT-641', ip: '10.243.111.75', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_172'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.firefox.FirefoxBinary.<init>(FirefoxBinary.java:116)
at java.util.Optional.orElseGet(Unknown Source)
at org.openqa.selenium.firefox.FirefoxOptions.getBinary(FirefoxOptions.java:217)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:161)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
at newpackage.MyClass.main(MyClass.java:11)`
Do as error message tells you: Make sure firefox is installed.
Then check out, if it is configured properly, i.e. firefox.exe is in a directory which appears in your PATH environment variable. You can check it out with typing echo %PATH% in your command line.
See where Fiurefox is installed for example by right-clicking on your Firefox desktop icon and then checking "Properties" dialog to see where it is installed.
If for example firefox.exe is in directory "C:\Program Files (x86)\Mozilla Firefox" then this directory has to appear in the (semicolon separated) list of the PATH varaible.

org.openqa.selenium.WebDriverException: unknown error: cannot determine loading status from unknown error: missing or invalid 'entry.level'

I am getting an weird error for a specific URL. I am running selenium webdriver script using TestNG, eclipse, and Maven.
My test:
#TestNG
{
MyPage mypg = new MyPage(driver);
mypage.openURL();
}
Calls this method:
public void openURL(){
//driver.get("http://www.site1.com/");
//driver.get("http://www.site2.com/");
driver.get("http://www.site3.com/");
System.out.println("Opened the URL");
}
When I run my test, site1 and site2 works just fine. It opens the URLS and then prints the message.
However, when I run my test for site3, it opens site3.com and then status stays in running mode. It never prints the message "opened the URL" and running mode(red button) stays on. Then I see the below error. I am not sure why it is acting this way for site3. It works for site1 and site2. I updated the maven project. I restarted Eclipse. It did not help. Please advise.
org.openqa.selenium.WebDriverException: unknown error: cannot
determine loading status from unknown error: missing or invalid
'entry.level' (Session info: chrome=63.0.3239.132) (Driver info:
chromedriver=2.29.461591
(62ebf098776g1772160f391d75e589dc567915b233),platform=Windows NT
140.10.155063 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 1.29 seconds
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'L-XP79550-A8198', ip: '1x2.1xx.1.1xx', os.name:
'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version:
'1.8.0_131' Driver info: org.openqa.selenium.chrome.ChromeDriver
I have a testng test. When I run the script, it opens URL and print message just fine. It d
After adding the dependencies to pom.xml, site3.com worked. Still not sure why site1 and 2 worked without these dependencies but site3 did not work. At least now it worked.
maven-compiler-plugin
maven-surefire-plugin
webdrivermanager
selenium-chrome-driver

Firefox 55/54 browser throws exception OR does not returns back the control to selenium code for maven project after initialization in Windows-7 x64

I have set up an ANT project to write my UI automation framework using Selenium 3.4.0. I am using Gecko driver v18.0 for supporting latest FF browser v55.
java version I am using is 1.8. This project initializes the FF browser with "desired capabilities" object and completes the test. IDE used for this project is Eclipse (Enide 2015). The unit testing framework here is TestNG.
I tried to replicate the same in a maven project using 3.4.0 selenium & Gecko driver v18.0. IDE I am using is IntelliJ. But here after the code executes the driver-initialize part, the browser window opens and then the control never comes back to selenium. The browser remains open for 10-15 min & process keeps running in the background. I have to stop the run to come out of it. Unit testing framework for Maven project here JBehave.
So I did few hit and trails to see the compatibility between Selenium and Gecko driver for Firefox:
Selenium 3.4.0 | Firefox v55 | Gecko Driver version - v15 for 32/64 bit |
Result:
After Initializing FF browser, control does not return back to Selenium.
Selenium 3.4.0 | Firefox v55 | Gecko Driver version - v16 for 32/64 bit |
Result:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=false, logLevel=null, prefs={}, profile=null}}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'xxx.xxx.xx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: FirefoxDriver
Selenium 3.5.1 | Firefox v55 | Gecko Driver version - v15-v19 for 32/64 bit |
Result:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=false, logLevel=null, prefs={}, profile=null}}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'xxx.xxx.xx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: FirefoxDriver
Selenium 2.53.1 | Firefox v55 | Gecko Driver version - v15 for 32/64 bit |
Result:
WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055
Selenium 2.53.1 | Chrome |
Result:
Test code executed successfully.
Selenium 3.5.1 | Firefox v54 | Gecko Driver version - v16 for 32/64 bit |
Result:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=false, logLevel=null, prefs={}, profile=null}}], required capabilities = Capabilities [{}]
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'XXXXX', ip: 'xxx.xxx.xx.xx', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: FirefoxDriver
I have read through most links mentioned below but it did not help-
Selenium 3.4.0 with Firefox 55
https://seleniumhq.wordpress.com/2017/08/09/firefox-55-and-selenium-ide/
Selenium 3.0 Firefx Driver fails with org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session
Unable to create new remote session - Selenium webdriver
https://github.com/mozilla/geckodriver/issues/749
https://github.com/SeleniumHQ/selenium/issues/3630
For the first entry above (...which is Selenium 3.4.0, Firefox v55 and Gecko drover v15 for 32/64 bit windows), when I did Ctrl+Shift+J I got the below log-
1505982873005 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1596" data: no] Stack trace:
loadExtensionState()#resource://gre/modules/addons/XPIProvider.jsm:1596 < getInstallState()#resource://gre/modules/addons/XPIProvider.jsm:1631 < checkForChanges()#resource://gre/modules/addons/XPIProvider.jsm:3152 < startup()#resource://gre/modules/addons/XPIProvider.jsm:2246 < callProvider()#resource://gre/modules/AddonManager.jsm:271 < _startProvider()#resource://gre/modules/AddonManager.jsm:741 < startup()#resource://gre/modules/AddonManager.jsm:908 < startup()#resource://gre/modules/AddonManager.jsm:3122 < observe()#jar:file:///C:/Program%20Files%20(x86)/Mozilla%20Firefox/omni.ja!/components/addonManager.js:65
While creating services from category 'profile-after-change', service for entry 'Notification Telemetry Service', contract ID '#mozilla.org/notificationTelemetryService;1' does not implement nsIObserver.
Warning: unrecognized command line flag --marionette
nsBrowserContentHandler.js:726
PAC file installed from http://autocache.hpecorp.net/
Property contained reference to invalid variable. Error in parsing value for ‘color’. Falling back to ‘inherit’. browser.css:251:7560
DEPRECATION WARNING: Search service falling back to synchronous initialization. This is generally the consequence of an add-on using a deprecated search service API.
My target is to use this framework for UI testing against the latest stable version of IE, Chrome & Firefox browser. Any help in this regard will be helpful.
I am having exactly same issue on MAC osx , I have been looking for solution for a couple of days
508672244107 mozrunner::runner INFO Running command: "/Applications/Firefox.app/Contents/MacOS/firefox-bin" "-marionette" "-profile" "/var/folders/0k/gv7bgjzs157b0mydntwdqj840000gy/T/rust_mozprofile.hixndTibKloe"
1508672244363 addons.xpi WARN Error parsing extensions state: [Exception... "Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [amIAddonManagerStartup.readStartupData]" nsresult: "0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: resource://gre/modules/addons/XPIProvider.jsm :: loadExtensionState :: line 1554" data: no] Stack trace: loadExtensionState()#resource://gre/modules/addons/XPIProvider.jsm:1554 < getInstallState()#resource://gre/modules/addons/XPIProvider.jsm:1589 < checkForChanges()#resource://gre/modules/addons/XPIProvider.jsm:3109 < startup()#resource://gre/modules/addons/XPIProvider.jsm:2188 < callProvider()#resource://gre/modules/AddonManager.jsm:269 < _startProvider()#resource://gre/modules/AddonManager.jsm:739 < startup()#resource://gre/modules/AddonManager.jsm:906 < startup()#resource://gre/modules/AddonManager.jsm:3090 < observe()#jar:file:///Applications/Firefox.app/Contents/Resources/omni.ja!/components/addonManager.js:65
1508672244714 Marionette INFO Enabled via --marionette
2017-10-22 14:37:25.560 plugin-container[2720:62009] * CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xad3f, name = 'com.apple.tsm.portname'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2017-10-22 14:37:25.560 plugin-container[2720:62009] * CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x560b, name = 'com.apple.CFPasteboardClient'
See /usr/include/servers/bootstrap_defs.h for the error codes.
2017-10-22 14:37:25.560 plugin-container[2720:62009] void __CFPasteboardSetup() : Failed to allocate communication port for com.apple.CFPasteboardClient; this is likely due to sandbox restrictions
1508672245808 Marionette INFO Listening on port 57372
1508672245923 Marionette DEBUG Register listener.js for window 2147483649
INFO 10/22 11:37:25 o.o.s.r.ProtocolHan~ - Falling back to original OSS JSON Wire Protocol.
INFO 10/22 11:37:25 o.o.s.r.ProtocolHan~ - Falling back to straight W3C remote end connection
22Oct2017 14:37:26,364 [INFO] TestCycle.initializeWebDriver - Error initializining: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions#67c2e933, browserName=firefox, moz:firefoxOptions=org.openqa.selenium.firefox.FirefoxOptions#67c2e933, version=, platform=ANY}], required capabilities = Capabilities [{}]
Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:57 -0700'
System info: host: 'tlv-mpp6a', ip: '172.29.53.33', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_121'
Driver info: driver.version: FirefoxDriver

Selenide tests hang in Firefox

I'm experiencing a problem running Selenide tests in Firefox version 46. When tests run separately everything works fine. But when I run all test methods in class it hangs on the following step:
addons.productaddons INFO sending request to: https://aus5.mozilla.org/update/3/GMP/46.0/20160421124000/WINNT_x86_64-msvc-x64/en-US/release/Windows_NT%206.1.1.0%20(x64)/default/default/update.xml
addons.productaddons INFO Completed downloading document
addons.productaddons INFO Downloading from https://cdmdownload.adobe.com/firefox/win/x64/primetime_gmp_win_x64_gmc_40673.zip to C:\Users\hunar_letsko\AppData\Local\Temp\tmpaddon
addons.productaddons INFO Downloading from http://ciscobinary.openh264.org/openh264-win64-0410d336bb748149a4f560eb6108090f078254b1.zip to C:\Users\hunar_letsko\AppData\Local\Temp\tmpaddon
addons.manager INFO Skipping background update check
DeferredSave.extensions.json DEBUG Save changes
DeferredSave.extensions.json DEBUG Starting timer
DeferredSave.extensions.json DEBUG Starting write
DeferredSave.extensions.json DEBUG Write succeeded
One more note: when test method are running more than 3 hours of hanging it fails with connection timeout:
org.openqa.selenium.WebDriverException: java.net.SocketTimeoutException: Read timed out
Build info: version: '3.0.0', revision: '350cf60', time: '2016-10-13 10:48:57 -0700'
System info: host: 'EPBYMINW2815', ip: '10.6.9.56', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_92'
Driver info: driver.version: RemoteWebDriver
selenide.url: app_url"
selenide.baseUrl: http://localhost:8080
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:91)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:322)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:902)
at com.codeborne.selenide.impl.Navigator.navigateToAbsoluteUrl(Navigator.java:69)
at com.codeborne.selenide.impl.Navigator.open(Navigator.java:31)
at com.codeborne.selenide.Selenide.open(Selenide.java:81)
at com.codeborne.selenide.Selenide.open(Selenide.java:55)
at
where app_url is my application's url.
Thanks for any help in advance, guys!
You need to downgrade Selenide. Selenide 4.0 works bad with Firefox.

Running two instances of web driver in parallel in windows 8

I use windows 8, selenium 2.42 and FF 27.
So i have some trouble.If ff run when i create new driver
WebDriver driver = new FirefoxDriver();
a have exeption
Exception in thread "main" org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
Build info: version: '2.42.2', revision: '6a6995d31c7c56c340d6f45a76976d43506cd6cc', time: '2014-06-03 10:52:47'
System info: host: 'bot-pc', ip: '25.111.126.28', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.6.0_45'
i want create 2 or 3 parallel instances FF, but this don't work if ff open.
What you need to use different port numbers for each of the driver instances. Have a look at https://code.google.com/p/selenium/wiki/FirefoxDriver. You can set system property webdriver.firefox.port to make firefox driver use a different port.