question

Hamittirpan-3199 avatar image
0 Votes"
Hamittirpan-3199 asked saldana-msft edited

How do I define element id for test automation in my Xamarin Forms application?

Hi everyone !

I am developing an application with Xamarin Forms 5.0.0.1905. In order to be able to define and access an element separately in the xaml automation test, an id definition must be made. I think I can use automationId and styleId for this.

First of all, I added different automationId's to each control. I didn't use styleId. But I could not see the element id in the automation test and elements can only be accessed with xpath. Automation tests were tried to be done with android apk.

What should I do to solve this problem?

Waiting for your valuable comments and suggestions xamarin family.

Thanks in Advance !

89486-screenshot-2.png


dotnet-xamarin
screenshot-2.png (162.5 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, try using resource id to access these elements on Android. Check the below link.
https://stackoverflow.com/a/57490877/11083277

0 Votes 0 ·

Hi @shanks-0895

I am currently developing with Xamarin Forms. How do I add resourceId to xaml? I can give styleId, automationId and classId only in xaml.

0 Votes 0 ·

HI, Hamittirpan. Where is the above page from? Do you use the Xamarin.UITest? The above screentshot is about the native Android source control, it cannot be added an id.

0 Votes 0 ·

Hi @JarvanZhang-MSFT

There is no UI Test in my project. The screenshot above is an image from the test company I work with as an outsourced.
I give them Android APK so they can test my application.

In this image they sent me, they said that they could not access the elementId's in my application. I actually placed the automationId's.


0 Votes 0 ·

0 Answers