I have an app already installed in my mobile. I just want to launch the app. and run the tests on it.
But, I am getting the following error if I ignore appium.app property from serenity.properties file
Caused by: net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate new WebDriver instance of type class io.appium.java_client.AppiumDriver (The browser under test or path to the app needs to be provided in the appium.app or appium.browserName property.
webdriver.driver= appium
appium.hub = http://127.0.0.1:4723/wd/hub
appium.platformName = Android
appium.platformVersion = 5.1.1
appium.deviceName = CB51234567
appium.appPackage = com.sample.test.dev
appium.appActivity = com.sample.test.dev.ui.login.LoginActivity
appium.noReset = true
This is an appium usage question, not a Serenity defect - could you close it and repost the question on https://serenity-BDD.rocket.chat?
I think this is possible in appium. If you don't specify the app property, It will find the installed app by its appPackage property. But, It looks like the validation on app. property seems to be mandated in serenity core as per the exception. So, Its rejecting it. Something needs to be fixed from serenity-core library so opening the issue.
[main] ERROR net.thucydides.core.webdriver.WebDriverFacade - FAILED TO CREATE NEW WEBDRIVER_DRIVER INSTANCE class io.appium.java_client.AppiumDriver: Could not instantiate new WebDriver instance of type class io.appium.java_client.AppiumDriver (The browser under test or path to the app needs to be provided in the appium.app or appium.browserName property.
net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate new WebDriver instance of type class io.appium.java_client.AppiumDriver (The browser under test or path to the app needs to be provided in the appium.app or appium.browserName property.
at net.thucydides.core.webdriver.WebDriverFactory.newWebdriverInstance(WebDriverFactory.java:133)
at net.thucydides.core.webdriver.WebDriverFacade.newDriverInstance(WebDriverFacade.java:153)
at net.thucydides.core.webdriver.WebDriverFacade.newProxyDriver(WebDriverFacade.java:144)
at net.thucydides.core.webdriver.WebDriverFacade.getProxiedDriver(WebDriverFacade.java:114)
at net.thucydides.core.webdriver.WebDriverFacade.findElement(WebDriverFacade.java:275)
at io.appium.java_client.pagefactory.AppiumElementLocator.lambda$0(AppiumElementLocator.java:96)
at io.appium.java_client.pagefactory.AppiumElementLocator$WaitingFunction.apply(AppiumElementLocator.java:150)
at io.appium.java_client.pagefactory.AppiumElementLocator$WaitingFunction.apply(AppiumElementLocator.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)
at io.appium.java_client.pagefactory.AppiumElementLocator.waitFor(AppiumElementLocator.java:76)
at io.appium.java_client.pagefactory.AppiumElementLocator.findElement(AppiumElementLocator.java:95)
at io.appium.java_client.pagefactory.interceptors.InterceptorOfASingleElement.intercept(InterceptorOfASingleElement.java:61)
at org.openqa.selenium.remote.RemoteWebElement$$EnhancerByCGLIB$$d27c0df4.getTagName(<generated>)
at net.serenitybdd.core.pages.WebElementFacadeImpl.getTagName(WebElementFacadeImpl.java:1112)
at net.serenitybdd.core.pages.WebElementExpectations.isAFormElement(WebElementExpectations.java:162)
at net.serenitybdd.core.pages.WebElementExpectations.isDisabledField(WebElementExpectations.java:158)
at net.serenitybdd.core.pages.WebElementExpectations.access$000(WebElementExpectations.java:10)
at net.serenitybdd.core.pages.WebElementExpectations$3.apply(WebElementExpectations.java:64)
at net.serenitybdd.core.pages.WebElementExpectations$3.apply(WebElementExpectations.java:55)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)
at net.serenitybdd.core.pages.WebElementFacadeImpl.waitUntilEnabled(WebElementFacadeImpl.java:965)
at net.serenitybdd.core.pages.WebElementFacadeImpl.waitUntilElementAvailable(WebElementFacadeImpl.java:807)
at net.serenitybdd.core.pages.WebElementFacadeImpl.type(WebElementFacadeImpl.java:688)
at net.serenitybdd.core.pages.PageObject.typeInto(PageObject.java:515)
at com.camlin.eqm.auto.pages.LoginPage.login(LoginPage.java:26)
at com.camlin.eqm.auto.steps.serenity.LoginSteps.login(LoginSteps.java:16)
at com.camlin.eqm.auto.steps.serenity.LoginSteps$$EnhancerByCGLIB$$a67069d3.CGLIB$login$0(<generated>)
at com.camlin.eqm.auto.steps.serenity.LoginSteps$$EnhancerByCGLIB$$a67069d3$$FastClassByCGLIB$$7d57839.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at net.thucydides.core.steps.StepInterceptor.invokeMethod(StepInterceptor.java:426)
at net.thucydides.core.steps.StepInterceptor.executeTestStepMethod(StepInterceptor.java:411)
at net.thucydides.core.steps.StepInterceptor.runTestStep(StepInterceptor.java:386)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:134)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:63)
at com.camlin.eqm.auto.steps.serenity.LoginSteps$$EnhancerByCGLIB$$a67069d3.login(<generated>)
at com.camlin.eqm.auto.scenario.steps.LoginScenarioSteps.login(LoginScenarioSteps.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:32)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:26)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:37)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:40)
at cucumber.api.TestStep.executeStep(TestStep.java:102)
at cucumber.api.TestStep.run(TestStep.java:83)
at cucumber.api.TestCase.run(TestCase.java:58)
at cucumber.runner.Runner.runPickle(Runner.java:80)
at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:140)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:99)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:41)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:108)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: net.thucydides.core.webdriver.ThucydidesConfigurationException: The browser under test or path to the app needs to be provided in the appium.app or appium.browserName property.
at net.thucydides.core.webdriver.appium.AppiumConfiguration.ensureAppOrBrowserPathDefinedIn(AppiumConfiguration.java:105)
at net.thucydides.core.webdriver.appium.AppiumConfiguration.appiumPropertiesFrom(AppiumConfiguration.java:99)
at net.thucydides.core.webdriver.appium.AppiumConfiguration.getProperties(AppiumConfiguration.java:77)
at net.thucydides.core.webdriver.appium.AppiumConfiguration.getCapabilities(AppiumConfiguration.java:68)
at net.serenitybdd.core.webdriver.driverproviders.AppiumDriverProvider.appiumCapabilities(AppiumDriverProvider.java:51)
at net.serenitybdd.core.webdriver.driverproviders.AppiumDriverProvider.newInstance(AppiumDriverProvider.java:38)
at net.thucydides.core.webdriver.WebDriverFactory.newWebdriverInstance(WebDriverFactory.java:123)
... 74 more
Feel free to look into the code and propose a PR if you see something not behaving as it should.
Sure @wakaleo. Right now, I am trying to use serenity for mobile automation. But, It seems to have issues with webdriver creation and using androidfindby annotations with MobileElement, WebElementfacade etc.. So, I am bit worried is it worth use this now? Or better to stick to appium client without serenity. Looks like the appium Integration with serenity is not stable.
The appium integration is largely community supported, you should ask on Rocket Chat as there are many users who use Serenity and Appium together.
we can achieve this by simply setting the app property to empty value as per help received from rocket chat. Thanks for that. So, closing this issue.
webdriver.driver= appium
appium.hub = http://127.0.0.1:4723/wd/hub
appium.platformName = Android
appium.platformVersion = 5.1.1
appium.deviceName = CB51234567
_appium.app =_
appium.appPackage = com.sample.test.dev
appium.appActivity = com.sample.test.dev.ui.login.LoginActivity
appium.noReset = true
Most helpful comment
we can achieve this by simply setting the app property to empty value as per help received from rocket chat. Thanks for that. So, closing this issue.
webdriver.driver= appium
appium.hub = http://127.0.0.1:4723/wd/hub
appium.platformName = Android
appium.platformVersion = 5.1.1
appium.deviceName = CB51234567
_appium.app =_
appium.appPackage = com.sample.test.dev
appium.appActivity = com.sample.test.dev.ui.login.LoginActivity
appium.noReset = true