The application I am testing right now has a button in one of it’s pages. Node details is given -
This button has two parts. One part is plain text which is non clickable but other part is clickable. How can I identify and click that part?
First Identify the button using either id or any preferable way and then get the coordinates of the button.After you get x and y coordinates,Use the TouchAction class and tap on the button at the required place.
Thanks for the reply Swathi but my problem is different. For example I have a button with ID say “X”. But this entire button is not clickable. Only a part of it is clickable. How can I identify that part?
Please refer this picture…part PQR is clickable in the button.
Hello Soham,
They are in single frame or having the different frame with in the Ui viewer,can you please share the screen shot for it.
Thanks!!!
Hi Amit,
I am sorry I won’t be abe to share the screen. But they are in a single frame.
Node details example -
class: android:widget:button
package: com.abc
content-desc :- ABC PQR
Clickable is set as true though for part ABC it is not enabled.
it’s ok!!!
But the dynamic xpath for both the text will be different.which can help you to perform action on it. please try this and let me know if any concern.
Thanks
Thanks Amit for the suggestion . Just one more doubt - This button has no text or resource id. The part “PQR” and “ABC” is mentioned in the content description only. My question is even if I use dynamic xpath how it will separately identify PQR and perform click/tap on it?
Welcome Soham…
you can use the dynamic xpath with bounds that can easily identify the “PQR” and “ABC” perform the click on specific element.let me know if any concern!!!
Hi Amit
Tried with bounds but not working. Please check the node details of the button.
Hi,
Can we check this once.
xpath("//android.widget.Button[contains(@content-desc,‘ABC’)]")