Ask a Question

Unexpected window cause the test to fail

Valued 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 



Community Hero

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.




var testObj = Aliases.process.obj.nestedObj;


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



Thank you for updates. 


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

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:




and then use the following functions with SmartBear Docs:


Valued Contributor


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

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?

Valued Contributor


Yes it is JavaScript pop up. 


try to test this solution (link below). I think it's similar to your problem.

SmartBear Alumni (Retired)

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

Showing results for 
Search instead for 
Did you mean: