Question

I'm trying to make all this stuff work together. Created a jenkins job with this configuration:

Environment Build: android-19 emulator spawned by the andorid emulator jenkins plugin

Build steps: Appium starting in this way:

appium --full-reset --udid $ANDROID_AVD_DEVICE

Invoke Gradle script with on a cucumber task:

    sourceSets {

    test {
        java {
            srcDir 'src/java'
        }
        resources {
            srcDir 'src/resources'
        }
    }
}


task cucumber() {
    dependsOn assemble, compileTestJava
    doLast {
        javaexec {
            main = "cucumber.api.cli.Main"
            classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
            args = ['-f', 'pretty', '--glue', 'gradle.cucumber', 'src/resources']
        }
    }
}

I created an android studio project with two modules: one with the android app sources and one cucumber-jvm "test" module with all the cucumber tests.

The problem is that, when i try to start a jenkins job that make this steps:

Compile android studio project --> Start Emulator --> Start Appium server --> compile cucumber test --> execute test

The build fail everytime and these are the logs:

https://gist.github.com/redirect11/9273079

and

https://gist.github.com/redirect11/9273043

These are the 200th job try.... and i don't remember what are the differences... but the error it's the same...

Appium server and jenkins started by the same user on the same machine... can some on help me pointing me in the right way?

No correct solution

OTHER TIPS

Looking at:

[31mMessage: [0m[31morg.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

I think I have seen that when the connection to Appium is failing. Try to just leave appium running without jenkins kicking it off to see if that solves the problem. With so many working parts try to isolate which is giving the issue. Please comment on the next issue if you have one.

If you want appium to run when a test is triggered try to run it within the test itself. Then have it close the connection when the test finishes. Just make sure your tests waits a couple seconds before trying to connect since appium has a slight boot time

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top