Capabilities error after using selenium grid and Webdriver manager - selenium-webdriver

I have been using [webdriver manager][1] for local executions, it has been outstanding, however right now I'm trying to use a selenium grid and I would like to use the same approach but I'm getting some errors related to capabilities.
The hub and node are localhost, these are the details of my implementation:
I'm starting the hub with this line:
start cmd /k java -jar selenium-server-standalone-3.5.0.jar -role hub -port 4443
I'm starting the node with this line
start cmd /k java -jar selenium-server-standalone-3.5.0.jar -port 5556 -role node -hub http://localhost:4443/grid/register
This is the configuration that I'm using for the browsers, the problem is with chrome, I haven't tested the other ones yet.
public WebDriver cbt(String browser, String methodName) throws Exception{
WebDriver driver;
DesiredCapabilities caps;
//Check if parameter passed from TestNG is 'firefox'
if(browser.equalsIgnoreCase("firefox"))
{
caps = DesiredCapabilities.firefox();
caps.setCapability("platform", "Windows 10");
caps.setCapability("version", "53.0");
caps.setCapability("name", methodName);
}
//Check if parameter passed as 'chrome'
else if(browser.equalsIgnoreCase("chrome"))
{
caps = DesiredCapabilities.chrome();
}
else if(browser.equalsIgnoreCase("ie")){
caps = DesiredCapabilities.edge();
caps.setCapability("platform", "Windows 10");
caps.setCapability("version", "14.14393");
caps.setCapability("name", methodName);
}
else{
//If no browser passed throw exception
throw new Exception("Browser is not correct");
}
String hub = "http://localhost:4443/wd/hub";
driver = new RemoteWebDriver(new URL(hub), caps);
return driver;
}
These are the errors that I'm getting
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{browserName=chrome, version=, platform=ANY}], required capabilities = Capabilities [{}]
Build info: version: '3.3.1', revision: '5234b325d5', time: '2017-03-10 09:10:29 +0000'
System info: host: 'NEYMAR', ip: '169.254.112.118', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_45'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:244)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:158)
at com.gnow.gnow.Utils.CommonConfiguration.cbt(CommonConfiguration.java:213)
at com.gnow.gnow.Test.Test.setUp(Test.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:217)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:590)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
Thanks in advance
[1]: https://github.com/bonigarcia/webdrivermanager

First thing i would suggest is that you upgrade your selenium version to Selenium 3.5.1
There was a bug in Selenium 3.3.1 wherein the actual error wouldn't be passed on to the end-user, and your stacktrace seems to suggest that it's perhaps due to that bug is why you aren't able to see the real problem. This bug was fixed in 3.4.0
Once you upgrade to Selenium 3.5.1 in your client side, you should immediately see the problem.
Since you mentioned Chrome, am guessing that it is perhaps due to the fact that your chromedriver is not available in the PATH.
You might want to take a look at this tutorial I wrote up on Grid, which tells you the set of things that is required to get the Grid up and running. I have included a lot of other information about the Grid as well in there.

Related

Appium_Error : Returned value cannot be converted to WebElement with Xcode 10.0

