How to select the Radio button or checkbox in the pop up window?

895 views
Skip to first unread message

Gurdarshan Singh

unread,
Nov 22, 2011, 7:16:38 AM11/22/11
to Selenium - Automated Software Testing
Hi All.

We are trying to check the checkbox on pop up window through
webdriver :

E.g
//User click on Some Add machine button
driver.findElement(By.cssSelector("#addmachine >
span")).click();

// Pop up window appears : we use alert() to focus on pop up
window
driver.switchTo().alert();

// Clicking the checkbox via xpath
driver.findElement(By.xpath(".//*[@id='machineAddForm']/
table/tbody/tr[2]/td[1]/input")).click();

// Then clicking on Save button on pop up window
driver.findElement(By.cssSelector("#addmachine_save >
span")).click();

But we the value store for checkbox is not correct, while executing
script the checkbox not get checked.

Please help us to resolve this issue.

Thanks
~Gurdarshan Singh

Reply all
Reply to author
Forward
0 new messages