0

I need to open a browser outside of selenium but I would like to hand it over/transfer/attach to that browser winAppDriver opened to a WebDriver/Selenium. I could continue with Appium, but I prefer to use WebDriver in Selenium because of the tools for navigating and others. As to why I need to do this, is because the site rejects the instance if I open with WebDriver but works with Appium/WinAppDriver... Here is the start code I am using, but if there is an easier way via settings or whatever I am open to suggestions...

Process.Start(@"C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe");
WindowsDriver<WindowsElement> Firefox;
AppiumOptions appiumOptions = new AppiumOptions();
appiumOptions.AddAdditionalCapability("deviceName", "WindowsPC");
appiumOptions.AddAdditionalCapability("app", @"C:/Program Files (x86)/Mozilla Firefox/firefox.exe");
Uri url = new Uri("http://127.0.0.1:4723");
Firefox = new WindowsDriver<WindowsElement>(url, appiumOptions);
var ele = Firefox.FindElementByXPath("//*[@AutomationId='urlbar-input']");
ele.Clear();
ele.SendKeys("http://www.msn.com");
ele.SendKeys(Keys.Enter);
ecco88
  • 606
  • 2
  • 7
  • 16

0 Answers0