package smoke;
import com.thoughtworks.selenium.*;
//import org.openqa.selenium.server.RemoteControlConfiguration;
import org.openqa.selenium.server.RemoteControlConfiguration; //import org.openqa.selenium.server.SeleniumServer;
import org.testng.annotations.*;
public class Popup extends SeleneseTestCase {
String trafficOutput;
public static Selenium selenium;
public static final String MAX_WAIT_TIME_IN_MS = "30000";
boolean Condition = true;
@BeforeSuite
@Parameters( { "selenium.host", "selenium.port", "selenium.browser","selenium.url" })
public void setUp(String host, String port, String browser, String url)
throws Exception {
RemoteControlConfiguration rc = new RemoteControlConfiguration();
rc.setSingleWindow(true);
rc.trustAllSSLCertificates();
selenium = new DefaultSelenium(host, Integer.parseInt(port), browser,url);
selenium.start();
    
selenium.windowMaximize();
}
import com.thoughtworks.selenium.*;
//import org.openqa.selenium.server.RemoteControlConfiguration;
import org.openqa.selenium.server.RemoteControlConfiguration; //import org.openqa.selenium.server.SeleniumServer;
import org.testng.annotations.*;
public class Popup extends SeleneseTestCase {
String trafficOutput;
public static Selenium selenium;
public static final String MAX_WAIT_TIME_IN_MS = "30000";
boolean Condition = true;
@BeforeSuite
@Parameters( { "selenium.host", "selenium.port", "selenium.browser","selenium.url" })
public void setUp(String host, String port, String browser, String url)
throws Exception {
RemoteControlConfiguration rc = new RemoteControlConfiguration();
rc.setSingleWindow(true);
rc.trustAllSSLCertificates();
selenium = new DefaultSelenium(host, Integer.parseInt(port), browser,url);
selenium.start();
selenium.windowMaximize();
}
This is how ur main program will look like and the XMl file where u can declare the parameters 
<suite name="test" parallel="tests" threadcount="5" >
<parameter name="selenium.host" value="localhost"></parameter>
<parameter name="selenium.port" value="4444"></parameter>
<parameter name="selenium.browser" value="*firefox"></parameter>
<parameter name="selenium.url" value="https:"></parameter>
<test name="test1" >
<classes>
<class name="smoke.Popup" />
</classes>
</test>
</suite>
 
No comments:
Post a Comment