session null does not exist (WARNING: The server did not provide any stacktrace information - selenium

I am actually new to selenium, I have automated the website successfully using Firefox driver but when I tried the same code in IE am getting the subjected error in the driver.get(URL) line I used two different type simple code to open the browser and navigate to google which is not working.
please help me resolve this issue with IEDriver.
code 1:
System.setProperty("webdriver.ie.driver", "D:\\otherdata\\Selenium\\IEDriverServer.exe");
WebDriver driver= new InternetExplorerDriver();
driver.get("www.google.com");
code 2:
DesiredCapabilities IEcaps = DesiredCapabilities.internetExplorer();
IEcaps .setCapability(
InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,
true);
File SrcFile= new File("D:\\other data\\Selenium\\IEDriverServer.exe");
System.setProperty("webdriver.ie.driver", SrcFile.getAbsolutePath());
WebDriver driver = new InternetExplorerDriver(IEcaps );
driver.get("www.google.com");
ERROR:
Started InternetExplorerDriver server (32-bit)
3.5.1.0
Listening on port 5424
Only local connections are allowed
Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: session null does not exist (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:32:46'
System info: host: 'MGK-PC', ip: '192.168.1.108', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{capabilities={acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0, ie.ensureCleanSession=false, elementScrollBehavior=0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:5424/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, ignoreProtectedModeSettings=true}, browserName=internet explorer, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss, platformName=windows, setWindowRect=true}, sessionId=668e028c-b9e5-4ddc-8d0a-f2d61ac62bde, platform=ANY}]
Session ID: null
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: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.get(RemoteWebDriver.java:316)
at New.IE_Test.main(IE_Test.java:27)

Related

Unable to run selenium with IE browser via Jenkins

Selenium version 3.5
IEDriverserver - 3.5.0
IE version - 11
Jenkins version 2.75
private static final WebDriver WebDriverRefrence = null;{
}
public WebDriver driver ;
#BeforeTest
public void launchBrowser() {
Logger.getRootLogger().setLevel(Level.OFF);
System.setProperty("webdriver.ie.driver","C:\\AUTOMATION\\IEDriverServer.exe");
//Turn ON Protected Mode for the IE Browser
DesiredCapabilities aots = DesiredCapabilities.internetExplorer();
aots.setCapability("nativeEvents",false);
aots.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
driver = new InternetExplorerDriver(aots)
driver.get("https://www.gmail.com");
}
#Test
public void Test_case_001() throws InterruptedException {
driver.findElement(By.id("identifierId")).sendKeys("abc");
Thread.sleep(1000);
driver.findElement(By.xpath(".//*[#id='identifierNext']/div[2]")).click();
Thread.sleep(3000);
driver.findElement(By.xpath(".//*[#id='password']/div[1]/div/div[1]/input")).sendKeys("XXXXXX");
Thread.sleep(2000);
driver.findElement(By.xpath(".//*[#id='passwordNext']/div[2]")).click();
}
}
I have a simple Selenium code to login to Gmail.
I'm able to run successfully from eclipse (IE browser)
I'm able to run successfully from eclipse (FF browser)
I'm able to run successfully via Jenkins (FF browser)
But when I use IE browser and run via Jenkins, it fails.
The code and error is below. Don't know why element is not found when running via Jenkins.
Here is the error from testing output file :
-<test-method finished-at="2017-09-06T13:47:33Z" started-at="2017-09-06T13:47:26Z" duration-ms="6405" name="Test_case_001" signature="Test_case_001()[pri:0, instance:test2.practice#4c75cab9]" status="FAIL">
-<exception class="org.openqa.selenium.NoSuchElementException">
-<message>
-<![CDATA[Unable to find element with xpath == .//*[#id='password']/div[1]/div/div[1]/input
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DESKTOP-E0D9KLG', ip: '135.70.196.248', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_92'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0.0, ie.ensureCleanSession=false, elementScrollBehavior=0.0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:43511/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, ignoreProtectedModeSettings=true}, browserName=internet explorer, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
Session ID: 1baa5458-8f37-4e13-9119-08b88aba17f0
*** Element info: {Using=xpath, value=.//*[#id='password']/div[1]/div/div[1]/input}]]>
</message>
-<full-stacktrace>
-<![CDATA[org.openqa.selenium.NoSuchElementException: Unable to find element with xpath == .//*[#id='password']/div[1]/div/div[1]/input
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'DESKTOP-E0D9KLG', ip: '135.70.196.248', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_92'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{acceptInsecureCerts=false, browserVersion=11, se:ieOptions={nativeEvents=true, browserAttachTimeout=0.0, ie.ensureCleanSession=false, elementScrollBehavior=0.0, enablePersistentHover=true, ie.browserCommandLineSwitches=, ie.forceCreateProcessApi=false, requireWindowFocus=false, initialBrowserUrl=http://localhost:43511/, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000.0, ignoreProtectedModeSettings=true}, browserName=internet explorer, pageLoadStrategy=normal, unhandledPromptBehavior=dismiss, javascriptEnabled=true, platformName=windows, setWindowRect=true, platform=ANY}]
Session ID: 1baa5458-8f37-4e13-9119-08b88aba17f0
*** Element info: {Using=xpath, value=.//*[#id='password']/div[1]/div/div[1]/input}
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:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:185)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:120)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
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.findElement(RemoteWebDriver.java:414)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:513)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:406)
at test2.practice.Test_case_001(practice.java:79)
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:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
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.testng.TestNG.privateMain(TestNG.java:1355)
at org.testng.TestNG.main(TestNG.java:1324)

Selenium locator xpath not working for particular button

I'm looking for a working locator to address a button on a web page.
"Inspecting element" in the code I see :
<input class="ruButton ruBrowse" tabindex="-1" value="Select & Upload File" style="border: 0px dotted;" type="button">
Copying outerhtml I have :
<input tabindex="-1" value="Select & Upload File" class="ruButton ruBrowse" style="border: 0px dotted;" type="button">
I tried the following as xpath locators but these are not OK - I'd like to understand why :
//input[#value='Select & Upload File']
//input[#value='Select & Upload File']
This locator is OK :
driver.findElement(By.xpath("//input[contains(#class,'ruButton ruBrowse') and contains(#type,'button')]")).click();
More details on error log :
1)
driver.get(baseUrl);
driver.findElement(By.xpath("//input[contains(#value,'Select') and contains (#value,'Upload File')]")).click();
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with xpath == //input[contains(#value,'Select') and contains(#value,'Upload File')] (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 297 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
System info: host: 'BGC-W7X64T-2082', ip: '10.119.137.75', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_112'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:2351/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: 4613c6bf-239c-4ccb-b3b3-f1946276e7c7
*** Element info: {Using=xpath, value=//input[contains(#value,'Select') and contains(#value,'Upload File')]}
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:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:473)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
at Selenium_And_AutoIt.main(Selenium_And_AutoIt.java:61)
2)
driver.get(baseUrl);
driver.findElement(By.xpath("//input[#value='Select & Upload File']")).click();
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with xpath == //input[#value='Select & Upload File'] (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 281 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
System info: host: 'BGC-W7X64T-2082', ip: '10.119.137.75', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.8.0_112'
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, ignoreZoomSetting=false, ie.fileUploadDialogTimeout=3000, version=11, platform=WINDOWS, nativeEvents=true, ie.ensureCleanSession=false, elementScrollBehavior=0, ie.browserCommandLineSwitches=, requireWindowFocus=false, browserName=internet explorer, initialBrowserUrl=http://localhost:21427/, javascriptEnabled=true, ignoreProtectedModeSettings=false, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss}]
Session ID: eb3f9de0-2fc1-41ce-8f15-6947f956c216
*** Element info: {Using=xpath, value=//input[#value='Select & Upload File']}
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:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:473)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
at Selenium_And_AutoIt.main(Selenium_And_AutoIt.java:60)
Thank you !
For what it's worth, I've had trouble in the past with using text that has ampersand(s) inside as well. My solution is to use contains instead of "=" and only provide part of the value text, however, this might not be sufficient since there could conceivably be some other element that contains "Upload File" for example. My solution in this case, assuming that the locator as-is is incorrect, would be the following locator:
//input[contains(#value,'Select') and contains(#value,'Upload File')]
it could also substitute the 'contains' with 'starts-with' and 'ends-with' correspondingly.

Not able to check 2nd checkbox. Getting org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (106, 655)

I am getting WebDriverException while trying to select the 2nd checkbox in the list. I am able to select the 1st check box but on the 2nd time my code throwing exception. Please find the method that i am using and exception message below.
Note: Any suggestion will be helpful for me.
URL: https://www.snapdeal.com/products/computers-external-hard-drives?sort=plrty&q=Capacity_s%3A1%20TB%7C
public void capacitySelection(String capacity){
WebDriverWait wd = new WebDriverWait(driver, 180);
List<WebElement> cList = wd.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath("//div[#data-name='Capacity_s']/div")));
int i=1;
for(WebElement we:cList){
WebElement select= wd.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//div[#data-name='Capacity_s']/div["+ i++ +"]/label")));
if(select.getText().contains(capacity)){
select.click();
break;
}
}
}
Exception Message:
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (106, 655). Other element would receive the click: <label for="Capacity_s-3TB">...</label>
(Session info: chrome=54.0.2840.99)
(Driver info: chromedriver=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf),platform=Windows NT 6.2.9200 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 86 milliseconds
Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700'
System info: host: 'Bishnu', ip: '192.168.0.107', os.name: 'Windows 8', os.arch: 'amd64', os.version: '6.2', java.version: '1.8.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.24.417431 (9aea000394714d2fbb20850021f6204f2256b9cf), userDataDir=C:\Users\Bishnu\AppData\Local\Temp\scoped_dir11044_5076}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=54.0.2840.99, platform=WIN8, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 505ec9fb429bc6b9806edb52d75856f0
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:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:274)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
at in.prolearn.pages.HomePage.SecondCapacitySelection(HomePage.java:59)
at in.prolearn.testcases.VerifySnapDealSelection.main(VerifySnapDealSelection.java:22)
Thanks.
Can you use JavaScript instead
WebElement product = new WebDriverWait(aDriverInstance, 5L).
until(ExpectedConditions.visibilityOfElementLocatedBy(By.id("anID")));
JavascriptExecutor jsExec = (JavascriptExecutor) aDriverInstance;
jsExec.executeScript("arguments[0].scrollIntoView()", product);
Actions actions = new Actions(driver);
actions.moveToElement(select).click().perform();
Try to click the element with Actions class. This will help you.
Use .isSelected() method before performing click on that element.

How to safely update chromedriver on selenium nodes

