verifyAlert command does not work as expected

I have the following form and script in a test page:

<form>
	<button id="doublealert1" onclick="alert('First Alert'); alert('Second Alert'); return false;">Double alert button</button>
	<input type="button" id="doublealert2" onclick="alert('First Alert'); alert('Second Alert'); " value="Double alert input" />
	<input type="button" id="singlealert1" onclick='alert("Single Alert");' value="Single alert input" />
	<input type="button" id="functionalert" onclick="myFunction();" value="Function alert input" />
</form>

<script>
function myFunction() {
  alert("Function alert");
}
</script>

When I run the following test case, it fails at the verifyAlert command

open | http://localhost/TestPage.htm | |
chooseOkOnNextConfirmation | | |
click | id=singlealert1 | |
assertAlert | Single Alert | |
chooseOkOnNextConfirmation | | |
click | id=singlealert1 | |
verifyAlert | Single Alert | |

verifyAlert

And here is the Log

[info] Playing test case Test Test Suite / Alert Tests
[info] Time: Thu Feb 07 2019 12:30:54 GMT+0000 (Greenwich Mean Time) Timestamp: 1549542654697
[info] OS: Windows Version: 10
[info] Browser: Chrome Version: 71.0
[info] If the test cannot start, please refresh the active browser tab
[info] Executing: | open | http://localhost/TestPage.htm | |
[info] Executing: | chooseOkOnNextConfirmation | | |
[info] Executing: | click | id=singlealert1 | |
[info] Executing: | assertAlert | Single Alert | |
[info] Executing: | chooseOkOnNextConfirmation | | |
[info] Executing: | click | id=singlealert1 | |
[info] Executing: | verifyAlert | Single Alert | |
[error] did not match

I expected it to work the same as assertAlert, which, as you can see, passed.

2 Likes

I experienced the same.

Thank you for the report. This issue has been fixed in 5.3.17. The new version has been uploaded and should be available in a few hours.

1 Like