Sounds like you are instantiating 7 different driver objects.
You’ll need to show us your code.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="OPS_AUTOMATION">
<test name="OPS LOGIN PAGE" preserve-order="true">
<classes>
<class name="tests.OpsLoginPage">
<methods>
<include name="acessopsloginpage" />
<include name="testopslogin" />
<include name="testByoHomapage" />
<include name="testtwo" />
<include name="tampertest" />
</methods>
</class>
</classes>
</test>
</suite>
With Regards,To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
--
BALAJI SINGH .Y
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/pvtIUcnd5b4J.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
To post to this group, send email to selenium-users@googlegroups.com.
To unsubscribe from this group, send email to selenium-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.
I tried with it worked out this way.
Iam trying to create static webdriver reference object as shown in the below class and instnatiatin it in "@BeforeTest Method " that sloved the issue of opening many firefox instances so that all my testng tests are runing on single firefox browser instance.
Moreover i had an issue like Second test was running before to first test , even this issue got sloved by having an simple anology like " @Test(dependsOnMethods = { "testopslogin" } )" in second method , where testopslogin is the first method.
And now i could see that all tests are running on single firefox broser instance and all tests are runing in order.
Below is the code that i modified and used.
package tests;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.testng.annotations.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeTest;
import datatable.Xls_Reader;
public class OpsLoginPage {
// Global Variables
static WebDriver driver;
Xls_Reader exl;
@BeforeTest
public void testAccessOpsLoginPage()
{
driver= new FirefoxDriver();
exl=new Xls_Reader("C:\\Users\\sg0206915\\workspace\\Exceldata\\OPSDATA1.xlsx");
//Open OPS login Page on Internet Explorer
driver.get("http://ops.qa.elab.lastminute.com/ops/byo/search.asp?");
driver.manage().deleteAllCookies();
}
@Test
public void testopslogin() throws Exception
{
try
{
System.out.println("1 . Inside testopslogin method");
// Wait till the OPS login page gets loaded
driver.manage().timeouts().implicitlyWait(6,TimeUnit.SECONDS);
//Get the username and password from Excel sheet
String username1=exl.getCellData("OpsData","Username", 2);
String password1=exl.getCellData("OpsData","Password", 2);
//set the user name on UI
WebElement uname=driver.findElement(By.name("username"));
uname.sendKeys(username1);
//set the password on UI
WebElement pwd=driver.findElement(By.name("password"));
pwd.sendKeys(password1);
//wait till username and password are entered
driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);
//now click on login button
WebElement loginbutton=driver.findElement(By.name("submit"));
loginbutton.click();
}catch(Exception e)
{
System.out.println("Error/Exception message :"+e);
e.printStackTrace();
}
@Test(dependsOnMethods = { "testopslogin" } )
public void testByoHomapage()
{
try
{
System.out.println("2. hello inside testByoHomapage method");
//Wait till the BYO HomePage gets loaded
driver.manage().timeouts().implicitlyWait(5,TimeUnit.SECONDS);
String Site1=exl.getCellData("BYO","Site",2);
String LeavingCity=exl.getCellData("BYO","Leaving _From",2);
System.out.println("Site name :"+Site1);
System.out.println("LeavingCity :"+LeavingCity);
}catch(Exception e)
@Test(dependsOnMethods = { "testByoHomapage" })
public void testtwo()
{
System.out.println("3 . HELLO THIS IS third TEST METHOD");
}
@AfterClass
public void tampertest()
{
System.out.println(" 4 .hello inside tamper method");
//driver.close();
//driver.quit();
}
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="OPS_AUTOMATION" verbose="3" parallel="false">
<test name="OPS LOGIN PAGE" preserve-order="true" >
<classes>
<class name="tests.OpsLoginPage">
<methods>
<include name="testopslogin"/>
<include name="testByoHomapage"/>
<include name="testtwo"/>
</methods>
</class>
</classes>
</test>
</suite>
I tried with it worked out this way.
I am trying to create static webdriver reference object as shown in the below class and instantiation it in "@BeforeTest Method " that solved the issue of opening many firefox instances so that all my testng tests are running on single firefox browser instance.
Moreover i had an issue like Second test was running before to first test , even this issue got sloved by having an simple anology like " @Test(dependsOnMethods = { "testopslogin" } )" in second method , where testopslogin is the first method.
And now i could see that all tests are running on single firefox browser instance and all tests are running in order.