I have a selenium grid setup with one hub and 5 nodes. they both use the same version of selenium server 2.41.0.
On the nodes there are already chromedriver setup in the same folder as selenium sever.
Now the task is to update the chromedriver without broken any existing jenkins tests.
I have tried manually go to each nodes and update the chromedriver file. But, the tests on jenkins will throw WebDriverException saying unable to create driver.
What could be the issue here?
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver
14:08:37.077 INFO - Executing: [new session: Capabilities [{platform=LINUX, browserName=chrome, proxy={socksUsername=null, noProxy=null, httpProxy=proxy.xxx-stage.com:80, socksPassword=null, ftpProxy=null, sslProxy=proxy.xxx-stage.com:443, proxyAutoconfigUrl=null, proxyType=MANUAL, class=org.openqa.selenium.Proxy, autodetect=false, hCode=1182650898, socksProxy=null}, version=, chrome.switches=[--start-maximized]}]] at URL: /session)
14:08:37.078 INFO - Creating a new session for Capabilities [{platform=LINUX, browserName=chrome, proxy={socksUsername=null, noProxy=null, httpProxy=proxy.xxx-stage.com:80, socksPassword=null, ftpProxy=null, sslProxy=proxy.xxx-stage.com:443, proxyAutoconfigUrl=null, proxyType=MANUAL, class=org.openqa.selenium.Proxy, autodetect=false, hCode=1182650898, socksProxy=null}, version=, chrome.switches=[--start-maximized]}]
Starting ChromeDriver (v2.10.267518) on port 13326
Only local connections are allowed.
[0.500][WARNING]: PAC support disabled because there is no system implementation
14:09:38.101 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:188)
at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:177)
at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:113)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:90)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:96)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:63)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:202)
at org.openqa.selenium.remote.server.JsonHttpRemoteConfig.handleRequest(JsonHttpRemoteConfig.java:193)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:174)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:140)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:112)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:72)
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.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:170)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.server.DefaultDriverFactory.callConstructor(DefaultDriverFactory.java:62)
... 8 more
Caused by: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 3.11.10-100.fc18.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.52 seconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'dseleniumnode05.xxx-dev.com', ip: 'xx.xx.xx.xxx', os.name: 'Linux', os.arch: 'amd64', os.version: '3.11.10-100.fc18.x86_64', java.version: '1.7.0_45'
Driver info: org.openqa.selenium.chrome.ChromeDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
at org.openqa.selenium.chrome.ChromeDriver.startSession(ChromeDriver.java:181)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:139)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:160)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:128)
... 13 more
14:09:38.103 WARN - Exception: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.10.267518,platform=Linux 3.11.10-100.fc18.x86_64 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.52 seconds
the matter is that instance of driver is created on host machine (using existing chromdriver file there). Obviously once you substitute updated chrome driver file (of a newer version) older one -> everything should work fine after driver instance reinitizalization.
To initialize driver , I'm using following java piece of code:
public static WebDriver driverSetUp(WebDriver driver) throws MalformedURLException {
DesiredCapabilities capability = DesiredCapabilities.chrome();
log.info("Google chrome is selected");
System.setProperty("webdriver.chrome.driver", "....path/chromedriver.exe");
capability.setBrowserName("chrome");
capability.setPlatform(org.openqa.selenium.Platform.WINDOWS);
String webDriverURL = "http://" + environmentData.getHubIP() + ":" + environmentData.getHubPort() + "/wd/hub";
driver = new RemoteWebDriver(new URL(webDriverURL), capability);
driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().window().setSize(new Dimension(1920, 1080));
return driver;
}
Try it out and let us know whether issue persists. Thanks.

i got the error while running javascript for IE11

below is my code :
package project1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class SearchInGoogle {
public static void main(String[] args) throws InterruptedException {
System.setProperty("webdriver.ie.driver", "D:\\IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver();
driver.get("http://www.google.com");
WebElement searchBox = driver.findElement(By.name("q"));
searchBox.sendKeys("Packt Publishing");
searchBox.submit();
}
}
output:
Started InternetExplorerDriver server (32-bit)
2.29.1.0
Listening on port 17311
Exception in thread "main" org.openqa.selenium.NoSuchElementException: Unable to find element with name == q (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 296 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:30'
System info: host: 'GNRSEZDT00035', ip: '10.210.6.68', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_45'
Session ID: 00659ae5-b108-4fc4-b59c-390b1c15c879
Driver info: org.openqa.selenium.ie.InternetExplorerDriver
Capabilities [{platform=WINDOWS, elementScrollBehavior=0, javascriptEnabled=true, enablePersistentHover=true, ignoreZoomSetting=false, browserName=internet explorer, enableElementCacheCleanup=true, unexpectedAlertBehaviour=dismiss, version=11, cssSelectorsEnabled=true, ignoreProtectedModeSettings=false, requireWindowFocus=false, allowAsynchronousJavaScript=false, initialBrowserUrl=, handlesAlerts=true, nativeEvents=true, takesScreenshot=true}]
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:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByName(RemoteWebDriver.java:425)
at org.openqa.selenium.By$ByName.findElement(By.java:299)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344)
at project1.SearchInGoogle.main(SearchInGoogle.java:13)
I m getting the above error. The above code is able to open the page in IE11 but it is not finding any elements. I tried all elements and I already set the IE11's security settings. So do u have any other solution for this problem?