-2

There are 7 unselected check-boxes available in application. How to select first and last checkboxes and how to select all checkboxes from reverse order using python selenium webdriver?

1

2 Answers 2

1

I can give you the logic in java, you can try and convert it into python.

//for clicking 1st checkbox
driver.findElement(By.xpath("XPATH_OF_FIRST_CHECKBOX")).click(); 
//for selecting 2nd checkbox
driver.findElement(By.xpath("XPATH_OF_LAST_CHECKBOX")).click();  

You can also use other attributes like ID, class if they are available. You can use similar logic for selecting all the other checkboxes with whatever order you want to click them.

0

You can find multiple elements with driver.findElements (or whatever it is in python). Once you have the list with the checkbox elements in it, it's rather trivial to check (select) them anyway you want. Just make sure that the elements are in order.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.