RE: How to select multiple check boxes at a time?

Hi all,

Iam trying to automate the mutiple selection of check boxes along with the drop down. Am able to print all the check box values and also the required check boxes but not able to select the required check boxes. please review the below code and help me.

RE: How to select multiple check boxes at a time?

Thank you.

/
[crayon-5412c8c282089058071876/]

Srinivas Train Asked on September 12, 2014 in Selenium WebDriver.
Add Comment
3 Answers

Everything seems fine to me, not sure what is the issue. Since it is not working try hitting different xpaths like


driver.findElement(By.xpath(".//*[@id='brand']/li["+j+"]"));

driver.findElement(By.xpath(".//*[@id='brand']/li["+j+"]/a"));

driver.findElement(By.xpath(".//*[@id='brand']/li["+j+"]/a/input"))

Or give it a try with RObot class & Action class aswell, just a work around


WebElement myElement = driver.findElement(By.xpath(".//*[@id='brand']/li["+j+"]/a/input"));

Actions oAction = new Actions(driver);

oAction.moveToElement(myElement);

robot.mousePress(InputEvent.BUTTON1_MASK);

robot.mouseRelease(InputEvent.BUTTON1_MASK);

Regards,
Lakshay Sharma

Professor Answered on September 12, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.