Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsTestSuite
https://www.eclipse.org/forums/index.php/mv/msg/208557/668133/#msg_668133
I'm new in JUnit Tests. I'm combining Selenium RC and Eclipse to create test cases, and I'm facing a problem. I have a serie of cases that I want to run in a Test suite (all them are working properly separately). The issue here is as follows:
First I need to login (so I create a test case to let me login), once I'm logged I need to use the same window (logged) to continue testing more cases, but if I try to use the same window once the next test case starts to run it show me an error so I need to repeat the procedure of login for each case and I don't want to do that. I only want to login once and then continue working on the same page.
Could somebady help my please????
This is my login class
public class MyLogin extends TestCase{
Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost",4444,"*chrome","http://mypage.com");
selenium.start();
}
And this is the case I want to run next to login :
public class Top5Prices extends TestCase{
Selenium selenium;
//@Before
//public void setUp() throws Exception {
//selenium = new //DefaultSelenium("localhost",4444,"*chrome","http://mypage.com/onesection/blabla");
//selenium.start();
}
public void VerifySortingByPrice(){
bla bla bla.....
}
@Test
public void testTop5Prices () throws Exception {
///Login just for test this case, once the case run properly this part must be removed
//selenium.open("http://mypage.com/login");
//selenium.type("username", "admin@mypage.com");
//selenium.type("password", "myadminpass");
//selenium.click("submit");
//Thread.sleep(15000);
////////////////////////////////