javascript - Selenium: How to verify a word in a string inside a variable? -
i'd know how verify if there's word inside string (using variables).
for example, have variable called options has string "test,test2,test3" (without quotes) inside it. want verify if string contains word test2.
i've tried way:
- command: store // target: test,test2,test3 // value: options
- command: storeeval // target: javascript{storedvars['options'].contains("test2");} // value: result
i want selenium store true or false on variable result if finds or not word test2 on string, i'm getting error:
[error] unexpected exception: typeerror: storedvars.options.contains not function. filename -> chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, linenumber -> 2545
any ideas?
screenshoot: http://oi40.tinypic.com/2qibcxf.jpg
javascript{storedvars['options'].search("test2");} worked.
Comments
Post a Comment