2

"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:
6
  • Is it permission related problem?? Commented Jun 23, 2015 at 11:05
  • yes I think the file you are accessing doesn't have execution permission. add execution permission to the file. From terminal chmod rwx path/chromedriver Commented Jun 23, 2015 at 11:31
  • @vicky Added executable permission as PreBuild Action : chmod a+x /var/lib/jenkins/jobs/Mentis\ kitchen\ test/workspace/lib/chromedriver Commented Jun 24, 2015 at 12:16
  • ChromeDriver Started But Still "org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally" error is coming Commented Jun 24, 2015 at 12:28
  • Is it compatible issue??, But I am using latest version of chromedriver 2.16, Chrome v33, selenium 2.46, open-jdk 7. Please suggest Commented Jun 24, 2015 at 12:44

2 Answers 2

9

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

Sign up to request clarification or add additional context in comments.

2 Comments

I have had this error in the past and this is exactly what it was.
Image
This 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
0

Given below permission to chromedriver and it works.

chmod 777 chromedriver

As previous answer there is no relevance to the .exe part in stack trace

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.