I want to run same script on three browser IE, Chrome and Firefox at a time (i.e., parallel). I am using the following code in Testng.xml file
<test name="RunTests-1">
<parameter name="browser" value="firefox" />
<parameter name="port" value="http://localhost:4444/wd/hub" />
<classes>
<class name="Com.TestSuite.class1"/>
</classes>
</test>
<test name="RunTests-2">
<parameter name="browser" value="chrome" />
<parameter name="port" value="http://localhost:4444/wd/hub" />
<classes>
<class name="Com.TestSuite.class1"/>
</classes>
</test>
<test name="RunTests-3">
<parameter name="browser" value="internet explorer" />
<parameter name="port" value="http://localhost:4444/wd/hub" />
<classes>
<class name="Com.TestSuite.class1"/>
</classes>
</test>
while running it using TestNG, it is opening 3 browsers and executing the script. But the problem is while executing the script, it is performing some operations in the script(like entering a text in text field, clicking on a button etc) twice in one browser and not at all performing in other browsers. Please let me know what may be the reason for that.
driverinstance declaration part and check weather you declared as aStaticor not.