public class ClickCnChildMenu{
public static void main(String[] args) {
WebDriver driver=new FirefoxDriver();
driver.get("http://new.mypomanager.com/Account/Login");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.findElement(By.id("UserName")).sendKeys("retaileradmin");
driver.findElement(By.id("Password")).sendKeys("password");
driver.findElement(By.cssSelector("input[type='submit']")).click();
WebElement parentmenu=driver.findElement(By.linkText("RETAILER"));
Actions act=new Actions(driver);
act.moveToElement(parentmenu).perform();
WebElement createPO = driver.findElement(By.xpath("//a[contains(text(),'Create PO')]"));
act.moveToElement(createPO).click().perform();
}
}
public static void main(String[] args) {
WebDriver driver=new FirefoxDriver();
driver.get("http://new.mypomanager.com/Account/Login");
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.findElement(By.id("UserName")).sendKeys("retaileradmin");
driver.findElement(By.id("Password")).sendKeys("password");
driver.findElement(By.cssSelector("input[type='submit']")).click();
WebElement parentmenu=driver.findElement(By.linkText("RETAILER"));
Actions act=new Actions(driver);
act.moveToElement(parentmenu).perform();
WebElement createPO = driver.findElement(By.xpath("//a[contains(text(),'Create PO')]"));
act.moveToElement(createPO).click().perform();
}
}
sanjay i have tried with same code but cursor will go to Create Po but click event is not triggering on Create PO..
ReplyDeleteIts clicking on Create Po right ?
ReplyDeleteIf you want to move the pointer as well then use Robot class.
The above account has been removed so its not working it seems site is not available anymore.
while opening the url getting- HTTP Error 404.0 - Not Found
ReplyDelete