cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected window cause the test to fail

Highlighted
Super Contributor

Unexpected window cause the test to fail

We do have issue that occur sometime. Here is the attached screenshot.

 

- When entering the user name and password in authentication dialog , the same authentication dialog window appear again and our test fail due to Unexpected window - authentication required. 

 

Any idea how this can be fixed . If I check "Ignore Unexpected Window" will this resolve the issue 

 

-Nishchal

4 REPLIES 4
Highlighted
Community Leader

Re: Unexpected window cause the test to fail

Write a method that will routinely look for the indicated object when the first window is approved.

 

Search for this object dynamically using the object search function.

 

If you are using Aliases (and you should), you can refresh the .refreshMappingInfo() structure and look for this item again in the structure.

 

This is of course a fix, in my opinion, only allowing the automatic tests to work properly. Ultimately such bug should be fixed by the appropriate development team.

 

example:

 

var testObj = Aliases.process.obj.nestedObj;

TestObj.RefreshMappingInfo();

var findObj = testObj .FindAllChildren("Name", "objName or ID"); // or any other Find method 
Highlighted
Super Contributor

Re: Unexpected window cause the test to fail

@Wamboo 

 

Thank you for updates. 

 

Our Authentication dialog is based on Login Dialog as mentioned in the TestComplete Dialog. Here is the code screenshot attached

Highlighted
Community Leader

Re: Unexpected window cause the test to fail

You're using Sys. So there's no NameMapping in your project, right?

 

You have a variable page here, so after successful first completion, do:

 

page.RefreshMappingInfo();

https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/refres...

 

and then use the following functions with SmartBear Docs:

https://support.smartbear.com/testcomplete/docs/reference/test-objects/controls/desktop/general/sys/...

 

Highlighted
Super Contributor

Re: Unexpected window cause the test to fail

@Wamboo 

I am using Name mapping but not for this authentication as it is java script based dialog. 

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors