After clicking on button a list of checkbox appears. I want to select a checkbox with input taken from excel sheet.
1.This the button, on click list of checkboxes appears.
2.The list of checkboxes.
DOM image:
-
have you done anything yourself?Yu Zhang– Yu Zhang2017年12月23日 21:38:54 +00:00Commented Dec 23, 2017 at 21:38
1 Answer 1
I would provide the process to solve the problem:
- First find the element with the text (to be searched) on the web page. (in your case its an
<a>
tag).
My personal suggestion is to use xpath: //a[contains(text(),'<your text from excel>')]
- Then try to find its sibling
input
tag withtype='checkbox'
(either by usingfollowing-sibling or preceding-sibling
on that<a>
tag.
//a[contains(text(),'<your text from excel>')]/following-sibling::input[@type='checkbox']
or
//a[contains(text(),'<your text from excel>')]/preceding-sibling::input[@type='checkbox']
Explore related questions
See similar questions with these tags.