cancel
Showing results for 
Search instead for 
Did you mean: 

Unexpected window cause the test to fail

SOLVED
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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Leader

8 REPLIES 8
Community Leader

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

@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

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

@Wamboo 

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

Highlighted
Community Leader

is this some kind of popUp or asynchronous call?

Can you write your own Js function -> access to your browser API -> write values in fields?

Highlighted
Super Contributor

@Wamboo 

Yes it is JavaScript pop up. 

Highlighted
Community Leader

Highlighted
Community Manager

Thanks Wamboo!

 

@nisgupta what are your results? Were you able to solve this using the link Wamboo provided? Please let us know.


Sonya Mihaljova
Community and Education Specialist

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
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 and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

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

Participate!

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

Participate!
Top Kudoed Authors