M
M
Maria Ivannikova2020-04-15 13:17:33
Python
Maria Ivannikova, 2020-04-15 13:17:33

How to click on a checkbox/radio button using Selenium?

Hello. I’m just getting into automated testing, I came across such an example. I can't click on the agreement buttons on this site https://ru.experrto.io/register/. Tried through xpath or just through tags, id and selectors, but somehow unsuccessfully. Obviously, somehow with the way I mow. I really hope for your help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-04-17
@SoreMix

When you click on the label, the agreement opens, and the checkbox is intercepted. You can do it a little differently.

driver.execute_script('document.getElementsByName("agreement")[0].click()')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question