Ask a Question

Unexpected window cause the test to fail

SOLVED
nisgupta
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 

 

-Nishchal

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

 

example:

 

var testObj = Aliases.process.obj.nestedObj;

TestObj.RefreshMappingInfo();

var findObj = testObj .FindAllChildren("Name", "objName or ID"); // or any other Find method 
nisgupta
Valued 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

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/...

 

nisgupta
Valued Contributor

@Wamboo 

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?

nisgupta
Valued Contributor

@Wamboo 

Yes it is JavaScript pop up. 

Hi,

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

https://community.smartbear.com/t5/TestComplete-Functional-Web/Can-t-catch-change-at-CSS-JS-element/...

sonya_m
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

cancel
Showing results for 
Search instead for 
Did you mean: