Unable to do Appium Touchaction in Serenity

419 views
Skip to first unread message

divya parvati

unread,
Jul 21, 2016, 12:33:18 PM7/21/16
to Serenity BDD Users Group
java.lang.ClassCastException: net.thucydides.core.webdriver.WebDriverFacade cannot be cast to io.appium.java_client.MobileDriver,

Can someone please share a sample code how to solve this problem?

Thanks & regards,
Divya

divya parvati

unread,
Jul 22, 2016, 1:00:05 AM7/22/16
to Serenity BDD Users Group
Hi John,

Unable to do any touch actions while using the combination of Serenity + Jbehave +Appium

VersionsUsed:]
Serenity : 1.1.36
Serenity Jbehave version : 1.13.0
Appium : 4.0.0

I get the below issues

1. (net.serenitybdd.core.exceptions.SerenityManagedException: Timed out after 2 seconds. Element not available

This happens for text fields as it is not able to click on the text field, 

options tried 

a. Actions class

b. getLocation

c. Simple selenium click


2. (java.lang.ClassCastException: net.thucydides.core.webdriver.WebDriverFacade cannot be cast to io.appium.java_client.MobileDriver)

Waiting for your reply ASAP


Thanks in Advance,

Divya

Lovesh Jain

unread,
Sep 1, 2016, 11:48:29 PM9/1/16
to Serenity BDD Users Group
Hi Divya,

Were you able to get it working. Even I am facing the same issue.
Any help would be much appreciated.

Thanks,
Lovesh

Lovesh Jain

unread,
Sep 2, 2016, 12:21:12 AM9/2/16
to Serenity BDD Users Group
I tried below code as well but no luck.

   WebDriver facade = getDriver();
   WebDriver driver = ((WebDriverFacade)facade).getProxiedDriver();
   TouchAction actions = new TouchAction((MobileDriver)driver) ;

divya parvati

unread,
Sep 2, 2016, 1:07:08 AM9/2/16
to Serenity BDD Users Group

             Please use the code the below way 


    WebDriver facade = getDriver();

   WebDriver driver = ((WebDriverFacade)facade).getProxiedDriver();
   TouchAction actions = new TouchAction((MobileDriver)driver) ;

    WebElement elementFromProxy = driver.findElement(By.<selector>);

   actions.moveTo(elementFromProxy).release().perform();

Lovesh Jain

unread,
Sep 2, 2016, 1:23:50 AM9/2/16
to Serenity BDD Users Group
Hi Divya,

Thanks for your response. I tried your below code but still, I am getting same issue.
Sorry, forgot to mention that I am running my test on Saucelabs.

Error :-  Error:org.openqa.selenium.remote.RemoteWebDriver$$EnhancerByCGLIB$$6191bd78 cannot be cast to io.appium.java_client.MobileDriver


Thanks,
Lovesh
Reply all
Reply to author
Forward
0 new messages