Friday 20 June 2014

Display MadataryField in mail.in Resigration

package Webdriverprgs;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;

public class Mandataryflied {
    public WebDriver driver;
  @Test
  public void f() throws InterruptedException {
      driver.findElement(By.xpath("html/body/div[1]/div[2]/div/table/tbody/tr[2]/td[3]/form/div/center/p/input")).click();
      Thread.sleep(1000);
      String str=driver.findElement(By.xpath(".//*[@id='midcont']/div[2]/table/tbody/tr/td[1]")).getText();
      String s[]= str.split("\n");
      for (int i = 0; i < s.length; i++) {
          if (s[i].contains("*")) {
              System.out.println(s[i]);
           
          }
      }
  }
  @BeforeTest
  public void beforeTest() {
      driver=new FirefoxDriver();
      driver.get("http://mail.in.com/");
      driver.manage().window().maximize();
  }

  @AfterTest
  public void afterTest() {
  }

}

No comments:

Post a Comment