I am New To MAVEN in Selenium Eclipse so getting Below issue when I am running the Program -


i getting below error when run testng.xml testng suite , maven project when run of pom.xml runs doesn't launch browser , when run of testng.xml gives below error.

org.testng.testngexception:  cannot instantiate class mavenpackage.loginncpdpapplication     @ org.testng.internal.objectfactoryimpl.newinstance(objectfactoryimpl.java:40)     @ org.testng.internal.classhelper.createinstance1(classhelper.java:377)     @ org.testng.internal.classhelper.createinstance(classhelper.java:290)     @ org.testng.internal.classimpl.getdefaultinstance(classimpl.java:125)     @ org.testng.internal.classimpl.getinstances(classimpl.java:190)     @ org.testng.internal.testngclassfinder.<init>(testngclassfinder.java:130)     @ org.testng.testrunner.initmethods(testrunner.java:424)     @ org.testng.testrunner.init(testrunner.java:247)     @ org.testng.testrunner.init(testrunner.java:217)     @ org.testng.testrunner.<init>(testrunner.java:169)     @ org.testng.remote.support.remotetestng6_9_10$1.newtestrunner(remotetestng6_9_10.java:28)     @ org.testng.remote.support.remotetestng6_9_10$delegatingtestrunnerfactory.newtestrunner(remotetestng6_9_10.java:61)     @ org.testng.suiterunner$proxytestrunnerfactory.newtestrunner(suiterunner.java:594)     @ org.testng.suiterunner.init(suiterunner.java:168)     @ org.testng.suiterunner.<init>(suiterunner.java:117)     @ org.testng.testng.createsuiterunner(testng.java:1319)     @ org.testng.testng.createsuiterunners(testng.java:1306)     @ org.testng.testng.runsuiteslocally(testng.java:1160)     @ org.testng.testng.run(testng.java:1064)     @ org.testng.remote.abstractremotetestng.run(abstractremotetestng.java:126)     @ org.testng.remote.remotetestng.initandrun(remotetestng.java:152)     @ org.testng.remote.remotetestng.main(remotetestng.java:57) caused by: java.lang.reflect.invocationtargetexception     @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method)     @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:62)     @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:45)     @ java.lang.reflect.constructor.newinstance(constructor.java:423)     @ org.testng.internal.objectfactoryimpl.newinstance(objectfactoryimpl.java:29)     ... 21 more caused by: java.lang.illegalstateexception: path driver executable must set webdriver.gecko.driver system property; more information, see https://github.com/mozilla/geckodriver. latest version can downloaded https://github.com/mozilla/geckodriver/releases     @ com.google.common.base.preconditions.checkstate(preconditions.java:754)     @ org.openqa.selenium.remote.service.driverservice.findexecutable(driverservice.java:124)     @ org.openqa.selenium.firefox.geckodriverservice.access$100(geckodriverservice.java:41)     @ org.openqa.selenium.firefox.geckodriverservice$builder.finddefaultexecutable(geckodriverservice.java:115)     @ org.openqa.selenium.remote.service.driverservice$builder.build(driverservice.java:329)     @ org.openqa.selenium.firefox.firefoxdriver.toexecutor(firefoxdriver.java:207)     @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:103)     @ org.openqa.selenium.firefox.firefoxdriver.<init>(firefoxdriver.java:99)     @ mavenpackage.loginncpdpapplication.<init>(loginncpdpapplication.java:16)     ... 26 more     enter code here 

i think maven not issue here. see exception :

the path driver executable must set webdriver.gecko.driver system property; more information, see https://github.com/mozilla/geckodriver. latest version can downloaded https://github.com/mozilla/geckodriver/releases 

somewhere in code, before init driver should (java)

system.setproperty("webdriver.gecko.driver", "path/to/geckodriver.exe"); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -