I am trying to run a simple login test on Firefox and Chrome browsers in parallel using the parallel="tests" attribute in my testNG.xml file. At any given time, the tests are being run on only one browser, either Firefox or Chrome randomly, but not in both. Below is the TestNG trace. Please let me know how to solve this issue.
org.openqa.selenium.WebDriverException: Tried to run command without establishing a connection Build info: version: 'unknown', revision: '1969d75', time: '2016-10-18 09:43:45 -0700' System info: host: 'Lavanyas-MacBook-Pro.local', ip: '192.168.1.12', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_102' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, marionette=true, firefoxOptions={args=[], prefs={}}, appBuildId=20170118123726, version=, platform=MAC, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, processId=25557, browserVersion=51.0, platformVersion=15.6.0, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=darwin}] Session ID: 0167b025-96f1-0143-b03d-742695fc50e0 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:127) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:93) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:274) at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:98) at automationFramework.TestngParameters.test(TestngParameters.java:47) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104) at org.testng.internal.Invoker.invokeMethod(Invoker.java:645) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:756) at org.testng.TestRunner.run(TestRunner.java:610) at org.testng.SuiteRunner.runTest(SuiteRunner.java:387) at org.testng.SuiteRunner.access$000(SuiteRunner.java:39) at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:421) at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
This is my testNG.xml file:
<!DOCTYPE suite SYSTEM "http://ift.tt/19x2mI9" >
<test name="FirefoxTest">
<parameter name="browser" value="firefox" />
<parameter name="sUsername" value="ldpb1@gmail.com" />
<parameter name="sPassword" value="testpass" />
<classes>
<class name="automationFramework.TestngParameters" />
</classes>
</test>
<test name="ChromeTest">
<parameter name="browser" value="chrome" />
<parameter name="sUsername" value="ldpb6@gmail.com" />
<parameter name="sPassword" value="testpass" />
<classes>
<class name="automationFramework.TestngParameters" />
</classes>
</test>
Aucun commentaire:
Enregistrer un commentaire