microsoft / WinAppDriver

Windows Application Driver
MIT License
3.68k stars 1.4k forks source link

session control goes from desktop application to Chrome url how? #923

Open rkunamneni19 opened 5 years ago

rkunamneni19 commented 5 years ago

Hi, nice to see this blog.. I am testing widows application on desktop using winapp driver, my application will have links to click on folder and chromebrowser. i can be able to click on those links and then pop up with folder and chrome browser. but i cant move my session control to those windows, do yo have any idea how move the session control from desktop application to chrome browser??

please give me your answer, or if you give me your number i can call you..

private static WindowsDriver RootSession = null; private static WebElement RootResult = null; private static WebElement Bluetooth = null;

@Before
public void initTest() throws MalformedURLException {
    DesiredCapabilities capabilities = new DesiredCapabilities();
    capabilities.setCapability("app", "Root");
    RootSession = new WindowsDriver<RemoteWebElement>(new URL("http://127.0.0.1:4723"), capabilities);
    RootSession.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
    RootResult = RootSession.findElementByName("Notification Chevron");
     RootResult.click();

RootResult = RootSession.findElementByName("Bluetooth Devices"); RootSession.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS); RootResult.click();

if there is a weburl in bluetooth Devices and once i click and it will open browser but how i can i render my session control to Browser?

anunay1 commented 5 years ago

You can't render the session to browser.

PandaMagnus commented 4 years ago

If you have control over how the Chrome browser is launched, you can launch the browser set up for a remote debug session, and then "attach" to the browser using Selenium to use the remote debug capabilities in Chrome. There's a couple of examples floating around in Python and JS, here's an example I put together in C#: https://intellitect.com/selenium-chrome-csharp/