I am trying to verify that an alert message is fired when I push a
button.

I have tried using the setExpectedJavaScriptAlert() method but I
couldn't get it to work.

Does someone have any examples on how to test Javascript Alert messages?


 

To be able to test something I used the following code.

try {
  tester.clickButton("Forward");
  fail("Expected an alert wih message: " + message);
} catch (RuntimeException e) {
  assertTrue(0 < e.getMessage().indexOf(message));
}

 

 

Regards, Michael Danielsson

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
JWebUnit-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to