Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » General (non-technical) » Test » TestSuite(Problems with Login)
TestSuite [message #668133] Tue, 03 May 2011 22:18
Cecilia  is currently offline Cecilia Friend
Messages: 1
Registered: May 2011
Junior Member
Hi guys!

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???? Confused Confused

This is my login class

public class MyLogin extends TestCase{

Selenium selenium;
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost",4444,"*chrome","");

public void testMyLogin()throws Exception{"http://mypage/login");
selenium.type("username", "");
selenium.type("password", "myadminpass");"submit");

And this is the case I want to run next to login :

public class Top5Prices extends TestCase{
Selenium selenium;

//public void setUp() throws Exception {
//selenium = new //DefaultSelenium("localhost",4444,"*chrome","");
public void VerifySortingByPrice(){

bla bla bla.....
public void testTop5Prices () throws Exception {

///Login just for test this case, once the case run properly this part must be removed
//selenium.type("username", "");
//selenium.type("password", "myadminpass");



Integer row = 4;
Integer tebdy = 3;

int size = selenium.getXpathCount("//table[@id='data_table']/tbody/tr").intValue();
System.out.println("size = " + size);

String NameItem = selenium.getText("//table[@id='data_table']/tbody/tr[" + row + "]/td[2]");
System.out.println("name item: " + NameItem);


Thanks Very Happy
Previous Topic:test
Next Topic:Just a test
Goto Forum:

Current Time: Thu Nov 26 08:12:13 GMT 2020

Powered by FUDForum. Page generated in 0.01689 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top