# Automating a compose base architecture app

**URL:** <https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116>\
**Category:** Discussions\
**Created:** [27 April 2023 09:09 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116 "2023-04-27T09:09:44Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahar\_fatimah](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/sahar_fatimah/32/11624_2.png) [@sahar\_fatimah](https://club.ministryoftesting.com/u/sahar_fatimah)\
**Post date:** [27 April 2023 09:09 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116/1 "2023-04-27T09:09:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sebastian\_solidwork](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/sebastian_solidwork/32/11076_2.png) [@sebastian\_solidwork](https://club.ministryoftesting.com/u/sebastian_solidwork)\
**Post date:** [28 April 2023 04:57 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116/2 "2023-04-28T04:57:54Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sahar\_fatimah](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/sahar_fatimah/32/11624_2.png) [@sahar\_fatimah](https://club.ministryoftesting.com/u/sahar_fatimah)\
**Post date:** [28 April 2023 07:41 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116/3 "2023-04-28T07:41:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sebastian\_solidwork](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/sebastian_solidwork/32/11076_2.png) [@sebastian\_solidwork](https://club.ministryoftesting.com/u/sebastian_solidwork)\
**Post date:** [28 April 2023 07:52 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116/4 "2023-04-28T07:52:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sahar\_fatimah](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/sahar_fatimah/32/11624_2.png) [@sahar\_fatimah](https://club.ministryoftesting.com/u/sahar_fatimah)\
**Post date:** [28 April 2023 10:21 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116/5 "2023-04-28T10:21:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sebastian\_solidwork](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/sebastian_solidwork/32/11076_2.png) [@sebastian\_solidwork](https://club.ministryoftesting.com/u/sebastian_solidwork)\
**Post date:** [28 April 2023 11:10 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116/6 "2023-04-28T11:10:58Z")

</div>

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">`

> **[XPath Syntax](https://www.w3schools.com/xml/xpath_syntax.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

Maybe also axis and operator can help you:

> **[XPath Axes](https://www.w3schools.com/xml/xpath_axes.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

> **[XPath Operators](https://www.w3schools.com/xml/xpath_operators.asp)**
>
> W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

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.

---

<div class="post-metadata">

**Author:** ![sahar\_fatimah](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/sahar_fatimah/32/11624_2.png) [@sahar\_fatimah](https://club.ministryoftesting.com/u/sahar_fatimah)\
**Post date:** [28 April 2023 11:27 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116/7 "2023-04-28T11:27:09Z")

</div>

Alright Thank you so much.

---

<div class="post-metadata">

**Author:** ![theology](https://avatars.discourse-cdn.com/v4/letter/t/9fc29f/32.png) [@theology](https://club.ministryoftesting.com/u/theology)\
**Post date:** [29 April 2023 00:52 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116/8 "2023-04-29T00:52:37Z")

</div>

@sahar_fatimah My suggestions will be:

1. 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.
2. 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 .

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/club.ministryoftesting.com/system/32/14378_2.png) [@system](https://club.ministryoftesting.com/u/system)\
**Post date:** [26 April 2025 09:10 UTC](https://club.ministryoftesting.com/t/automating-a-compose-base-architecture-app/67116/9 "2025-04-26T09:10:26Z")

</div>

This topic was automatically closed after 730 days. New replies are no longer allowed.
