Hi,

I'm trying to run a test deleting a record where the confirmation of the delete operation has to be confirmed by a JavaScript confirm dialog. I'm using expectDialogs for this purpose and that step (Step 1 below) is performed correctly. The next step (Step 2 below) I'm performing is to log out of the web application, which also has to be confirmed using a JavaScript confirm dialog. However, this expectDialogs step (Step 2 below) fails because it seems like WebTest is using the text property from the previous expectDialogs step (Step 1 below).

This is the relevant part of my test file:
<!-- Step 1 -->
<expectDialogs>
<confirm text="Are you sure you want to delete the record Record1?" response="true" />
</expectDialogs>
<!-- Step 2 -->
<expectDialogs>
   <confirm text="Are you sure you want to log out?" response="true"/>
</expectDialogs>

I get the following errors:

Error
Message

JavaScript error loading page http://myhost/index.php?deleteId=2: Wrapped Wrong dialog message found! [Regex=false]. Expected value "Are you sure you want to delete the record Record1?" but got "Are you sure you want to log out?", Step: ConfirmDialogStep at /testprj/tests/addNewRecord.xml:41: with (taskName="confirm") (script in http://myhost/index.php?deleteId=2 from (359, 35) to (0, 0)#361)
Location

/testprj/modules/logout.xml (line: 9)
Details
javascript error Wrapped Wrong dialog message found! [Regex=false]. Expected value "Are you sure you want to delete the record Record1?" but got "Are you sure you want to log out?", Step: ConfirmDialogStep at /testprj/tests/addNewRecord.xml:41: with (taskName="confirm") (script in http://myhost/index.php?deleteId=2 from (359, 35) to (0, 0)#361)
line    361
javascript source       function () { [native code, arity=0] }
failing line
javascript call stack Wrapped Wrong dialog message found! [Regex=false]. Expected value "Are you sure you want to delete the record Record1?" but got "Are you sure you want to log out?", Step: ConfirmDialogStep at /testprj/tests/addNewRecord.xml:41: with (taskName="confirm") (script in http://myhost/index.php?deleteId=2 from (359, 35) to (0, 0)#361) at fnLogout(script in http://myhost/index.php?deleteId=2 from (359, 35) to (0, 0):361) at (onclick event for HtmlTable[<table border="0" onclick="fnLogout();" cellpadding="0" cellspacing="0">]:1)

Is this a bug or am I implementing the tests in an incorrect way?

Kind regards,
Rune

_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to