Getting the error 'Returned value cannot be converted to WebElement'
Xcode Version : 10.0
Appium Server Version : 1.9.1 / 1.13.0
Appium Client Version : 6.1.0 / 7.0.0
Selenium Version : 3.9.1 / 3.14.0
IOS Simulator Version : 11.4
Have tried with different versions as below:
Appium Server version : from 1.7.2 to 1.14.2 beta
Appium Client version : 5.0.4 to 7.0.0
Also tried to include implicit wait and explicit waits as well. No luck :(
Appium Logs Client Side as below:
[RemoteTestNG] detected TestNG version 6.11.0
Jul 01, 2019 10:34:30 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
FAILED CONFIGURATION: #BeforeSuite setupDriver
org.openqa.selenium.WebDriverException: Returned value cannot be converted to WebElement: {element-6066-11e4-a52e-4f735466cecf=2B000000-0000-0000-777A-000000000000, ELEMENT=2B000000-0000-0000-777A-000000000000}
Build info: version: '3.5.2', revision: '10229a9', time: '2017-08-21T17:29:55.15Z'
System info: host: 'Bindacharyas-MacBook-Pro.local', ip: 'fe80:0:0:0:c4b:5bdc:c1c1:72f2%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.5', java.version: '1.8.0_211'
Driver info: driver.version: IOSDriver
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:421)
at io.appium.java_client.DefaultGenericMobileDriver.findElement(DefaultGenericMobileDriver.java:62)
at io.appium.java_client.AppiumDriver.findElement(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.findElement(IOSDriver.java:1)
at io.appium.java_client.FindsByAccessibilityId.findElementByAccessibilityId(FindsByAccessibilityId.java:31)
at com.noon.ui.tests.sanitySuites.TestIOSAnother.prepareIOSForAppium(TestIOSAnother.java:103)
at com.noon.ui.tests.sanitySuites.TestIOSAnother.setupDriver(TestIOSAnother.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:326)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.lang.ClassCastException: java.util.HashMap cannot be cast to org.openqa.selenium.WebElement
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:419)
... 25 more
Few Lines of Code as below:
capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6s Plus");
capabilities.setCapability("wdaStartupRetries", 5);
capabilities.setCapability("autoAcceptAlerts", true);
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("newCommandTimeout", 250);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "11.4");
capabilities.setCapability(MobileCapabilityType.APP, "/Users/bindacharyaj/Documents/Simulator/k12App-ios.app");
capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
capabilities.setCapability(MobileCapabilityType.UDID, "777EA4A8-0C82-485D-8347-8EF3527B135A");
capabilities.setCapability("bundleId", "com.noonEdu.k12App");
capabilities.setCapability("updatedWDABundleId", "com.facebook.wda.lib");
capabilities.setCapability("wdaLocalPort", 8101);
driver = new IOSDriver<MobileElement>(url, capabilities);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
System.out.println(driver.getContext());
driver.context("NATIVE_APP");
}
// 6
#Test(enabled = true)
public void myFirstTest() throws InterruptedException {
Thread.sleep(000);
System.out.println("Test Started");
((WebElement) driver.findElement(By.xpath("//XCUIElementTypeStaticText[#name='السعودية']"))).click();
System.out.println("Click -1");
Thread.sleep(2000);
Appium launches the app but not able to click on any of the native elements.
Any help would be appreciated!!
Thanks in advance... !!!!

Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

I am trying to run a simple program using Selenium Grid(have no prior knowledge of selenium grid), and I am having error shown as below:
Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DEL1-LTC1X3PH2', ip: '192.168.0.101', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: driver.version: RemoteWebDriver
Below is my sample code:
String URL = "http://www.DemoQA.com";
String Node = "http://192.168.1.164:4444/wd/hub";
DesiredCapabilities cap = DesiredCapabilities.chrome();
cap.setBrowserName("firefox");
//cap.setPlatform(Platform.WIN10);
driver = new RemoteWebDriver(new URL(Node), cap);
driver.navigate().to(URL);
Thread.sleep(5000);
driver.quit();
Can someone please explain why this error is coming, and any reference from where I can get to know more about selenium grid.
This error looks like it's occurring because you don't have a Selenium Grid running with a hub at the URL you provided. You need to start the grid yourself, Selenium won't start it for you the way it will start up a single session. You can use docker and docker-compose to start your grid using the instructions here.
You can find more information about Selenium Grid here.
Also, rather than use
DesiredCapabilities cap = DesiredCapabilities.chrome();
cap.setBrowserName("firefox");
you can condense to one line and use
DesiredCapabilities cap = DesiredCapabilities.firefox();
to set up your DesiredCapabilities.

Chrome not reachable Selenium WebDriver error

I am facing this issue; I know this question is already present and I have tried the solutions mentioned hence asking this with my configurations and code.
Earlier the scripts were running but now they aren't So i tried making a basic open browser script.
Latest Version of Selenium WebDriver : http://selenium-release.storage.googleapis.com/3.5/selenium-java-3.5.0.zip
Latest Version on ChromeDriver : http://chromedriver.storage.googleapis.com/index.html?path=2.31/
Basic Open browser code:
package Trial;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class Trial_Class {
public static void main(String args[]){
System.setProperty("webdriver.chrome.driver", "chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://www.youtube.com");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
}
But still I am getting the below error:
Starting ChromeDriver 2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 43967
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: chrome not reachable
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.3.9600 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 61.81 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'SWATI', ip: '192.168.0.5', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_121'
Driver info: driver.version: ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$24(ProtocolHandshake.java:360)
at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:363)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:137)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:641)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:254)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:178)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:167)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124)
at Trial.Trial_Class.main(Trial_Class.java:11)
Thanks in Advance.
Your chromedriver is starting just fine:
"Starting ChromeDriver 2.31.488763
(092de99f48a300323ecf8c2a4e2e7cab51de5ba8) on port 43967"
The problem is the browser itself is not responding. So I have two ideas:
1) Your browser is not installed in the default location; If this is the case, add this to your code:
ChromeOptions options = new ChromeOptions();
options.setBinary("/path/to/other/chrome/binary");
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
WebDriver driver = new ChromeDriver(capabilities);
2) Your browser is latest version, but your chromedriver isn't - current is 2.33
I found that chromedriver had hard time to resolve localhost and during that it printed
Timed out connecting to Chrome, retrying...
It first tried to connect via ipv6 and then I guess fall back to ipv4. So what worked for me was to change the priority of "localhosts" this way
The only piece you should need to do is change the priority:
Open RegEdit, navigate to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\tcpip6\Parameters
Create DisabledComponents DWORD registry value, set its value to 20
(Hexadecimal). src
you have to set the
setProperty(String key, String path)
here "key" is your "webdriver.chrome.driver" and "path" is "path where your driver is stored". Use single forward slash "/" in path.
System.setProperty("webdriver.chrome.driver", "E:/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://www.youtube.com");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Above code is work well in Selenium jar 3.5.0. Hope works fine in your system too.

In jenkins getting this error org.openqa.selenium.WebDriverException: unknown error: unable to discover open pages

I m trying to run the selenium scripts in jenkins(#localhost) using pom.xml but facing issues w.r.t chrome driver.
Chrome Version 52.0
Selenium-server 2.53.0
Below is the complete stacktrace:
================================================================
Tests run: 7, Failures: 1, Errors: 0, Skipped: 6, Time elapsed: 63.654 sec <<< FAILURE! - in TestSuite
init(com.arrk.pages.AppleTest) Time elapsed: 63.416 sec <<< FAILURE!
org.openqa.selenium.WebDriverException: unknown error: unable to discover open pages
=====================================================================
(Driver info: chromedriver=2.9.248315,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.92 seconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'akshayk', ip: '10.0.2.58', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
=======================================================================
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:159)
at org.openqa.selenium.chrome.ChromeDriver.(ChromeDriver.java:116)
at com.arrk.webdriver.WebDriverFactory.getInstance(WebDriverFactory.java:125)
at com.arrk.webdriver.WebDriverFactory.getInstance(WebDriverFactory.java:64)
at com.arrk.pages.TestBase.init(TestBase.java:145)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:510)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:211)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:170)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:104)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1048)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:217)
at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:84)
at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:92)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Tried every possible solution regarding this problem. If any more solution there then please let me know.
This looks similar to a bug report on Chrome 51-53:
org.openqa.selenium.remote.server.DriverServlet - Exception: unknown error: unable to discover open pages
That bug links to the main Chrome bug "Fails to navigate to URL when Chrome 51 is launched in session 0 / through CI". Launching a Jenkins slave installed as a Windows service uses session 0.
The gist is running Chrome from session 0 broke in Chrome 51. The short term workarounds include dropping back to Chrome 50 (if you can find it), or running with the Chrome option "no-sandbox", like so:
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.AddArguments("test-type");
chromeOptions.AddArguments("no-sandbox");
PropertiesCollection.driver = new ChromeDriver(chromeOptions);
A fix is expected in Chrome 54, however the bug response says they aren't planning long-term support for session 0. I am all ears if anyone knows how to launch a Jenkins slave from something other than session 0 on Windows.

org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms

I am facing issue while executing the selenium scripts in firefox browser.
Console Error:
org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
Build info: version: '2.39.0', revision: 'ff23eac', time: '2013-12-16 16:11:15'
System info: host: 'usnywqa01', ip: '10.3.3.20', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_17'
Driver info: driver.version: FirefoxDriver
Build info: version: '2.39.0', revision: '14fa800511cc5d66d426e08b0b2ab926c7ed7398', time: '2013-12-16 13:18:38'
System info: host: abc-PV-5', ip: 'XX.X.XX.XX', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_07'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:98)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:84)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:250)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:110)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:197)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:190)
at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:108)
at sun.reflect.GeneratedConstructorAccessor51.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:62)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:56)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:216)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:170)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I tried by changing selenium server to 2.35 or 2.39 and I upgraded ff to 26. But it doesnt work
When I degrade my ff version to 24, my scripts are working fine.
I would like to know why it is happened and root causes
I would like to know what is permanent solution for above 24 version of ff.
Please help me on this.
Seems like an issue with webdriver version. Can you try once with latest bindings i.e 2.40.0. To get more info on webdriver version and supported firefox version please go throgh webdriver release notes :http://selenium.googlecode.com/git/java/CHANGELOG
I had the same message before and I actually found out that the problem was the hosts file in my Mac (/private/etc/hosts). I don't know the reason but somehow it was pointing to an invalid IP in my network. Replacing the line for localhost pointing to 127.0.0.1 solved the problem for me. In resume, I was trying to access the Firefox in some other machine (odd!)
I had the same problem with the same output, i.e:
org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
I was using Selenium and Java in my project in Eclipse IDE and when I tried to run tests, firefox window opened, but nothing happened later (i.e. it was blank and couldn't catch the URL from my test).
Solution: I changed the version of the driver in my POM.xml file from 2.42.x to 2.43.1. I rebuilt my project and now it works fine.
Now my POM.xml file looks as follows:
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.43.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
Just try out the newest version of selenium driver or try to downgrade firefox (when you download firefox, it automatically downloads its latest version; some people claim that downgrading to older version may help).
Issue seems to be with Firefox latest version does not support web driver.
Was facing similar issue, used chrome driver instaed of Firefox and it worked.
When we download web driver and extract it to a folder, changelog file will be there, open it with notepad, supported Firefox version is mentioned. So we can successfully execute script on mentioned firefox version.

Resources