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

Re: Unexpected window cause the test to fail

8 REPLIES 8
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. 

Highlighted
Community Leader

Re: Unexpected window cause the test to fail

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

Re: Unexpected window cause the test to fail

@Wamboo 

Yes it is JavaScript pop up. 

Highlighted
Community Leader

Re: Unexpected window cause the test to fail

Highlighted
Community Manager

Re: Unexpected window cause the test to fail

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

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors