To find out the url of the active tab, you need to use this code.

var roots = AutomationElement.RootElement.FindAll(TreeScope.Children, new PropertyCondition(AutomationElement.ClassNameProperty, "Chrome_WidgetWin_1")); foreach (AutomationElement root in roots) { var textP = root.FindFirst(TreeScope.Descendants, new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Edit)); var vpi = textP.GetCurrentPropertyValue(ValuePatternIdentifiers.ValueProperty); Console.WriteLine(vpi); } 

But its main disadvantage is that it heavily loads the CPU. And if you recognize the url every 10-30 seconds, then this method is not very suitable.

With Selenium WebDriver can not work already with running browsers.

Is there any optimized method to find out the url of the active tab, or is it even all running url? It is desirable cross-platform, but if there is a way with WinAPI, then it will also work

    1 answer 1

    If you have Enterprise version of the studio then you can use Coded UI. https://stackoverflow.com/questions/5866067/get-current-url-in-codedui