Could not find Xpath in UI automatorviewer when using tablet

713 views
Skip to first unread message

Vincy C

unread,
Sep 6, 2013, 6:50:18 AM9/6/13
to appium-...@googlegroups.com
Hi All,

I want to find the  xpath for "Log Out" button. But UIAutomatorviewer didnt show the xpath .

i have only one day remainnig. Can any one help me how we do this.


Thanks,
Vincy
logout_c.PNG

Mahesh Munegowda

unread,
Sep 6, 2013, 11:41:30 AM9/6/13
to appium-...@googlegroups.com
Hi Vinay,

Try using this code in java, it may help you:

List<WebElement>  buttons;
       textBoxes = driver.findElements(By.tagName("Button"));
       buttons.get(0).click();

By seeing your screen shot I feel logout is a button and it could be button.get(5).click.
Just u can try trail and error method as of now.Even at some point i was also stuck like you and this code helped me.

Thanks,
Mahesh M

Jonathan Lipps

unread,
Sep 6, 2013, 12:51:16 PM9/6/13
to Vincy C, appium-...@googlegroups.com
UIAutomatorViewer won't show the XPath. XPath is an appium thing. You'll have to construct the XPath yourself.

--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to appium-discus...@googlegroups.com.
Visit this group at http://groups.google.com/group/appium-discuss.
For more options, visit https://groups.google.com/groups/opt_out.
<logout_c.PNG>

Vincy C

unread,
Sep 10, 2013, 3:18:36 AM9/10/13
to appium-...@googlegroups.com, Vincy C
Hi,

Thanks for the reply. As you told I am constructing the xpaths manually. This was not my problem.

I am using tablet here. My problem is that the above overlay(panel), which has 'My Profile', 'Privacy policy', etc is not identified in UI Automator viewer. But it's background is identified. Since the overlay is not recognized, the nodes are not shown. So I am unable to construct the xpaths and unable to interact with this overlay through automation.

FYI, it is working in phone.

Any kind of driver.switchTo.window("...") needs to be used?.

Thanks,
Vincy.

SUPPA Venugopal

unread,
Jul 25, 2014, 1:13:34 AM7/25/14
to appium-...@googlegroups.com, vinc...@gmail.com
Hi, I am using appium and UIAutomator tool. I am unable to construct Xpath using UIAutomator tool. Would you please tell me how to construct xpath on our own. 
Please suggest me any links where I can find how to construct xpath.

Thanks in advance.

-Suppa.

On Friday, 6 September 2013 22:21:16 UTC+5:30, Jonathan Lipps wrote:
Reply all
Reply to author
Forward
0 new messages