Reply
Member
Posts: 3
Registered: ‎05-08-2012
Accepted Solution

Regression Testing CIM Option

My organization is developing a site using .NET MVC 3, and we have a regression testing suite rigged up using SpecFlow and WatiN.

 

The test we have involving a user entering payment profile information (using the iframe popup) consistently fails when it attempts to press the 'Save' button in the iframe.  A script error is displayed as follows:

'g_CustProf.paymentProfiles' is null or not an object

Line: 284
Char: 5
URI: https://test.authorize.net/profile/scripts/profile.js 

 

 

If we pause the test run immediately before it hits the 'Save' button and manually press it, it works fine and payment profile information is sent successfully.  If we attempt to press the 'Save' button manually after allowing the regression test to attempt to press it, nothing at all happens.

 

It's also worth noting that we've determined in our tests that this is *not* an issue with WatiN attempting to click a button inside an iframe from an outside domain (XSS), WatiN is able to handle this scenario.

 

Any ideas?


Accepted Solutions
Solution
Accepted by topic author jduncan
‎08-21-2015 01:58 AM
Member
Posts: 3
Registered: ‎05-08-2012

Re: Regression Testing CIM Option

For anyone this may help out, the issue I was running into was that there are more than one button with the value "Save" in the popup, even if only one is visible.  WaTiN isn't very good about mentioning that there's more than one button that matched the criteria you queried for.

 

So the wrong button was being clicked, and the wrong clientside validation/ajax call was being run.

View solution in original post


All Replies
Highlighted
Member
Posts: 3
Registered: ‎05-08-2012

Re: Regression Testing CIM Option

Just an update here.  I've altered our test setup to run the same failing regression in Firefox, where it also fails with the same error.

 

When it goes to click the 'Save' button in the popup that javascript error gets thrown, so the text on the 'Save' button never changes and the values are never posted to the Authorize.Net test/sandbox servers.  So the issue appears to be some sort of disagreement between how WatiN communicates with the browser, and the afforementioned "https://test.authorize.net/profile/scripts/profile.js" script.

 

I will update this thread with any new information I find.

Solution
Accepted by topic author jduncan
‎08-21-2015 01:58 AM
Member
Posts: 3
Registered: ‎05-08-2012

Re: Regression Testing CIM Option

For anyone this may help out, the issue I was running into was that there are more than one button with the value "Save" in the popup, even if only one is visible.  WaTiN isn't very good about mentioning that there's more than one button that matched the criteria you queried for.

 

So the wrong button was being clicked, and the wrong clientside validation/ajax call was being run.