microsoft / WinAppDriver

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

The desktop application has an authentication step which opens up new browser and has a pop up attached to it which has a checkbox. #1488

Closed sahaiswat closed 3 years ago

sahaiswat commented 3 years ago

The desktop application has an authentication step which opens up new chrome browser and has a pop up attached to it which has a checkbox. image

I need to select the checkbox and click on the button to move ahead. How can this be achieved?

liljohnak commented 3 years ago

We use chromedriver.exe to access these elements.

sahaiswat commented 3 years ago

can you please elaborate? The elements are not inspect able as the right click is disabled

liljohnak commented 3 years ago

Something like this. https://intellitect.com/selenium-chrome-csharp/ We add a static ChromeDriverService in our assemblyInitalization clean up the chrome driver instances. Also, remembering to do chromedriver.Quit() in test cleanup prevents weird errors in downstream tests.

shoaibmansoor commented 3 years ago

Hi @sahaiswat I can think of three ways to handle this case but all involve using desktop session

  1. Attach opened browser using desktop session and then find root element by '//*' and calculator 'OK' button offsets by using paint application. Use move_to_element_with_offset method to click on detected element with coordinates.
  2. Create a desktop session and perform the steps in #1 without attaching it to the application. (It will be slow)
  3. Create a desktop session and find element using an image. You might have to create your own implementation as winappdriver natively doesn't support this feature.
sahaiswat commented 3 years ago

Thanks will try this.