Perform() not working on web element

I am new to appium and trying to automate my web view in my app. I have added touchend event listener to a div. Now i want to fire this event from appium using touchAction class.

I tired touchAction on sample native app. It works , but it doesn’t work for Web element in my app. What I am doing wrong?
I went through the following posts but i am not able to solve this issue


Here’s the error : -
org.openqa.selenium.WebDriverException: Not yet implemented. Please help us: (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 6 milliseconds
Build info: version: ‘2.45.0’, revision: ‘5017cb8’, time: ‘2015-02-26 23:59:50’
System info: host: ‘lab-mac-aee074’, ip: ‘’, ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.10.3’, java.version: ‘1.8.0_40’
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities [{app=/Users/labuser/Library/Developer/Xcode/DerivedData/x-ebjypaqeckllutepszxlfjpmksnn/Build/Products/Debug-iphonesimulator/, networkConnectionEnabled=false, warnings={}, databaseEnabled=false, deviceName=iPad Air, platform=MAC, desired={app=/Users/labuser/Library/Developer/Xcode/DerivedData/x-ebjypaqeckllutepszxlfjpmksnn/Build/Products/Debug-iphonesimulator/, appium-version=1.0, platformVersion=8.2, platformName=iOS, deviceName=iPad Air}, appium-version=1.0, platformVersion=8.2, webStorageEnabled=false, locationContextEnabled=false, browserName=iOS, takesScreenshot=true, javascriptEnabled=true, platformName=iOS}]
Session ID: 61fee5d5-c57a-4c48-a1c2-15d678774579
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.openqa.selenium.remote.ErrorHandler.createThrowable(
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at io.appium.java_client.AppiumDriver.execute(
at io.appium.java_client.AppiumDriver.performTouchAction(
at io.appium.java_client.TouchAction.perform(
at com.x.x.FirstTest.testLocation(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
at org.junit.internal.runners.statements.RunBefores.evaluate(
at org.junit.internal.runners.statements.RunAfters.evaluate(
at org.junit.runners.ParentRunner.runLeaf(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.ParentRunner$
at org.junit.runners.ParentRunner$1.schedule(
at org.junit.runners.ParentRunner.runChildren(
at org.junit.runners.ParentRunner.access$000(
at org.junit.runners.ParentRunner$2.evaluate(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

Here is my code : -

        driver.manage().timeouts().implicitlyWait(4, TimeUnit.SECONDS);
	Set<String> contextNames = driver.getContextHandles();
	for (String contextName : contextNames) {
	  if (contextName.contains("WEBVIEW")){
	WebElement wb = driver.findElement("thumb_sample1"));
	TouchAction testAction = new TouchAction(driver);

I am using the latest version of appium 1.3.7 , java-client 2.2.0 , selenium 2.45.0

Dear Tarun,

Try this,

Set contextNames = driver.getContextHandles();
for (String contextName : contextNames) {
if (contextName.contains(“WEBVIEW”)){;

Hi skbabu,
I tried your above mentioned lines of code.
I faced the following error :

contextName cannot be resolved or is not a field

shows up in your provided solution.

What we are trying to do by click in your code ?
Thanks for your reply.


Hi amedvedev,

Thanks for your reply!
But It still doesn’t work. It gives the same error. Can I try something else?

I read somewhere that IOS drivers have been implemented from AppiumDriver. Why do we need to cast it in your code?

Also it was written in some post that when i use touchAction class , it uses the class of selenium and not appium. But i was not able to solve the issue as it was not clear.

ok. i am still with 1.3.6.

what about - ((IOSDriver)driver).tap(numOfFingers,WebElement,durationInMilliSeconds);

Why do we need to cast it in your code? - i need it cause i use Google Page Source functionality to walk though pages and mine driver is normal Selenium.

That also didn’t worked! :frowning:

share Appium server error