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

Not able to get the Url in Log

2 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dipti
Top achievements
Rank 1
Dipti asked on 06 Nov 2019, 12:59 PM

Hi Team, 

 

I am trying to the get the current Url of the active page and  tried  this. But in the Log View i am not able to see the URL. As after fetching the URL I need to split the URL.   

 var URL = this.ActiveBrowser.Url.ToString();
 Log.WriteLine(URL); 

 

2 Answers, 1 is accepted

Sort by
0
Dipti
Top achievements
Rank 1
answered on 06 Nov 2019, 01:02 PM

And tried this too                                                                                                                                                                                         string url1 = Manager.ActiveBrowser.Url.ToString();                                                                                                                              but the same issue appears that it does not return URL in the Log. 

 

Thanks

Dipti Mukhija

 

0
Elena
Telerik team
answered on 07 Nov 2019, 10:18 AM

Hi Dipti,

I am sorry to know you faced such inconsistent behavior and will be happy to assist you with that. 

Based on the execution log you shared, it looks like the current active browser does not have a URL and the actual output in the log is an empty string. To check if anything will be output in the log, you can add some text along with the URL, e.g. 

var URL = this.ActiveBrowser.Url.ToString();
Log.WriteLine("the current URL is: " + URL); 

If the additional text is written in the execution log, we need to focus on the browser and URL. To be sure that the approach is actually working, you can use a sample test to navigate to any public accessible page and output its URL. What the outcome will be? I tested this on my end as well and it works as expected. 

If it turns out that the sample test works, then the issue seems to be related to the specific application or the scenario itself.

Can you, please, elaborate further details on the application and the requirements? Is that page to take its URL a popup? Is there anything else specific in this one. What is the approach used in the test to accomplish your needs? 

During the test run, where is the focus? is there any action before getting the URL, that might be changing the focus? 

If these additional notes are not helping you to find what might be going wrong, please share the test script via this thread - even if I cannot access the page, going through the steps may help me find out what is going wrong. 

Thank you in advance for your cooperation. I am looking forward to hearing back from you.

Regards,
Elena
Progress Telerik

 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Dipti
Top achievements
Rank 1
Answers by
Dipti
Top achievements
Rank 1
Elena
Telerik team
Share this question
or