Hi I have a question does xpath in mobile & web works the same way? In Web i can use xpath like following-sibling but does it work the same way for mobile ? Cause i tried it seems to not be working ??
This is the custom xpath that i made //*[@class = ‘android.widget.TextView’ and (@text = ‘User ID’ or . = ‘User ID’)]/following-sibling::android.widget.ViewGroup/descendant::android.widget.EditText
Thank you very much for your topic! It may take a little while before Katalon team member or others forum members respond to you.
In the meantime, you can double-check your post to see if you can add any extra information i.e. error logs, HTML codes, screenshots, etc. Check out this posting guide to help us help you better!
I might try some variation on your pathway, since you have several ‘siblings’. So, how about?
//*[@class = 'android.widget.TextView' and (@text = 'User ID' or . = 'User ID')]/following-sibling::android.widget.ViewGroup[1]/android.widget.EditText
or maybe even
//*[@text = 'User ID' or . = 'User ID']/following-sibling::android.widget.ViewGroup[1]/android.widget.EditText
The bit in bold below - I can’t see that anywhere in the hierarchy, so syntax might be correct but one of your nodes is not:
“This is the custom xpath that i made //*[@class = ‘android.widget.TextView’ and (@text = ‘User ID’ or . = ‘User ID’)]/following-sibling::android.widget.ViewGroup/descendant::android.widget.EditText”