Hi Issac,
Try WebElement element=wd.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAWebView[1]/UIAStaticText[4]"));
String val=element..getAttribute("label"); // for getting text from static text element
Also, if you want to get the value from a text box try
element.getAttribute("value");
On Friday, 23 May 2014 19:29:01 UTC+5:30, Isaac Murchie wrote:
Unfortunately, iOS has a bug in which the name of a label is always returned as it's text. You can set the name, but that doesn't work if it is dynamic at all.
I've gotten around it by making my labels be read only text fields.
On Friday, May 23, 2014, SF QA <
shivang....@gmail.com> wrote:
I am trying to fetch the text of the label using xpath of that label.WebElement element=wd.findElement(By.xpath("//UIAApplication[1]/UIAWindow[1]/UIAScrollView[1]/UIAWebView[1]/UIAStaticText[4]"));
String val=element.getText();
Every time i am getting null value as a result;
Is there any other way to fetch the text?
--
http://appium.io
---
You received this message because you are subscribed to the Google Groups "Appium-discuss" group.