I use the below code for multiple selection in spreadsheet
it('Cell Formatting - Formatting 2', function (done) {
browser.get(browser.basePath + '/demos/spreadsheet/index.html');
browser.driver.sleep(500);
var elem1 = browser.driver.findElement(By.xpath('//*[#id="Spreadsheet_main_content"]/div[1]/table/tbody/tr[2]/td[6]'));
var elem2 = browser.driver.findElement(By.xpath('//*[#id="Spreadsheet_main_content"]/div[1]/table/tbody/tr[5]/td[6]'));
browser.actions().click(elem1).keyDown(protractor.Key.SHIFT).perform();
browser.driver.sleep(500);
browser.actions().click(elem2).keyUp(protractor.Key.SHIFT).perform();
browser.driver.sleep(500);
//font color
browser.driver.findElement(by.xpath('(//button[#class="e-icon-btn e-control e-dropdown-btn e-lib e-btn"])[2]')).click();
browser.driver.sleep(500);
browser.driver.findElement(by.xpath('//span[#aria-label="#ff3333ff"]')).click();
//fill color
browser.driver.findElement(by.xpath('(//button[#class="e-icon-btn e-control e-dropdown-btn e-lib e-btn"])[3]')).click();
browser.driver.sleep(500);
browser.driver.findElement(by.xpath('//span[#aria-label="#ffff00ff"]')).click();
browser.driver.sleep(500);
browser.compareScreen(element(By.id('Spreadsheet')), 'CellFormatting_002');
done();
});
Error Message :
1) FR_Spreadsheet Cell_Formatting Cell Formatting - Formatting 2
Message:
Failed: sendKeysToActiveElement
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'SYNCLAPN-26795', ip: '192.168.1.7', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '18.0.1.1'
Driver info: driver.version: unknown
Stack:
UnsupportedOperationError: sendKeysToActiveElement
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'SYNCLAPN-26795', ip: '192.168.1.7', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '18.0.1.1'
Driver info: driver.version: unknown
at Object.checkLegacyResponse (D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\error.js:546:15)
at parseHttpResponse (D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\http.js:509:13)
at doSend.then.response (D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\http.js:441:30)
at process._tickCallback (internal/process/next_tick.js:68:7)
From: Task: keyDown
at thenableWebDriverProxy.schedule (D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\webdriver.js:807:17)
at actions.map.action (D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\actions.js:124:23)
at Array.map (<anonymous>)
at D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\actions.js:123:29
at TaskQueue.execute_ (D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_ (D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\promise.js:3067:27)
at asyncRun (D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\promise.js:2927:27)
at D:\EJ2_Automation\ej2-spreadsheet-e2e\feature-matrix-samples\node_modules\selenium-webdriver\lib\promise.js:668:7
at process._tickCallback (internal/process/next_tick.js:68:7)
How to resolve this issue?
enter image description hereI am trying to access the my office mail to get the OTP code sent to my mail id. But with Selenium Webderiver I am not able to handle the Select a Certificate windows popup. I have attached the pop up screen shot and code.
driver.get("https://outlook.office365.com/owa/");
driver.findElement(By.cssSelector("input#userNameInput")).sendKeys("username");
driver.findElement(By.cssSelector("input#passwordInput")).sendKeys("password");
driver.findElement(By.cssSelector("span#submitButton")).click();
driver.switchTo().alert().accept();
Below is the error log:
org.openqa.selenium.NoAlertPresentException: no alert open
(Session info: chrome=59.0.3071.115)
(Driver info: chromedriver=2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 8.95 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'BLR1-LP6R5XLC2', ip: '10.74.209.87', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_65'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41), userDataDir=C:\Users\e3028099\AppData\Local\Temp\scoped_dir11924_9010}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=59.0.3071.115, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 0eff339a449a81e2ab5b3733deec9a91
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:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:638)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:661)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.alert(RemoteWebDriver.java:990)
at regressiontestcase.NewTest.sampleTest(NewTest.java:21)
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:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
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.AbstractRemoteT[enter image description here][1]estNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
[Chrome Select a Certificate Popup][2]
There seems to be an issue with the latest Chrome version.
I've rolled back to the previous stable one and it's working.
Can't tell if it's the chrome driver / selenium framework.
[03/07/2017] [13:02] [OpenQA.Selenium.NoSuchFrameException: no such frame
(Session info: chrome=59.0.3071.115)
(Driver info: chromedriver=2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41),platform=Windows NT 6.3.9600 x86_64)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteTargetLocator.Frame(Int32 frameIndex)
I am loading custom profile of chrome by using following code:
ChromeDriverService chSvc = new ChromeDriverService.Builder().usingDriverExecutable(new File("C://Users//kanu//Downloads//Selenium//chromedriver_win32//chromedriver.exe")).usingAnyFreePort().build();
ChromeOptions chOption = new ChromeOptions();
/**
* "user-data-dir = profilepath" --to open profile
* "--start-maximized" for maximize the browser
*/
chOption.addArguments("user-data-dir = C:/Users/kanu/AppData/Local/Google/Chrome/New User");
chOption.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(chSvc, chOption);
driver.get("https://www.google.com");
it works and run the existing profile of chrome but is not opening the desired url and getting following exception :
Starting ChromeDriver 2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9) on port 43388
Only local connections are allowed.
Mar 15, 2017 10:55:27 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Exception in thread "main" org.openqa.selenium.NoSuchSessionException: no such session
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.10586 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 8 milliseconds
Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
System info: host: 'GUR-ACC093-W', ip: '100.102.83.217', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_102'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{message=unknown error: Chrome failed to start: crashed
(Driver info: chromedriver=2.27.440174 (e97a722caafc2d3a8b807ee115bfb307f7d2cfd9),platform=Windows NT 10.0.10586 x86_64), platform=ANY}]
Session ID: ea04006993fa5bd7530cfe75cca7ae0d
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:638)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:325)
at launch.LaunchChrome.main(LaunchChrome.java:50)
Can anyone please resolve this?
I'm using docker, on first tab is running selenium, on second project, on third I run protractor tests. Conf file for protractor:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['todo-spec.js'],
framework: 'jasmine',
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['--no-sandbox', '--disable-gpu', '--enable-logging=stderr', '--user-data-dir=/usr/src/app'],
},
},
onPrepare: function() {
var SpecReporter = require('jasmine-spec-reporter');
// add jasmine spec reporter
jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: 'all'}));
},
jasmineNodeOpts: {
print: function() {}
}
};
First run of tests is ok, here are logs for that:
Selenium Server is up and running
16:35:20.651 INFO - Executing: [new session: Capabilities [{count=1, browserName=chrome, chromeOptions={args=[--no-sandbox, --disable-gpu, --enable-logging=stderr, --user-data-dir=/usr/src/app]}}]])
16:35:20.699 INFO - Creating a new session for Capabilities [{count=1, browserName=chrome, chromeOptions={args=[--no-sandbox, --disable-gpu, --enable-logging=stderr, --user-data-dir=/usr/src/app]}}]
Starting ChromeDriver 2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac) on port 3980
Only local connections are allowed.
16:35:26.862 INFO - Done: [new session: Capabilities [{count=1, browserName=chrome, chromeOptions={args=[--no-sandbox, --disable-gpu, --enable-logging=stderr, --user-data-dir=/usr/src/app]}}]]
16:35:27.043 INFO - Executing: [set script timeout: 11000])
16:35:27.224 INFO - Done: [set script timeout: 11000]
16:35:32.447 INFO - Executing: [get: http://localhost:3000/keystone])
16:35:35.632 INFO - Done: [get: http://localhost:3000/keystone]
16:35:35.773 INFO - Executing: [find element: By.cssSelector: *[name="email"]])
16:35:36.606 INFO - Done: [find element: By.cssSelector: *[name="email"]]
16:35:36.657 INFO - Executing: [send keys: 0 [[ChromeDriver: chrome on LINUX (409a6b2de12c89405755981b76346cb0)] -> css selector: *[name="email"]], [m, c, g, l, a, b, s, #, g, m, a, i, l, ., c, o, m]])
16:35:37.137 INFO - Done: [send keys: 0 [[ChromeDriver: chrome on LINUX (409a6b2de12c89405755981b76346cb0)] -> css selector: *[name="email"]], [m, c, g, l, a, b, s, #, g, m, a, i, l, ., c, o, m]]
16:35:37.179 INFO - Executing: [find element: By.cssSelector: *[name="password"]])
16:35:37.249 INFO - Done: [find element: By.cssSelector: *[name="password"]]
16:35:37.282 INFO - Executing: [send keys: 1 [[ChromeDriver: chrome on LINUX (409a6b2de12c89405755981b76346cb0)] -> css selector: *[name="password"]], [p, a, s, s, w, o, r, d]])
16:35:37.936 INFO - Done: [send keys: 1 [[ChromeDriver: chrome on LINUX (409a6b2de12c89405755981b76346cb0)] -> css selector: *[name="password"]], [p, a, s, s, w, o, r, d]]
16:35:37.985 INFO - Executing: [find element: By.cssSelector: button[type="submit"]])
16:35:38.114 INFO - Done: [find element: By.cssSelector: button[type="submit"]]
16:35:38.327 INFO - Executing: [click: 2 [[ChromeDriver: chrome on LINUX (409a6b2de12c89405755981b76346cb0)] -> css selector: button[type="submit"]]])
16:35:39.094 INFO - Done: [click: 2 [[ChromeDriver: chrome on LINUX (409a6b2de12c89405755981b76346cb0)] -> css selector: button[type="submit"]]]
16:35:39.153 INFO - Executing: [get: http://localhost:3000/keystone/properties/])
16:35:40.447 INFO - Done: [get: http://localhost:3000/keystone/properties/]
16:35:40.483 INFO - Executing: [find element: By.cssSelector: .btn-create-item])
16:35:42.420 WARN - Exception thrown
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":".btn-create-item"}
(Session info: chrome=55.0.2883.87)
(Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.4.27-moby x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.23 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: '9c29ea21cf96', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.27-moby', java.version: '1.7.0_111'
*** Element info: {Using=css selector, value=.btn-create-item}
Session ID: 409a6b2de12c89405755981b76346cb0
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/usr/src/app, chromedriverVersion=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac)}, networkConnectionEnabled=false, unexpectedAlertBehaviour=, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=55.0.2883.87, pageLoadStrategy=normal, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]
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: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.findElement(RemoteWebDriver.java:363)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:492)
at org.openqa.selenium.By$ByCssSelector.findElement(By.java:430)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:355)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:103)
at com.sun.proxy.$Proxy1.findElement(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver.findElement(EventFiringWebDriver.java:188)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:48)
at org.openqa.selenium.remote.server.handler.FindElement.call(FindElement.java:1)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
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:745)
16:35:42.702 WARN - Exception: no such element: Unable to locate element: {"method":"css selector","selector":".btn-create-item"}
(Session info: chrome=55.0.2883.87)
(Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.4.27-moby x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.23 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: '9c29ea21cf96', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.27-moby', java.version: '1.7.0_111'
*** Element info: {Using=css selector, value=.btn-create-item}
Session ID: 409a6b2de12c89405755981b76346cb0
But when I run second time protactor tests I got:
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=/usr/src/app, chromedriverVersion=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac)}, networkConnectionEnabled=false, unexpectedAlertBehaviour=, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=55.0.2883.87, pageLoadStrategy=normal, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=false, applicationCacheEnabled=false, takesScreenshot=true}]
16:38:43.511 INFO - Executing: [new session: Capabilities [{count=1, browserName=chrome, chromeOptions={args=[--no-sandbox, --disable-gpu, --enable-logging=stderr, --user-data-dir=/usr/src/app]}}]])
16:38:43.529 INFO - Creating a new session for Capabilities [{count=1, browserName=chrome, chromeOptions={args=[--no-sandbox, --disable-gpu, --enable-logging=stderr, --user-data-dir=/usr/src/app]}}]
Starting ChromeDriver 2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac) on port 20127
Only local connections are allowed.
Created new window in existing browser session.
16:39:44.925 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: '9c29ea21cf96', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.27-moby', java.version: '1.7.0_111'
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:183)
at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:119)
at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)
at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:124)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:59)
at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111)
at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:79)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:204)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:166)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:132)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
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.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: '9c29ea21cf96', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.27-moby', java.version: '1.7.0_111'
Driver info: driver.version: unknown
at org.openqa.selenium.remote.server.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:113)
at org.openqa.selenium.remote.server.DefaultDriverProvider.newInstance(DefaultDriverProvider.java:97)
at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)
at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)
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:176)
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:745)
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.DefaultDriverProvider.callConstructor(DefaultDriverProvider.java:103)
... 9 more
Caused by: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.4.27-moby x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 61.28 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: '9c29ea21cf96', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.27-moby', java.version: '1.7.0_111'
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: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.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:170)
at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:138)
... 14 more
16:39:44.939 WARN - Exception: unknown error: Chrome failed to start: exited abnormally
(Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 4.4.27-moby x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 61.28 seconds
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: '9c29ea21cf96', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.27-moby', java.version: '1.7.0_111'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Exception: unknown error: Chrome failed to start: exited abnormally
It looks like that selenium try to connect to chromeDriver but without success. Have You any suggestion what is reason of problem ?
Running a TestNG testcase in Eclipse, and getting the values from Ui, using attribute("value").
BUt while execution, if the webelement is not present/Found on UI, I need to take the UIvalue = 00:00.
try {
UIValue = driver.findElement(By.id("ctl00_MainContent_AllowanceGridView_SRow"+cellRosterPerioddd+cellRosterPeriodmm+"_"+PayBucket)).getAttribute("value");
// UIValue = WebelementforUIvalue;
}
catch (NoSuchElementException e) {
UIValue ="00.00";
}
But, When webelement is not Found, the execution stops, I do not want the execution to be stoppedm for the exceptions ?
#Stijn
The execution runs, when the WebElements are found on UI, but it thorws 'No such Element' and stops execution, if the web element is not present on UI, in such cases, need to take the value as '00:00'
# niharika_neo, Here is the Stack Trace below
{code}
Excel PayBucket:JRM1
Excel PayBucket Value:03:40
UI PayBucket:[[ChromeDriver: chrome on XP (0a57a30b08559c4aa0fe4124c5950760)] -> id: ctl00_MainContent_AllowanceGridView_SRow2812_JRM1]
03:52
Failed
Excel PayBucket:VOTPY
Excel PayBucket Value:02:01
UI PayBucket:[[ChromeDriver: chrome on XP (0a57a30b08559c4aa0fe4124c5950760)] -> id: ctl00_MainContent_AllowanceGridView_SRow2102_VOTPY]
03:52
Failed
Excel PayBucket:VOTFA
Excel PayBucket Value:02:00
no such element
(Session info: chrome=39.0.2171.71)
(Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 25 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:03'
System info: host: 'rainmaker2011-5', ip: '192.168.8.70', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0'
Session ID: 0a57a30b08559c4aa0fe4124c5950760
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={userDataDir=C:\Users\LAKSHM~1.PAL\AppData\Local\Temp\scoped_dir14544_10752}, rotatable=false, locationContextEnabled=true, version=39.0.2171.71, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
PASSED: IntegrationTests
{code}