Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

How to run multiple @ test simultenously in selenium rc + junit

View previous topic View next topic Go down

How to run multiple @ test simultenously in selenium rc + junit

Post by sanjeetravi on Tue Aug 07, 2012 5:42 pm

here is my code...



package com.segurosbolivar.simon.testSuits;



import com.segurosbolivar.simon.util.SimConstantos;
import com.thoughtworks.selenium.*;
import org.junit.After;

import org.junit.Test;
import org.junit.experimental.theories.ParametersSuppliedBy;
import org.junit.runner.RunWith;

public class SimLoginTestSuit extends SeleneseTestCase {
public SimLoginTestSuit(String testCase) {
super(testCase);
}

/*@Before
public void setUp() throws Exception {

}*/

@Test
public void testSimLoginTestSuit() throws Exception {
selenium = new DefaultSelenium(SimConstantos.HOST_NAME, SimConstantos.BROWSER_PORT, SimConstantos.BROWSER_CHROME, SimConstantos.APP_BASE_URL);
selenium.start();

selenium.open("/SimonWeb/login.html");
selenium.captureEntirePageScreenshot("D:\\fullscreenshot","background=#CCFFDD" );
selenium.windowMaximize();
selenium.click("id=submit");
selenium.waitForPageToLoad(SimConstantos.PAGE_LOAD_WAIT_TIME_MILI_SECONDS_90000);


}
@Test
public void testSimon_Product() throws Exception {
System.out.println("mai aaya");
System.out.println("mai aaya"+selenium.toString());
selenium.open("/SimonWeb/home.jsf");
System.out.println("mai gaya");

selenium.click("id=j_idt76:j_idt82");
selenium.windowMaximize();

selenium.click("//div[@id='dynamicMenuform:Product']/span[2]");
selenium.waitForPageToLoad(SimConstantos.PAGE_LOAD_WAIT_TIME_MILI_SECONDS_90000);
System.out.println("mai aaya");
System.out.println("mai aaya"+selenium.toString());

verifyTrue(selenium.isTextPresent("Search Products"));
Thread.sleep(5000);

System.out.println("i am in test 2");
selenium.select("id=searchForm:sectionList", "label=805-PLANES TRADICIONALES");
Thread.sleep(5000);
selenium.select("id=searchForm:productList", "label=455-fyuty");
selenium.click("id=searchForm:searcButton");
}
@Test
public void testSimon_Search_Product() throws Exception {
System.out.println("i am in test 3");

}
@After
public void tearDown() throws Exception {
http://selenium.stop();
}
}





I want to run this one by one

i have used following two ways to do so but i am failed to run all the test together.
but failed it is entering into second @test but is throwing error of id not found.if i place all the code in one test it is running smoothly pls help

sanjeetravi
Regular Participant
Regular Participant

Posts : 27
Join date : 2012-07-10
Age : 26
Location : Delhi

Back to top Go down

Re: How to run multiple @ test simultenously in selenium rc + junit

Post by sanjeetravi on Tue Aug 07, 2012 5:43 pm

following are the two java classes which are used to run it but they are still showing the same result

1.package com.segurosbolivar.simon.testSuits;


import junit.framework.Test;
import junit.framework.TestResult;
import junit.framework.TestSuite;

public class SimTestSuitMain {

public static Test suite() {
TestSuite suite = new TestSuite(SimLoginTestSuit.class);
//TestResult result= suite.run(suite);
http://suite.addTestSuite(SimLoginTestSuit.class);
http://suite.addTest(new TestSuite(SimLoginTestSuit.class));

http://suite.addTest(com.segurosbolivar.simon.testSuits.SimLoginTestSuit.SimTestSuitMain.suite());

http://suite.addTest(new SimLoginTestSuit("testSimLoginTestSuit"));
http://suite.addTest(new SimLoginTestSuit("testSimon_Product"));
http://suite.addTest(new SimLoginTestSuit("testSimon_Search_Product"));

return suite;
}

public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
}
}

sanjeetravi
Regular Participant
Regular Participant

Posts : 27
Join date : 2012-07-10
Age : 26
Location : Delhi

Back to top Go down

Re: How to run multiple @ test simultenously in selenium rc + junit

Post by sanjeetravi on Tue Aug 07, 2012 5:44 pm

2.
package com.segurosbolivar.simon.testSuits;

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;

@RunWith(Suite.class)

@SuiteClasses({ SimLoginTestSuit.class})
public class AllTests {

}

sanjeetravi
Regular Participant
Regular Participant

Posts : 27
Join date : 2012-07-10
Age : 26
Location : Delhi

Back to top Go down

Re: How to run multiple @ test simultenously in selenium rc + junit

Post by Sponsored content Today at 6:31 pm


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum