" java.lang.IllegalStateException: The driver is not executable" error is coming when TestNG test cases run on Jenkins install on ubuntu 14.1
16,004
Looks like you are trying to run chromedriver.exe
on Linux. You have to download binary file for Linux. .exe
from stack trace doesn't look like correct one.
Then you have to add executable flag
to it chmod +x chromedriver
Related videos on Youtube
Author by
Shweta Tetambe
Updated on May 25, 2022Comments
-
Shweta Tetambe about 2 years
"java.lang.IllegalStateException: The driver is not executable" error is coming when TestNG test cases run on Jenkins install on ubuntu 14.1. As if Chromedriver is not starting on jenkin installed on ubuntu, Same configuration tried on jenkin install on Window os, works fine.Please provide me any solution if any.
Console Ouput :
run: [testng] org.testng.TestNGException: [testng] Cannot instantiate class TestCase.NewsArticles_Section_TC [testng] at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:38) [testng] at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:387) [testng] at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:299) [testng] at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:110) [testng] at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:186) [testng] at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:120) [testng] at org.testng.TestRunner.initMethods(TestRunner.java:409) [testng] at org.testng.TestRunner.init(TestRunner.java:235) [testng] at org.testng.TestRunner.init(TestRunner.java:205) [testng] at org.testng.TestRunner.<init>(TestRunner.java:153) [testng] at org.testng.SuiteRunner$DefaultTestRunnerFactory.newTestRunner(SuiteRunner.java:522) [testng] at org.testng.SuiteRunner.init(SuiteRunner.java:157) [testng] at org.testng.SuiteRunner.<init>(SuiteRunner.java:111) [testng] at org.testng.TestNG.createSuiteRunner(TestNG.java:1299) [testng] at org.testng.TestNG.createSuiteRunners(TestNG.java:1286) [testng] at org.testng.TestNG.createSuiteRunners(TestNG.java:1289) [testng] at org.testng.TestNG.runSuitesLocally(TestNG.java:1140) [testng] at org.testng.TestNG.run(TestNG.java:1057) [testng] at org.testng.TestNG.privateMain(TestNG.java:1364) [testng] at org.testng.TestNG.main(TestNG.java:1333) [testng] Caused by: java.lang.reflect.InvocationTargetException [testng] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [testng] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [testng] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [testng] at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [testng] at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29) [testng] ... 19 more [testng] Caused by: java.lang.ExceptionInInitializerError [testng] at pagefactory.NewsArticle_Section.NewsArticle_Section_Add.<init>(NewsArticle_Section_Add.java:18) [testng] at TestCase.NewsArticles_Section_TC.<init>(NewsArticles_Section_TC.java:14) [testng] ... 24 more [testng] Caused by: java.lang.IllegalStateException: The driver is not executable: /var/lib/jenkins/jobs/Mentis kitchen test/workspace/lib/chromedriver.exe [testng] at com.google.common.base.Preconditions.checkState(Preconditions.java:197) [testng] at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:126) [testng] at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:117) [testng] at org.openqa.selenium.chrome.ChromeDriverService.access$0(ChromeDriverService.java:1) [testng] at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:118) [testng] at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:291) [testng] at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:82) [testng] at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:117) [testng] at reusablescript.driver.<clinit>(driver.java:12) [testng] ... 26 more [testng] The tests failed. makexsltreports:
-
Shweta Tetambe about 9 yearsIs it permission related problem??
-
Vicky about 9 yearsyes I think the file you are accessing doesn't have execution permission. add execution permission to the file. From terminal chmod rwx path/chromedriver
-
Shweta Tetambe about 9 years@vicky Added executable permission as PreBuild Action : chmod a+x /var/lib/jenkins/jobs/Mentis\ kitchen\ test/workspace/lib/chromedriver
-
Shweta Tetambe about 9 yearsChromeDriver Started But Still "org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally" error is coming
-
Shweta Tetambe about 9 yearsIs it compatible issue??, But I am using latest version of chromedriver 2.16, Chrome v33, selenium 2.46, open-jdk 7. Please suggest
-
Vicky about 9 years@shwetha Could you try launching chromedriver with --verbose --log-path=chromedriver.log and post your log file?
-
-
aholt about 9 yearsI have had this error in the past and this is exactly what it was.
-
Nikolay Advolodkin about 4 yearsThis error can also happen on Mac. All I did was go here and download the correct chromedriver for Mac sites.google.com/a/chromium.org/chromedriver/downloads