1

I would like to use a variable to verify texts. The texts are located with something like:

css=tr:nth-child(35) > td:nth-child(2) 

css=tr:nth-child(36) > td:nth-child(2)

css=tr:nth-child(37) > td:nth-child(2)

I wanted to use something like

store          35            varCounter

verify text    css=tr:nth-child(${varCounter}) > td:nth-child(2)      AAA  
verify text    css=tr:nth-child(${varCounter}+1) > td:nth-child(2)    BBB  
verify text    css=tr:nth-child(${varCounter}+2) > td:nth-child(2)    CCC

The first one does what I want, but I can not get the following ones to work. I am using the latest version of Selenium IDE which does not accept StoreEval.

2
  • I am not sure but you could try ${varCounter+1} instead of ${varCounter}+1. Dec 11, 2018 at 16:02
  • Thanks for the suggestion. But it does not work.(An invalid or illegal selector was specified)
    – TMar
    Dec 13, 2018 at 7:22

2 Answers 2

1

Solved it :)

Command               Target                Value

store                 10                     x  
execute script        return (++${x})        x
type                  (some field)           ${x}*
0
0

You will need something like getEval storeEval , see below:

store       25          x

storeEval   ${x}+1      y

type        name=q      ${y}

type        name=${y}   ${x}    
2
  • Thanks, but in version 3.4.4 that does not work any more...
    – TMar
    Dec 17, 2018 at 7:03
  • I didn't know that it is possible to write Selenese test scripts with version 3 and above. probably 'execute script' is the only way.
    – Ramadan Jr
    Dec 17, 2018 at 9:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.