Using WebElementFacade with Appium gives - ERROR

244 views
Skip to first unread message

Santosh Pillai

unread,
Nov 14, 2016, 4:36:00 AM11/14/16
to Serenity BDD Users Group
Hi, 

I'm using Serenity BDD with Appium to automate an iOS app. 
I can launch an app but when I'm trying to interact with the elements using 'WebElementFacade', its giving my an error:

So far, my code looks like this:

package com.Demo.pages;


import org.openqa.selenium.WebDriver;

//import org.openqa.selenium.WebElement;


//import io.appium.java_client.AppiumDriver;

//import io.appium.java_client.MobileDriver;

//import io.appium.java_client.MobileElement;

//import io.appium.java_client.TouchAction;

import net.serenitybdd.core.annotations.findby.FindBy;

import net.serenitybdd.core.pages.PageObject;

import net.serenitybdd.core.pages.WebElementFacade;


public class LandingPage extends PageObject {

public LandingPage(WebDriver driver) {

        super(driver);

    }


@FindBy(xpath="//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[2]")

private WebElementFacade controlBtn;

@FindBy(xpath = "//UIAApplication[1]/UIAWindow[1]/UIANavigationBar[1]/UIAStaticText[1]")

private WebElementFacade screenTitle;

// AppiumDriver<MobileElement> wazz = ((AppiumDriver<MobileElement>) ((WebDriverFacade) getDriver()).getProxiedDriver());

// TouchAction actions = new TouchAction((MobileDriver)wazz) ;

public void iamOnTheLandingPage() {

// TODO Auto-generated method stub

}



public void clickOnControlOption() {

// TODO Auto-generated method stub

controlBtn.click();

}



public void verifyPageTitle() {

// TODO Auto-generated method stub


}


}



On "controlBtn.click();" I get the following error

"org.openqa.selenium.WebDriverException: Return statements are only valid inside functions."


Note: It works fine if I use WebElement instead of WebElementFacade. 


Any idea as to why I'm getting this error or anything that I'm doing incorrectly. Thanks.




John Smart

unread,
Nov 14, 2016, 5:15:24 AM11/14/16
to Santosh Pillai, Serenity BDD Users Group
Hi Santosh, 

What version are you using? Did you get a stack trace?

Thanks

John.

--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send email to thucydides-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
___________________________________________________
John Smart | Wakaleo Consulting  |  +44 7398 832273
Making smart teams collaborate better
http://johnfergusonsmart.com  |  john....@wakaleo.com
___________________________________________________

We love breaking down silos and helping smart teams collaborate better! Ask about our tailored on-site workshops in Agile Product Planning, BDD Requirements Discovery,  BDD, TDD and Clean Coding, and Advanced BDD Test Automation.
___________________________________________________

Santosh Pillai

unread,
Nov 14, 2016, 7:03:02 AM11/14/16
to Serenity BDD Users Group, santosh....@gmail.com


Hi John,

I'm using  Serenity Version 1.1.42

No, its not returning any stack trace version. 

[main] ERROR net.serenitybdd.core.Serenity - TEST FAILED AT STEP When I click on Controls option

[main] ERROR net.serenitybdd.core.Serenity - Return statements are only valid inside functions. (WARNING: The server did not provide any stacktrace information)


(Also, is there any demo project with Serenity - Appium - iOs native apps) that I can refer. Thanks)


To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-use...@googlegroups.com.
To post to this group, send email to thucydid...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

divya parvati

unread,
Nov 22, 2016, 9:56:49 AM11/22/16
to Serenity BDD Users Group
When I used web element facade , i was also not successful. Had to go back to web element to make the script running for iOS. There was no error, but no actions were performed.

John Smart

unread,
Nov 22, 2016, 10:43:41 AM11/22/16
to divya parvati, Serenity BDD Users Group
Could you try with 1.2.1-rc.6?

On 22 November 2016 at 14:56, divya parvati <divya....@gmail.com> wrote:
When I used web element facade , i was also not successful. Had to go back to web element to make the script running for iOS. There was no error, but no actions were performed.
--
You received this message because you are subscribed to the Google Groups "Serenity BDD Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to thucydides-users+unsubscribe@googlegroups.com.
To post to this group, send an email to thucydides-users@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages