Hello, I'm trying to automate a test for my app, but cannot get Interact > Click to affect the Like icon button.
Here is the XML for my React Native app:
<android.view.ViewGroup android:enabled="true" android:layout_height="77px" android:layout_width="1008px" android:layout_x="36px" android:layout_y="1510px">
<android.view.ViewGroup android:clickable="true" android:enabled="true" android:focusable="true" android:layout_height="44px" android:layout_width="71px" android:layout_x="36px" android:layout_y="1510px">
<android.widget.ImageView android:enabled="true" android:layout_height="40px" android:layout_width="53px" android:layout_x="36px" android:layout_y="1510px"/>
</android.view.ViewGroup>
<android.view.ViewGroup android:clickable="true" android:enabled="true" android:focusable="true" android:layout_height="38px" android:layout_width="143px" android:layout_x="107px" android:layout_y="1513px">
<android.widget.TextView android:enabled="true" android:layout_height="38px" android:layout_width="72px" android:layout_x="107px" android:layout_y="1513px" android:text="0 LIKES"/>
</android.view.ViewGroup>
<android.view.ViewGroup android:clickable="true" android:enabled="true" android:focusable="true" android:layout_height="44px" android:layout_width="62px" android:layout_x="250px" android:layout_y="1510px">
<android.widget.ImageView android:enabled="true" android:layout_height="36px" android:layout_width="53px" android:layout_x="250px" android:layout_y="1514px"/>
</android.view.ViewGroup>
<android.widget.TextView android:enabled="true" android:layout_height="44px" android:layout_width="35px" android:layout_x="388px" android:layout_y="1510px" android:text="25d"/>
<android.view.ViewGroup android:clickable="true" android:enabled="true" android:focusable="true" android:layout_height="38px" android:layout_width="147px" android:layout_x="495px" android:layout_y="1513px">
<android.widget.TextView android:enabled="true" android:layout_height="38px" android:layout_width="76px" android:layout_x="495px" android:layout_y="1513px" android:text="REPORT"/>
</android.view.ViewGroup>
</android.view.ViewGroup>
I've tried the following XPath Expressions, but the Like button won't click:
- //android.view.ViewGroup[android.view.ViewGroup[android.widget.TextView[@text='0 LIKES']]]//android.widget.ImageView[@enabled='true']
- //android.widget.TextView[@text='0 LIKES']/preceding-sibling::android.view.ViewGroup/android.widget.ImageView
- //android.view.ViewGroup[android.view.ViewGroup[android.widget.ImageView[@enabled='true' and @layout_height='40px' and @layout_width='53px' and @layout_x='36px' and @layout_y='1510px']] and android.view.ViewGroup[android.widget.TextView[@text='0 LIKES']]]/android.widget.ImageView[@enabled='true' and @layout_height='40px' and @layout_width='53px' and @layout_x='36px' and @layout_y='1510px']
Any ideas?