L'exécution de plusieurs programmes dans le sélénium WebDriver ne fonctionne pas. J'ai écrit un fichier XML testNG et 2 classes Java. J'ai essayé d'exécuter ces deux classes Java à partir du fichier XML. Mais ça ne marche pas.L'exécution de plusieurs programmes dans le pilote web de sélénium ne fonctionne pas
Code XML:
<suite name="Suite">
<test name="SIT">
<classes>
<class name="testng1.NewTest"/>
<class name="testng1.NewTest2"/>
</classes>
</test>
</suite>
Maintenant classe "NewTest.java":
package testng1;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;
public class NewTest {
public static WebDriver driver;
@BeforeTest
public void launch()
{
System.setProperty("WebDriver.ie.driver", "C:\\Users\\rprem\\Downloads\\IEDriverServer_x64_3.4.0\\IEDriverServer.exe");
driver = new InternetExplorerDriver();
System.out.println("BeforeTest Method");
}
@Test
public void gmail()
{
driver.get("https://gmail.com");
System.out.println("Gmail was launched");
}
@AfterTest
public void quit()
{
driver.quit();
System.out.println("AfterTest Method");
}
}
Now "NewTest2.java":
Lorsque j'ai couru le fichier XML à l'aide testng, je suis ci-dessous message d'erreur:
Message d'erreur:
CONFIGURATION FAILED: @BeforeTest lancement java.lang.IllegalStateException: Le chemin de l'exécutable du pilote doit être réglé par la propriété système webdriver.ie.driver; pour plus d'informations, voir https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. La dernière version peut être téléchargée à partir http://selenium-release.storage.googleapis.com/index.html à com.google.common.base.Preconditions.checkState (Preconditions.java:738) à org.openqa.selenium.remote.service.DriverService.findExecutable (DriverService.java: 124) à org.openqa.selenium.ie.InternetExplorerDriverService.access 000 $ (InternetExplorerDriverService.java:32) à org.openqa.selenium.ie.InternetExplorerDriverService Builder.findDefaultExecutable $ (InternetExplorerDriverService.java:167) à org.openqa .selenium.remote.service.DriverService $ Builder.build (DriverService.java:330) à org.openqa.selenium.ie.InternetExplorerDriver.setupService (InternetExplorerDriver.java:288) à org.openqa.selenium.ie.InternetExplorerDriv er. (InternetExplorerDriver.java:210) à org.openqa.selenium.ie.InternetExplorerDriver. (InternetExplorerDriver.java:154) à testng1.NewTest.launch (NewTest.java:13) à sun.reflect.NativeMethodAccessorImpl. invoke0 (méthode native) à sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) à sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) à java.lang.reflect.Method.invoke (Méthode .java: 498) à org.testng.internal.MethodInvocationHelper.invokeMethod (MethodInvocationHelper.java:108) à org.testng.internal.Invoker.invokeConfigurationMethod (Invoker.java:523) à org.testng.internal.Invoker .invokeConfigurations (Invoker.java:224) à org.testng.internal.Invoker.invokeConfigurations (Invoker.java:146) à org.testng.TestRunner.beforeRun (TestRunner.java:626) à org.testng.TestRunner.run (TestRunner.java:594) à org.testng.SuiteRunner.runTest (SuiteRunner.java:380) à org.testng.SuiteRunner.runSequentially (SuiteRunner.java:375) à org.testng.SuiteRunner.privateRun (SuiteRunner.java:340) à org.testng.SuiteRunner.run (SuiteRunner.java:289) à org.testng.SuiteRunnerWorker.runSuite (SuiteRunnerWorker.java:52) à org.testng.SuiteRunnerWorker.run (SuiteRunnerWorker.java:86) à org. testng.TestNG.runSuitesSequentially (TestNG.java:1301) at org.testng.TestNG.runSuitesLocall y (TestNG.java:1226) à org.testng.TestNG.runSuites (TestNG.java: 1144) à org.testng.TestNG.run (TestNG.java:1115) à org.testng.remote.AbstractRemoteTestNG.run (AbstractRemoteTestNG.java:132) à org.testng.remote.RemoteTestNG.initAndRun (RemoteTestNG.java:230) à org.testng.remote.RemoteTestNG.main (RemoteTestNG.java:76)
SKIPPED CONFIGURATION: @AfterTest quit SKIPPED: gmail java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more
informations, consultez https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. La dernière version peut être téléchargée à partir http://selenium-release.storage.googleapis.com/index.html à com.google.common.base.Preconditions.checkState (Preconditions.java:738) à org.openqa.selenium.remote.service.DriverService.findExecutable (DriverService.java: 124) à org.openqa.selenium.ie.InternetExplorerDriverService.access 000 $ (InternetExplorerDriverService.java:32) à org.openqa.selenium.ie.InternetExplorerDriverService Builder.findDefaultExecutable $ (InternetExplorerDriverService.java:167) à org.openqa .selenium.remote.service.DriverService $ Builder.build (DriverService.java:330) à org.openqa.selenium.ie.InternetExplorerDriver.setupService (InternetExplorerDriver.java:288) à org.openqa.selenium.ie.InternetExplorerDriv er. (InternetExplorerDriver.java:210) à org.openqa.selenium.ie.InternetExplorerDriver. (InternetExplorerDriver.java:154) à testng1.NewTest.launch (NewTest.java:13) à sun.reflect.NativeMethodAccessorImpl. invoke0 (méthode native) à sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) à sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) à java.lang.reflect.Method.invoke (Méthode .java: 498) à org.testng.internal.MethodInvocationHelper.invokeMethod (MethodInvocationHelper.java:108) à org.testng.internal.Invoker.invokeConfigurationMethod (Invoker.java:523) à org.testng.internal.Invoker .invokeConfigurations (Invoker.java:224) à org.testng.internal.Invoker.invokeConfigurations (Invoker.java:146) à org.testng.TestRunner.beforeRun (TestRunner.java:626) à org.testng.TestRunner.run (TestRunner.java:594) à org.testng.SuiteRunner.runTest (SuiteRunner.java:380) à org.testng.SuiteRunner.runSequentially (SuiteRunner.java:375) à org.testng.SuiteRunner.privateRun (SuiteRunner.java:340) à org.testng.SuiteRunner.run (SuiteRunner.java:289) à org.testng.SuiteRunnerWorker.runSuite (SuiteRunnerWorker.java:52) à org.testng.SuiteRunnerWorker.run (SuiteRunnerWorker.java:86) à org. testng.TestNG.runSuitesSequentially (TestNG.java:1301) at org.testng.TestNG.runSuitesLocall y (TestNG.java:1226) à org.testng.TestNG.runSuites (TestNG.java:1144) à org.testng.TestNG.run (TestNG.java:1115) à org.testng.remote.AbstractRemoteTestNG. run (AbstractRemoteTestNG.java:132) à org.testng.remote.RemoteTestNG.initAndRun (RemoteTestNG.java:230) à org.testng.remote.RemoteTestNG.main (RemoteTestNG.java:76)
SKIPPED: gmail java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more
informations, voir https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. La dernière version peut être téléchargée à partir http://selenium-release.storage.googleapis.com/index.html à com.google.common.base.Preconditions.checkState (Preconditions.java:738) à org.openqa.selenium.remote.service.DriverService.findExecutable (DriverService.java: 124) à org.openqa.selenium.ie.InternetExplorerDriverService.access $ 000 (InternetExplorerDriverService.java: 32) à org.openqa.selenium.ie.InternetExplorerDriverService $ Builder.findDefaultExecutable (InternetExplorerDriverService.java:167) à org.openqa.selenium.remote.service.DriverService $ Builder.build (DriverService.java:330) à org.openqa.selenium.ie.InternetExplorerDriver.setupService (InternetExplorerDriver.java:288) à org.openqa.selenium.ie.InternetExplorerDriver. (InternetExplorerDriver.java:210) à org.openqa.selenium.ie.InternetExplorerDriver . (InternetExplorerDriver.java:154) à testng1.NewTest.launch (NewTest.java:13) à sun.reflect.NativeMethodAccessorImpl.invoke0 (Méthode natif) à sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) chez sun.reflect.Delega tingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) à java.lang.reflect.Method.invoke (Method.java:498) à org.testng.internal.MethodInvocationHelper.invokeMethod (MethodInvocationHelper.java:108) à org. testng.internal.Invoker.invokeConfigurationMethod (Invoker.java:523) à org.testng.internal.Invoker.invokeConfigurations (Invoker.java:224) à org.testng.internal.Invoker.invokeConfigurations (Invoker.java:146) à org.testng.TestRunner.beforeRun (TestRunner.java:626) à org.testng.TestRunner.run (TestRunner.java:594) à org.testng.SuiteRunner.runTest (SuiteRunner.java:380) à org.testng.SuiteRunner.runSequentially (SuiteRunner.java:375) at org. testng.SuiteRunner.privateRun (SuiteRunner.java:340) à org.testng.SuiteRunner.run (SuiteRunner.java:289) à org.testng.SuiteRunnerWorker.runSuite (SuiteRunnerWorker.java:52) à org.testng. SuiteRunnerWorker.run (SuiteRunnerWorker.java:86) à org.testng.TestNG.runSuitesSequentially (TestNG.java:1301) à org.testng.TestNG.runSuitesLocally (TestNG.java:1226) à org.testng.TestNG. runSuites (TestNG.java:1144) à org.testng.TestNG.run (TestNG.java:1115) à org.testng.remote.AbstractRemoteTestNG.run (AbstractRemoteTestNG.java:132) à org.testng.remote. RemoteTestNG.initAndRun (RemoteTestNG.java:230) à org.testng.remote.RemoteTestNG.main (RemoteTestNG.java:76)
SKIPPED: yahoo java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more
informations, consultez https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. La dernière version peut être téléchargée à partir http://selenium-release.storage.googleapis.com/index.html à com.google.common.base.Preconditions.checkState (Preconditions.java:738) à org.openqa.selenium.remote.service.DriverService.findExecutable (DriverService.java: 124) à org.openqa.selenium.ie.InternetExplorerDriverService.access 000 $ (InternetExplorerDriverService.java:32) à org.openqa.selenium.ie.InternetExplorerDriverService Builder.findDefaultExecutable $ (InternetExplorerDriverService.java:167) à org.openqa .selenium.remote.service.DriverService $ Builder.build (DriverService.java:330) à org.openqa.selenium.ie.InternetExplorerDriver.setupService (InternetExplorerDriver.java:288) à org.openqa.selenium.ie.InternetExplorerDriv er. (InternetExplorerDriver.java:210) à org.openqa.selenium.ie.InternetExplorerDriver. (InternetExplorerDriver.java:154) à testng1.NewTest.launch (NewTest.java:13) à sun.reflect.NativeMethodAccessorImpl. invoke0 (méthode native) à sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) à sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) à java.lang.reflect.Method.invoke (Méthode .java: 498) à org.testng.internal.MethodInvocationHelper.invokeMethod (MethodInvocationHelper.java:108) à org.testng.internal.Invoker.invokeConfigurationMethod (Invoker.java:523) à org.testng.internal.Invoker.invokeConfigurations (Invoker.java:224) Org. testng.internal.Invoker.invokeConfigurations (Invoker.java:146) à org.testng.TestRunner.beforeRun (TestRunner.java:626) à org.testng.TestRunner.run (TestRunner.java:594) org. testng.SuiteRunner.runTest (SuiteRunner.java:380) à org.testng.SuiteRunner.runSequentially (SuiteRunner.java:375) à org.testng.SuiteRunner.privateRun (SuiteRunner.java:340) à org.testng. SuiteRunner.run (SuiteRunner.java:289) à org.testng.SuiteRunnerWorker.runSuit e (SuiteRunnerWorker.java:52) à org.testng.SuiteRunnerWorker.run (SuiteRunnerWorker.java:86) à org.testng.TestNG.runSuitesSequentially (TestNG.java:1301) à org.testng.TestNG.runSuitesLocally (TestNG.java:1226) à org.testng.TestNG.runSuites (TestNG.java:1144) à org.testng.TestNG.run (TestNG.java:1115) à org.testng.remote.AbstractRemoteTestNG.run (AbstractRemoteTestNG.java:132) à org.testng.remote.RemoteTestNG.initAndRun (RemoteTestNG.java:230) à org.testng.remote.RemoteTestNG.main (RemoteTestNG.java:76)
===============================================
testng1
Tests run: 3, Failures: 0, Skips: 3
Configuration Failures: 1, Skips: 1
===============================================
===============================================
practice by packages
Total tests run: 3, Failures: 0, Skips: 3
Configuration Failures: 1, Skips: 1
===============================================
Check this out, https://stackoverflow.com/questions/34946478/how-to-set- path-to-exécutable-ie-11 pilotes –
grâce Sudha. Il fonctionne très bien maintenant, mais la méthode « gmail » est CHAISE deux fois. Je ne comprenais pas pourquoi? –