Reputation: 21
I am new in Selenium IDE and need to assertText a value that has line break. Example:
Actual Message to assertText:
Hello
World
store | Hello <br/> World | txtValue
assertText | id=label | ${txtValue}
Please help.
Upvotes: 2
Views: 4430
Reputation: 1
Following pattern matching worked for me on Selenium IDE 2.5.0
regexp:Hello\s+World
Upvotes: -1
Reputation: 588
Pass your id=label
into a variable, remove the line breaks, then run an assertion against the variable.
Store expected text:
store | Hello World | txtValue
Store page text:
storeText | xpath=(//*[@id=label]) | labelValue
Remove line breaks from page text:
echo | javascript{storedVars.labelValue = storedVars.labelValue.replace(/(\r\n|\n|\r)/gm,"")} |
Assert your expected text = your page text:
assertExpression | javascript{storedVars.txtValue==storedVars.labelValue} | true
Upvotes: 2