Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get automation id for UWP app with embedded WebView #1681

Open
vagisha-nidhi195 opened this issue Feb 16, 2022 · 5 comments
Open

Comments

@vagisha-nidhi195
Copy link

vagisha-nidhi195 commented Feb 16, 2022

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 ?

@anunay1
Copy link

anunay1 commented Feb 16, 2022

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

@vagisha-nidhi195
Copy link
Author

@anunay1 Thanks for the reply! Does it work with webview1 as well? I am seeing this WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS environment variable. My app is still using webview1 at the moment.

@anunay1
Copy link

anunay1 commented Feb 16, 2022

I have not tried, please try it, he has just given the variable name as webview2

@vagisha-nidhi195
Copy link
Author

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}

@anunay1
Copy link

anunay1 commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants