1

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.

enter image description here

2.The list of checkboxes.

enter image description here

DOM image:

enter image description here

NarendraR
1,5731 gold badge17 silver badges35 bronze badges
asked Dec 23, 2017 at 10:02
1
  • have you done anything yourself? Commented Dec 23, 2017 at 21:38

1 Answer 1

2

I would provide the process to solve the problem:

  1. 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>')]

  1. Then try to find its sibling input tag with type='checkbox' (either by using following-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']

answered Dec 24, 2017 at 4:56

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.