This is a migrated thread and some comments may be shown as answers.

Navigation step failed due to logon dialog in IE

2 Answers 150 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jessica
Top achievements
Rank 1
Jessica asked on 11 Oct 2017, 11:52 PM

Hello, 

I'm currently using Test Studio Version 2016.3.928.0 to test an ASP.NET Web Application. My test goes to my published application and a prompt is immediately prompted when the URL is hit to get the user's username and password. In Chrome, Edge, and Firefox the test runs fine when I do a navigation step and then deal with the dialog in the next step. In IE (version: 11.1770.14393.0), however, the test fails at the navigation step with the following information in the log: 

Overall Result: Fail
------------------------------------------------------------
'10/11/2017 6:43:31 PM' - Executing test: 'Internet Explorer', path: 'Internet Explorer.tstest.'
'10/11/2017 6:43:31 PM' - Using .Net Runtime version: '4.0.30319.42000' for test execution. Build version is '2016.3.928.0'.
------------------------------------------------------------
------------------------------------------------------------
'10/11/2017 6:43:33 PM' - Using 'InternetExplorer' version '11.0' as default browser. 
'10/11/2017 6:43:34 PM' - LOG: Unexpected dialog encountered. Taking no action.
'10/11/2017 6:44:34 PM' - 'Fail' : 1. Navigate '/'
------------------------------------------------------------
Failure Information: 
~~~~~~~~~~~~~~~
Wait for condition has timed out
InnerException:
System.TimeoutException: Wait for condition has timed out
   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.WebAii.Core.Browser.WaitUntilReady()
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
   at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
   at ArtOfTest.WebAii.Core.Browser.InternalNavigateTo(Uri uri, Boolean useDecodedUrl)
   at ArtOfTest.WebAii.Core.Browser.NavigateTo(Uri uri, Boolean useDecodedUrl)
   at ArtOfTest.WebAii.Core.Browser.NavigateTo(String url, Boolean useDecodedUrl)
   at ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.NavigateToActionDescriptor.Execute(Browser browser)
   at ArtOfTest.WebAii.Design.Extensibility.HtmlActionDescriptor.Execute(IAutomationHost autoHost)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)
------------------------------------------------------------
'10/11/2017 6:44:34 PM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
------------------------------------------------------------
'10/11/2017 6:44:34 PM' - Overall Result: Fail
'10/11/2017 6:44:34 PM' - Duration: [1 min: 0 sec: 296 msec]
------------------------------------------------------------
'10/11/2017 6:44:57 PM' - Test completed!

 

I see that it detected the logon dialog, but it says it's timed out waiting for a condition. I'm not sure what condition it's expecting to since it did go to the proper URL. Nor am I sure how to find a workaround. In the other browsers I just set the BaseURL to my application URL and did the NavigationURL as '/' and the step didn't fail in the other browsers, but it still fails in IE.  I've recalibrated my browser and ran updates on Windows 10 and it hasn't had any impact on this error. 

Thanks, 

Jessica

CathyInCanada
Top achievements
Rank 2
commented on 24 Mar 2021, 05:52 PM

4 years later, I am having this problem and the solution does not compile. Can anyone assist? The logon prompts are on-screen, not a dialog.

[ Compiler ]
13:49:27 'ERROR' > c:\Users\CKELLY\Documents\Test Studio Projects\TestProject1\WebTest.tstest.cs(55,47) : error CS0103: The name 'Keys' does not exist in the current context
13:49:27 'ERROR' > c:\Users\CKELLY\Documents\Test Studio Projects\TestProject1\WebTest.tstest.cs(57,47) : error CS0103: The name 'Keys' does not exist in the current context
13:49:27 'ERROR' > c:\Users\CKELLY\Documents\Test Studio Projects\TestProject1\WebTest.tstest.cs(62,47) : error CS0103: The name 'Keys' does not exist in the current context
13:49:27 'ERROR' > c:\Users\CKELLY\Documents\Test Studio Projects\TestProject1\WebTest.tstest.cs(65,47) : error CS0103: The name 'Keys' does not exist in the current context
13:49:27 'ERROR' > c:\Users\CKELLY\Documents\Test Studio Projects\TestProject1\WebTest.tstest.cs(66,47) : error CS0103: The name 'Keys' does not exist in the current context
13:49:27 'INFO' > Build Failed

2 Answers, 1 is accepted

Sort by
0
Accepted
Elena
Telerik team
answered on 12 Oct 2017, 02:38 PM
Hello Jessica,

Thank you for reaching us out. 

Please note that this scenario could not be handled out of the box as the page never returns ReadyState until the dialog is handled. Of course you could use a coded step to workaround that. Please find the sample code here and try to adjust it to your scenario. 

In case you need any further assistance do not hesitate to contact us again! Thanks! 

Regards,
Elena Tsvetkova
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Jessica
Top achievements
Rank 1
commented on 24 Oct 2017, 09:54 PM

Hello, 

One more question. How would you go about using encryption of the password on the code side, since the workaround would be to do a coded step?

Thanks,

Jessica

Elena
Telerik team
commented on 25 Oct 2017, 02:16 PM

Hi Jessica,

Thanks for the feedback. 

I am glad to know the provided solution works fine for you. 

I would suggest you use a test user for the automation of the application. That way you could test the functionality and avoid accessing real data. 

In case this is not an option you could implement your custom encryption in the coded step. I have searched the web and found a possible approach which you could adjust for your scenario. As mentioned this should be custom implementation in C#. 

I hope this will be helpful for you! 

Regards,
Elena Tsvetkova
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
CathyInCanada
Top achievements
Rank 2
answered on 24 Mar 2021, 06:17 PM

For those who come behind me searching for the answer to the KEYS error message: 

 

Added an Assembly Reference to System.Windows.Forms.dll via Project > Settings.

Added the following to the Code Step:  using System.Windows.Forms;

Elena
Telerik team
commented on 25 Mar 2021, 08:57 AM

Hello Catherine,

As far as I understand you have resolved the encountered trouble with the missing dll by referencing it in the project and adding the respective using statement in the coded file - thank you for sharing this follow up. 

Do you have any further troubles with the scenario you work on?

Please, let me know if you have any additional questions on the case.

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
CathyInCanada
Top achievements
Rank 2
commented on 25 Mar 2021, 02:22 PM

Thank you Elena! It's all good right now and learning how to create some scripts. I'm loving Test Studio so far. Reserve the right to come back to ask a million more questions. :-) 
Elena
Telerik team
commented on 26 Mar 2021, 10:28 AM

Hi Cathy,

Thanks for your feedback - I am really pleased to know you are happy with Test Studio! 

And do not hesitate to contact us in case you experience difficulties - the Test Studio Support team is always there to assist in your Test Studio journey!

Regards,
Elena
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Tags
General Discussions
Asked by
Jessica
Top achievements
Rank 1
Answers by
Elena
Telerik team
CathyInCanada
Top achievements
Rank 2
Share this question
or