Appium Xcode 8 and iOS 10.2 -this.nativeTap is not a function at XCUITestDriver.navigate

How do we resolve below error -
[MJSONWP] Encountered internal error running command: TypeError: this.nativeTap is not a function
at XCUITestDriver.navigate$ (…/…/…/lib/commands/context.js:411:18)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)

Desired Capabilities:
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“deviceName”, “iPhone 6”);
capabilities.setCapability(“platformName”, “iOS”);
capabilities.setCapability(“platformVersion”, “10.2”);
capabilities.setCapability(“automationName”, “XCUITest”);
capabilities.setCapability(“browserName”, “safari”);
driver = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);

No solution but just wanted to note I have this issue as well. Using Mac OS 10.12.2, xcode 8.2.1, Appium 1.6.3, and Selenium 3.0.1 to start a simulated iphone 6 (and safari) running ios 10.1 or 10.2.

provide sample code that’s failing

package iosPOC;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;

import io.appium.java_client.ios.IOSDriver;

import java.net.URL;

public class SafariTest {

private WebDriver driver;

@BeforeTest
public void setUp() throws Exception {
	DesiredCapabilities capabilities = new DesiredCapabilities();
	capabilities.setCapability("deviceName", "iPhone 6");
	capabilities.setCapability("platformName", "iOS");
	capabilities.setCapability("platformVersion", "10.2");
	capabilities.setCapability("automationName", "XCUITest");
	capabilities.setCapability("browserName", "safari");
	driver = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
	// driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}

@Test
public void runTest() throws Exception {
	driver.get("URL");
	Thread.sleep(1000);
	WebElement idElement = driver.findElement(By.id("i_am_an_id"));
	assertNotNull(idElement);
	assertEquals("I am a div", idElement.getText());
	WebElement commentElement = driver.findElement(By.id("comments"));
	assertNotNull(commentElement);
	commentElement.sendKeys("This is an awesome comment");
	WebElement submitElement = driver.findElement(By.id("submit"));
	assertNotNull(submitElement);
	submitElement.click();
	Thread.sleep(7000);
	WebElement yourCommentsElement = driver.findElement(By.id("your_comments"));
	assertNotNull(yourCommentsElement);
	assertTrue(driver.findElement(By.id("your_comments")).getText().contains("This is an awesome comment"));

	System.out.println(driver.getCurrentUrl());
}

@AfterTest
public void tearDown() throws Exception {
	driver.quit();
}

}

exactly same problem but I have IpadAir and when I try to launch on real device the app crash it do not wait

I am facing following issue .please help me

It will be better if you initiate a separate support channel for this.

@Pratik_Barjatiya what line is your test failing on? is it failing on submitElement.click?

@hardik_d - The Browser is launched and simulator shuts down.

I guess Code fails at the time of launching the browser itself.

Same issues here, do you guys have any solutions yet?

Hi Guys, any update for this issue?

I am also getting the same error when trying to run tests again Safari on a simulator:

  1. mac OSX: 10.12.2
  2. Appium: 1.6.3
  3. Xcode: 8.2.1
    4.ios simulator: 10.0
    Any help is appreciated.

I had got the same problem.
You must review your appium command execution "appium --port “xxxx” …
If you have de capability --safari, remove it.
It should be:
appium --port “xxxx” --session-override --debug-log-spacing --platform-version “10.2” --platform-name “iOS” --browser-name “Safari” --default-device

Now appium work to me with mac 10.11.6, xcode 8.2 (8C38) and ios simulator 10.2

Luck

Thank you @Justo_Olalla. Yes, after I removed --safari in my appium command, it worked.

Hi,

Thanks a lot,
After removing the --safari in command, i could launch safari and run my cases on IOS 10.0

You’re wellcome.

I’M glad help You.

Despite your question is not related to this topic, the solution for you is here http://stackoverflow.com/a/40168992/2334082.