开发者

selenium IDE: how to testing the ? or * as part of the text, not as wildcard match?

开发者 https://www.devze.com 2023-02-22 02:07 出处:网络
May I ask how to verify a text with special character ? or * as part of the text, not as a wildcard match of the text?

May I ask how to verify a text with special character ? or * as part of the text, not as a wildcard match of the text?

I am using selenium IDE to verify a browser pop up alert. The pop up alert message contain a special character "This will change the globe setting, is it ok?". When I use the VerifyConfirmation command with target as "This will change the globe setting, is it ok?", the VerifyConfirmation command will fail and error message is "[error] Active 开发者_如何学运维value 'This will change the globe setting, is it ok?' did not match 'This will change the globe setting, is it ok?'. It seems like selenium see the last character ? as wildcard. I have also tried to use the exact:This will change the globe setting, is it ok? but it does not work too.

May I ask is there anyway to test the last character as ?, not a wildcard?

Thanks

Kam


I don't think your problem is related to the question mark. First off, the ? in glob patterns is used to match any single character, so a real question mark would match the special question mark. Secondly, I've seen the sort of error message you're seeing quite often. It is almost always related to there being more or fewer white spaces in the argument specified than in the page. For example, "abcdef ghijklmn" doesn't match "abcdef ghijklmn" but IDE's error message will show both strings with a single space.

Try a pattern of just

setting

to see if it matches. If it does, then start adding one word at a time until the test fails.

OR, just look at the source so you can copy/paste the correctly spaced string into the Target field of IDE.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号