HI …All
Following are my configuration
1.xcode 6.4
2.Appium 1.4.8
3 .iPhone 6 (Real Device) iOS 8.4
4.Mobile Web App
=====================================================================================
Unable to execute following methods.
iphoneDriver.get(“http://www.gmail.com”)
((IOSElement)iphoneDriver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[2]/UIAScrollView[1]/UIAScrollView[1]/UIAWebView[1]/UIATextField[1]"))).setValue(“Test”);
Please suggest the solution
=====================================================================================
Find the below code
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.ios.IOSElement;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class WebAppTest {
static IOSDriver iosdriver;
static AppiumDriver iphoneDriver;
DesiredCapabilities capabilities = new
DesiredCapabilities();
public static void main(String[] args) throws
MalformedURLException, InterruptedException {
DesiredCapabilities
capabilities = new DesiredCapabilities();
capabilities.setCapability(“deviceName”, " iPhone
6-3");
capabilities.setCapability(“platformName”, “iOS”);
capabilities.setCapability(“platformVersion”,
“8.2”);
capabilities.setCapability(“browserName”,
“mobilesafari”);
capabilities.setCapability(“udid”,
" <IOS
Device UDID>");
capabilities.setCapability(“bundleid”, “”);
iphoneDriver = new
IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”),
capabilities) {
@Override
public IOSElement
scrollTo(String arg0) {
// TODO
Auto-generated method stub
return null;
}
@Override
public IOSElement
scrollToExact(String arg0) {
// TODO
Auto-generated method stub
return null;
}
};
iphoneDriver.get(“http://www.gmail.com”); // Unable to execute
this line
iphoneDriver.tap(1,
114, 81, 0);
((IOSElement)iphoneDriver.findElement(By.xpath("//UIAApplication[1]/UIAWindow[2]/UIAScrollView[1]/UIAScrollView[1]/UIAWebView[1]/UIATextField[1]"))).setValue(“Test”);
}
}