Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
sanjeetravi
sanjeetravi
Regular Participant
Regular Participant
Posts : 27
Join date : 2012-07-10
Age : 33
Location : Delhi

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

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
sanjeetravi
Regular Participant
Regular Participant
Posts : 27
Join date : 2012-07-10
Age : 33
Location : Delhi

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

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
sanjeetravi
Regular Participant
Regular Participant
Posts : 27
Join date : 2012-07-10
Age : 33
Location : Delhi

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

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 {

}
Sponsored content

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

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