I need assistance in verifying if a string contains a specific word using variables.
Suppose I have a variable named options with the value "test,test2,test3". I want to check if this string includes the word test2.
This is what I have attempted so far:
- Command: store // Target: test,test2,test3 // Value: options
- Command: storeEval // Target: javascript{storedVars['options'].includes("test2");} // Value: result
I want Selenium to store TRUE or FALSE in the variable "result" based on whether it finds the word 'test2' in the string or not. However, I encounter the following error:
[error] Unexpected Exception: TypeError: storedVars.options.includes is not a function. fileName -> chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, lineNumber -> 2545
Any suggestions?
Screenshot: