2

I have used following code to get the current active tab url from Google Chrome, but its getting too much time.

AutomationElement edit = element.FindFirst(
  TreeScope.Descendants,
  new AndCondition(
    new PropertyCondition(
      AutomationElement.NameProperty,
      "Address and search bar",
      PropertyConditionFlags.IgnoreCase
    ),
    new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Edit)
  )
);
sankar
  • 21
  • 2
  • What technology/assembly/library are you using to automate Chrome ? This one https://www.selenium.dev/ ? Related: [Retrieve chrome URL using automation Element in C# application](https://social.msdn.microsoft.com/Forums/en-US/f9cb8d8a-ab6e-4551-8590-bda2c38a2994/retrieve-chrome-url-using-automation-element-in-c-application?forum=csharpgeneral) • [How to activate a Google Chrome tab item using UI Automation](https://stackoverflow.com/questions/39164128/) • [Control Chrome programmatically](https://stackoverflow.com/questions/42120468/) –  Aug 21 '21 at 06:47
  • I'm using .Net Framework, Assembly UIAutomationClient, Version=4.0.0.0 – sankar Aug 24 '21 at 07:18

0 Answers0