question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to get automation id for UWP app with embedded WebView

See original GitHub issue

Hello team,

I have a UWP application with embedded WebView which I am trying to automate into CI/CD with WinAppDriver. The HTML elements already contain an attribute data-automation-id to identify the elements. Ex:

<div class="xyzClassName" data-automation-id="divForIdentification">

This data-automation-id is not converted to the AutomationId in UWP App when I inspect them using inspect.exe. We will get empty AutomationID for these elements.

<Input AutomationId="" ClassName="">

ClassNames are also missing in the page object on Windows App. Infact, element containing id attribute is converted to AutomationId in windows app inspector.

Is there a way to re-use our existing data-automation-id to be available in the app so that we can use the same at both places ?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
anunay1commented, Feb 16, 2022

check #1668 , you cannot achieve this with Windows application driver.

0reactions
anunay1commented, Feb 16, 2022

I think it is a system variable that webview2 hooks on to: https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/remote-debugging/

To enable debugging of the targets identified by the JSON, you must set the WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS environment variable to send --remote-debugging-port={port_num}

Yes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Automate and test WebView2 apps with Microsoft Edge ...
This article explains how to automate and test your WebView2 app with Microsoft Edge WebDriver, by using the Selenium framework for browser ...
Read more >
WebView Class (Windows.UI.Xaml.Controls) - UWP
Provides a control that hosts HTML content in an app.
Read more >
How to do Coded UI Test Automation in a UWP App having ...
I have made a UWP Application that contains only a WebView. When the App is launched the WebView is given the URL to...
Read more >
Working with Nested Windows UI element identification in ...
... to work with Nested element identification in Windows Application ... #executeautomation #winappdriver #win32 # uwp #wpf # automation For ...
Read more >
Xamarin forms templatedview. I'm trying to do a content button ...
So, I can't set Automation ID in UWP renderer class as Forms TemplatedView is a FrameworkElement in UWP. Untuk penggunaan internal oleh platform...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found