Please help me out. I am trying to automate the compose base architecture app. There is an issue that in compose ids are not assign to components only getting xpath which are getting change in every build dynamically. Want to know any tool that can help me out in testing.
I have problems to understand your text. Do you mind rephrase it and adding more details?
“compose base architecture app” is that the name of your app?
At the very last: is your problem that your 's IDs keep changing so you can not make a stable automation?
One solution is to ask the developers to introduce dedicated test IDs in the app. At least for such components.
As it is not easy to predict which components are problematic, this is sometimes a bit lengthy back and forth:
You find out what components lack stable IDs => tell the developers => they implement them => with the next version get them
For this I suggest a direct exchange. With less official steps needed (e.g. by handing over tickets) is this faster. Maybe in minutes, at least hours, hopefully not days.
Did I guess your problem right?
Yes you did and thank you so much.
There is another thing i want to know is there any other tool which don’t t need Ids, xpath for locating any element while automating?
Great that I could help here ![]()
There are many different out tools out. XPath and CSS selector are the most common ones, and the only ones I know.
Which one your are using? Maybe it can do CSS selectors too.
I’m unsure if you maybe have a misconceptions, reject this if I’m wrong:
XPaht can use IDs, they do not have to (that is how I read your text). You can use (parts of) XPath without IDs, e.g. by attributes.
Our app is build using Jetpack Compose Framework, it uses declarative approach for defining UI Components, like Flutter and React Native apps.
In this architecture a same UI components is used at different places to keep the reusabillity of the components, this creates difficulty in assigning unique ids to these components. And it does not even allow the CSS selections.
That’s what I was asking about that is there any tool that would allow automation without giving IDs, or any method that I would use to get the unique elements from xpath without using the IDs.
You can navigate XPath also by attributes and wildcards for the IDs like this:
- //*[@aAttribute]
- //*[@aAttribute=‘valueOfTheAttribute’]
By this your developer can maybe set unique identifiers as attribute like this:
<randomID123 aAttribute="valueOfTheAttribute">
Maybe also axis and operator can help you:
It is been some years since I had to work with a web-based application.
Therefore I do not know anything about the frameworks your company uses.
Alright Thank you so much.
@sahar_fatimah My suggestions will be:
- We faced multiple time that every release xptha changes that causing the failure of automation scripts, so talk to your developers male them understand how its impacting overall testing, so deb can use standard practice to avoid in future.
- If you are using selenium, look for “Healenium: Self-Healing Library for Selenium” , this will help you some part & not break your test case if you are running long end to end tet case .
This topic was automatically closed after 730 days. New replies are no longer allowed.