Esempio n. 1
0
  @Override
  public void start() {
    if (_openonce) {
      _cyclecount++;

      if (!isBrowserOpened) {
        super.start();
        isBrowserOpened = true;
      }
    } else {
      super.start();
    }
  }
 @Before
 public void setUp() throws Exception {
   selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.xyz.cn/");
   selenium.start();
   selenium.windowMaximize();
   selenium.setSpeed("200");
 }
Esempio n. 3
0
  /** @param args */
  public static void main(String[] args) {

    DefaultSelenium selenium =
        new DefaultSelenium("localhost", 4444, "*firefox", "http://www.hdfcbank.com/");
    selenium.start();
    selenium.open("/");
    selenium.windowMaximize();
    selenium.windowFocus();

    System.out.println("----------Generating window names from first window-----------");
    String winnames[] = selenium.getAllWindowNames();

    for (int i = 0; i < winnames.length; i++) {

      System.out.println(winnames[i]);
    }

    selenium.click("//*[@id='loginsubmit']");

    System.out.println("----------Generating window names from second window-----------");

    winnames = selenium.getAllWindowNames();

    for (int i = 0; i < winnames.length; i++) {

      System.out.println(winnames[i]);
    }

    selenium.selectWindow(winnames[1]);
    selenium.waitForPopUp(winnames[1], "50000");

    selenium.click("//*[@id='wrapper']/div[2]/div[2]/ul/li[1]/a");

    System.out.println("----------Generating window names from second window-----------");

    winnames = selenium.getAllWindowNames();

    for (int i = 0; i < winnames.length; i++) {

      System.out.println(winnames[i]);
    }

    selenium.selectWindow(winnames[2]);
    selenium.waitForPopUp(winnames[2], "50000");

    selenium.type(
        "//html/body/table/tbody/tr[2]/td/table/tbody/tr/td[2]/table/tbody/tr[2]/td/form/table[2]/tbody/tr[5]/td[2]/input",
        "Raman");

    selenium.close();
    selenium.selectWindow(winnames[1]);
    selenium.close();
  }
  @BeforeClass
  public static void setUp() throws Exception {
    System.out.println("*** Starting selenium ... ***");
    RemoteControlConfiguration seleniumConfig = new RemoteControlConfiguration();
    seleniumConfig.setPort(4444);
    seleniumServer = new SeleniumServer(seleniumConfig);
    seleniumServer.start();

    String host = System.getProperty("myParam", "localhost");
    selenium = createSeleniumClient("http://" + host + ":" + "8080/client/");
    selenium.start();
    System.out.println("*** Started selenium ***");
  }
Esempio n. 5
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    String serverHost = "localhost";
    int serverPort = 4444;
    String browserStartCommand = "*chrome";
    String browserURL = "http://localhost:3000/";

    defaultSelenium = new DefaultSelenium(serverHost, serverPort, browserStartCommand, browserURL);
    defaultSelenium.start();
    defaultSelenium.open("");
    defaultSelenium.windowMaximize();
  }
Esempio n. 6
0
 @BeforeClass
 public static void setUpBeforeClass() throws Exception {
   selenese = new SeleneseTestCase();
   sClient =
       new DefaultSelenium(
           ZenossConstants.SeleniumHubHostname,
           4444,
           ZenossConstants.browser,
           ZenossConstants.testedMachine) {
         public void open(String url) {
           commandProcessor.doCommand("open", new String[] {url, "true"});
         }
       };
   sClient.start();
   sClient.deleteAllVisibleCookies();
 }
 @BeforeClass
 public void setUp() {
   selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.clickondetroit.com/");
   selenium.start();
 }