Friday, 15 August 2014

selenium ide - Sideflow.js GotoIf how do I use conditionals -



selenium ide - Sideflow.js GotoIf how do I use conditionals -

i've been working on 3 different ways solve this. know easiest way following.

form field 1 (ignore syntax, i'm setting illustration here) id= of import part in 2 form fields.

<select name="select" id="pick_animal" value=""> < option="the fast cat" id="1"> < option="the fast dog" id="2"> </select>

form field 2

<input type="text" id="some_animal" value="the fast cat dover">

i need observe id="some_animal" contains cat can perform action on right alternative in field 1. can sec part fine, can't observe "cat" in input id "some_animal" storetextpresent looks cat exist anywhere on page. ugh!! 1 way can see solve following.

storevalue | id=some_animal | value_some_animal gotoif | ${value_some_animal} contains "cat" | my_cat_label runscript | (message here) goto | end label | my_cat_label run commands here. label | end

so @ gotoif statement, need conditional want see if contains "cat", , i'm using html driver in selenium ide, avoid selenium webdriver if can help it.

<tr> <td>gotoif</td> <td> ${value_some_animal} ......</td> <td>target2</td> </tr>

how have gotoif evaulate contains "cat", javascript or other method?

<td> '${value_some_animal}' == 'cat'</td> <--- doesn't work <td> '${value_some_animal}' == '*cat*'</td> <--- doesn't work

etc.... in advance.

storevalue | id=some_animal | value_some_animal

gotoif | '${value_some_animal}'=='cat' | my_cat_label

runscript | (message here)

goto | end

label | my_cat_label

run commands here.

label | end

try this, think ok.

thank you.

selenium-ide

No comments:

Post a Comment