Fikcam Fikcam - 2 months ago 66
Java Question

error : unable to resolve class reference org/openqa/selenium/WebDriver

I've this code

enter image description here

When I execute this code in my IDE (eclipse). My browser open a window with google.

But if I execute this code in cmd or in Jenkins, I've this error :

[[TestNGClassFinder]] Unable to read methods on class demo.DemoJenkins - unable
to resolve class reference org/openqa/selenium/WebDriver


I followed this tuto https://www.youtube.com/watch?v=1e8I3A49ERc and I did everything like him, but when I would like to open a browser with this code with Jenkins or cmd. I've a error.

I use Selenium webdriver, TestNG, Java for writing code. if anyone can help me, thanks a lot !

Answer

you have to add the selenium-api.jar to your classpath,