Closed RJ05 closed 8 years ago
POM:-
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>AppiumSerenity</groupId>
<artifactId>framework</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<serenity.version>1.1.22-rc.11</serenity.version>
<serenity.maven.version>1.1.22-rc.11</serenity.maven.version>
<webdriver.driver>appium</webdriver.driver>
</properties>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>1.1.22-rc.11</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>1.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-api</artifactId>
<version>2.42.2</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>2.44.0</version>
</dependency>
<dependency>
<groupId>org.apache.ws.commons.util</groupId>
<artifactId>ws-commons-util</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-client</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.xmlrpc</groupId>
<artifactId>xmlrpc-common</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-all</artifactId>
<version>2.4.3</version>
</dependency>
<dependency>
<groupId>com.googlecode.lambdaj</groupId>
<artifactId>lambdaj</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>io.appium</groupId>
<artifactId>java-client</artifactId>
<version>3.3.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.18</version>
<configuration>
<includes>
<include>**/features/**/When*.java</include>
</includes>
<systemProperties>
<webdriver.driver>${webdriver.driver}</webdriver.driver>
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.maven.version}</version>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
I've put together a pull request which might help. https://github.com/serenity-bdd/serenity-core/pull/331
Hello @hazmeister
Thanks for your contribution!!!
Your pull request merged and will be included in next release )
closed by mistake
@RJ05, @hazmeister: is this issue still present in 1.1.31?
Thanks @wakaleo , ran a test this morning with Serenity 1.131 and Appium 1.5.1 and had no problems.
I'm getting the same error. Trying a sample project to run with appium
# start appium
appium &
mvn verify -Dappium.hub=http://127.0.0.1:4723/wd/hub -Dwebdriver.driver=appium -Dappium.platformName=iOS -Dappium.browserName=Safari -Dappium.deviceName="iPhone 5"
But getting the following error:
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 52.481 sec <<< FAILURE! - in demo.tests.GoogleSearchFailTest
googleSearchFailTest(demo.tests.GoogleSearchFailTest) Time elapsed: 52.481 sec <<< ERROR!
net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate class io.appium.java_client.AppiumDriver
at demo.steps.GoogleSteps.googleSearchPage(GoogleSteps.java:22)
at demo.steps.GoogleSteps.inputSearchTerm(GoogleSteps.java:57)
at demo.steps.GoogleSteps.performSearch(GoogleSteps.java:73)
at demo.tests.GoogleSearchFailTest.googleSearchFailTest(GoogleSearchFailTest.java:30)
I've found the error. Please reopen this issue. The error is related the browser redimension-Method. If setting browser dimensions it's not working:
Method is not implemented (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 7 milliseconds
The method supportsScreenResizing should return false for appium. I'll create a PR and a test for it.
Thanks for your help!
Released in 1.1.34
thanks. Will test later ;)
the original error is gone. So this one can be closed.
Hi,
I know that the ticket is already closed, but it has all the history.
Using CucumberWithSerenity runner and serenity-core:1.1.36 I got exactly same error
[main] ERROR net.thucydides.core.webdriver.WebDriverFacade - FAILED TO CREATE NEW WEBDRIVER_DRIVER INSTANCE class io.appium.java_client.AppiumDriver: Could not instantiate class io.appium.java_client.AppiumDriver
The only difference from the sample project mentioned above is that I have a hybrid app under test. On the other hand it should not be a serious problem as it contains one huge webView, so basically all content of the app is web-based.
Hints?
BR, Kris
That error can happen for many reasons - it might be worth raising a new issue or asking over on the Google group. What options are you starting Appium with?
hi @szarlatan , can you please post more from your error log ? As @hazmeister mentioned, it may also be a problem of the appium options that you are using for starting the test, for example, in serenity.properties:
appium.deviceName= e2f5c460 appium.browserName = Chrome
So, @hazmeister @cliviu
I run the tests with such appium section (this is the exact properties file as there is nothing more at the moment):
webdriver.driver = appium
appium.platformName = Android
appium.deviceName = Galaxy Tab 4
appium.platformVersion = 5.0.2
appium.app = /Users/krisu/git/serenitypoc/app.apk
appium.autoWebview = true
Interesting part is that looking the Appium server logs I can see that capabilities are injected properly, more over a session is created with device and the application is being installed and launched. After that, when the code execution gets to the elements interaction logic, it fails immediately.
What else I've found that might be quite a root cause of my problem is following
Caused by: org.openqa.selenium.SessionNotCreatedException: A new session could not be created. Details: Problem getting session data for driver type AndroidDriver; does it implement 'get driverData'?
BTW, would dev group be better to seek for assistance with such problems? Or users will do as well?
Kris.
Somehow, the AndroidDriver is created twice from your code (the second time it fails ), is it possible to post more possible problem cause from logs ? Have you also check the appium server logs ?
That is quite probable, yesterday going through the appium log I saw that second session has been created and the problem (for me) started with proxying one to another.
Just not to flood the message, I attach two files with entire stacktrace and appium server log.
stacktrace.txt appium-server.txt
[EDIT] I can even share the project code as it is a simple POC.
Kris.
@szarlatan get your deviceid from adb devices
(run via the command line) and use that as the device name.
@hazmeister that gave me no changes.
Hey Kris, please try the following library combination. First of all please run appium server 1.5.3 As mvn dependencies : serenity-core1.1.37-rc.9, io.appium.java-client 4.1.2. Let me know how it goes :-)
Hey @cliviu.
I ran it the configuration you've described, but no changes either.
The only change that I found is the DARKROOM COUNT: 1
presented right below the stacktrace I sent yesterday.
I will report this on google group in a minute too. Which do you think will be better, dev or users?
Kris.
Hey Kris,
Can you please type "mvn dependency:tree" in your project directory and post the output here in a file ? I was able to reproduce your issue yesterday using an older serenity-core version. Maybe there is some dependency problem somehow.
Thanks!
Hey @cliviu,
you will find it in a file attached. And it seems that there is a hope ;-) mvn-dependency-tree.txt
Regards, Kris.
Hey Kris, I tried with your libraries combination, I cannot reproduce the problem with my test code. Please share your project code, as you said is a POC and it can be shared. Thanks, Liviu
Here it is. The only thing I cannot share with you is the app under test itself, as it is a regular project for us ;-)
Another thing I found as potential root cause of the problem - I set the appium driver capability autoWebview = true
to automatically switch to webview on start (as our app is just a huge webview). If I comment this out the test will break of course, but with a different root cause and obviously stacktrace.
Hi Kris, thanks for your upload. regarding the webview , I have found the following appium issue : https://github.com/appium/appium/issues/5089. which may explain why appium.autoWebview = true fails. Tell me a bit about the architecture of your application ... I think you should use @AndroidFindBy annotations in your PageObjects ...
I went through the appium issue and what I found is that relates strongly to Selenoid not Appium engine. Moreover, I use this autoWebview = true
capability in previous, appium-only, approach to our hybrid app automation and it is working just fine. I thought that moving over to Serenity will give us much more value with great reporting and possibility to add cucumber easily.
Our app is simply a fullscreen webview wrapped by native Android apk package. So the content of the app is a web page.
I tried to get driver's contexts but fail, as my driver seems to be null
, even if wrapped with @Managed
annotation. So maybe I doing something terribly wrong? @cliviu, have you found my code senseless in any way?
@szarlatan your tests failed in webview?
@pisarenco92 basically, yes.
As I mentioned our application is simply a fullscreen webview wrapped with native Android apk archive.
When I am using appium automation engine, with driver capability autoWebview
set to true
, then the tests fail right away after launching the application (what is handled by Appium server), without clicking on even single item, and the driver session hangs. Failure reason is
[main] ERROR net.thucydides.core.webdriver.WebDriverFacade - FAILED TO CREATE NEW WEBDRIVER_DRIVER INSTANCE class io.appium.java_client.AppiumDriver: Could not instantiate class io.appium.java_client.AppiumDriver
and the stacktrace can be found in posts above.
When I run the previous project that base simply on Appium, without the Serenity, mentioned autoWebview
flag was working properly without problems.
@szarlatan Try to add: appium.nativeWebScreenshot = true capability
@pisarenco92 Nope, that did not change a thing.
I started to wonder if Serenity can test the native/hybrid apps using AppiumDriver, so rather AndroidDriver or IOSDriver?
Thucidides core throws net.thucydides.core.webdriver.UnsupportedDriverException
what brings to mind that appium driver might not be fully supported and it covers functionality like opening the Chrome browser on a device, than Chrome WebDriver is instantiated and proceeds with testing. Does it make sense?
try to set appium.browserName=Chrome I will need a similar application with the one that you are testing. Just one html page packed in an apk.
I think that the only finder annotations supported at the moment by serenity with the AppiumDriver are @FindBy(accessibilityId = ... ) @AndroidFindBy(id = "..") @iOSFindBy(id=...). I was not able to reproduce your exception using your pom.xml, maybe it has something to do with the application under test ...
@hypery2k @cliviu in case grid setup what value to pass for -Dappium.deviceName ?
I'm trying to run test cases in parallel for native app on multiple android emulators
Thanks in advance.
@hypery2k @cliviu I'm struck with this issue since last 2 weeks, your guidance in this will be of great help. Thanks in advance.
Found similar issue: https://stackoverflow.com/questions/44785430/serenity-selenium-launching-simulator-on-macos-instead-of-physical-device The error is deceiving as I have set the following values in the serenity.properties file appium.deviceName=iPhone_Test1 appium.platform=Mac appium.app=/users/rahulk/documents/ipas/TabbedTest_Rahul.app appium.platformName=iOS appium.automationName=XCUITest appium.platformVersion=10.3.2 appium.uidid=904ac3b4c6xxxxxxxxxxxxx979 appium.hub=http://127.0.0.1:4723/wd/hub
When I change the values and provide iOSsimulator values, it works fine. Changing values to use Android Device works fine. Changing values to use Android Simulator works fine.
Also performed: xcrun instruments -s devices on my mac and i can see the my physical device listed.
Using CucumberWithSerenity.class as my runner. Any clues what is setup incorrectly?
Hi, I am trying to connect test object instance of saucelab where i am connecting testObject with testobject key, using below serenity property file :
webdriver.driver= appium
saucelabs.test.name=AppiumWordPressWithSauce saucelabs.target.platform=Windows saucelabs.testobjectApiKey=27E3B8CC6BDF4ABHH8ACA578124FCDA4C
appium.platformName = Android appium.platformVersion = 5.1.1 appium.deviceName = Samsung_Galaxy_A5_2017_real
appium.app=sauce-storage:WordPress.zip
appium.appPackage=com.ombiel.campusm.unsw
getting error as
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.
please help
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<groupId>net.serenity-bdd.appium.integration</groupId>
<artifactId>serenity-appium</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Serenity Appium Integration Test Cases</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<serenity.version>1.7.4</serenity.version>
<serenity.cucumber.version>1.6.3</serenity.cucumber.version>
<serenity.maven.version>1.7.4</serenity.maven.version>
</properties>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray-plugins</name>
<url>http://jcenter.bintray.com</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit</artifactId>
<version>${serenity.version}</version>
</dependency>
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<version>${serenity.cucumber.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.7</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>1.7.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
<configuration>
<skip>false</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.maven.version}</version>
<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
My POM
I have the issue : https://github.com/appium/java-client/issues/1343 Any idea ?
I have the following problem. somebody could help me?:
[Test worker] ERROR - Could not instantiate new WebDriver instance of type class io.appium.java_client.AppiumDriver (Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.Empresa.appcompania' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Cannot start the 'com.Empresa.appcompania' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Activity name '.MainActivity' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
ERROR net.thucydides.core.webdriver.WebDriverFacade - FAILED TO CREATE NEW WEBDRIVER_DRIVER INSTANCE class io.appium.java_client.AppiumDriver: Could not instantiate class io.appium.java_client.AppiumDriver net.thucydides.core.webdriver.UnsupportedDriverException: Could not instantiate class io.appium.java_client.AppiumDriver
Serenity Property file:- webdriver.wait.for.timeout = 1000
webdriver.driver= appium
webdriver.base.url = http://www.google.com/
appium.hub = http://127.0.0.1:4723/wd/hub
appium.platformName = Android
appium.platformVersion = 5.1.1
appium.deviceName = e2f5c460
appium.browserName = Chrome