0

I'm just a new for Xebium. I use Xebium to automated testing for website. I have a problem with commands.

If I want to check at checkbox but it cannot check from

| ensure | do | click | on | id=user_terms_accepted |

because a user will check this check box from a text.

How to check at checkbox from a partial of text?

Thank you very much ^^

marie
  • 1
  • 1

1 Answers1

0

It is a bit tricky to figure out your scenario, but if you have your text and your check box in an surrounding element like the following:

<form>
    <!-- Other form elements -->
    <span><input type="checkbox" name="user_terms" value="accepted">I accept these terms!</span>
    <!-- Other form elements -->
</form>

Then you can select the check box with the following Selenium IDE command:

<tr>
    <td>click</td>
    <td>xpath=(//input[contains(ancestor::span/text(),'I accept')])</td>
    <td></td>
</tr>

This translates to the following Xebium line

| ensure | do | click | on | xpath=(//input[contains(ancestor::span/text(),'I accept')]) |

Note, in this case I used a <span> tag, but this can of course be altered as well.

D. Josefsson
  • 1,052
  • 7
  • 21