0

I need to click on the checkbox inside the div, but first I need to check the text near the checkbox and if a text is a true click on the checkbox.

enter image description here

2
  • 1
    please provide code instead of images if not really necessary. Further, could you maybe point out what you tried so far? Commented Jan 18, 2020 at 14:27
  • Please add html code instead image and code with error you have tried so far Commented Jan 18, 2020 at 15:19

2 Answers 2

1

You can first extract the text from the source page then check whether it is there or not then click

Sign up to request clarification or add additional context in comments.

Comments

0

If you want to select checkbox based on text so it is very simple. You can pass required text in below xpath and locate checkbox.

text = "Google Play"

//a[.="+ text +"]/..//input

This way whatever text you will pass either Google play or iTunes it will locate checkbox based on given text

Comments

Your Answer

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.