How to configure appium with nightwatch js

2,058 views
Skip to first unread message

Hema

unread,
Feb 9, 2016, 5:30:49 AM2/9/16
to NightwatchJs
Hi,

I am using Nightwatch js with Sauce labs for my web browser based application.
In this I would like to integrate with appium for mobile web testing on a real device.

Can anyone please share how to setup the configuration appium in Nightwatch?

Kind Regards,
Hema

Ellen Wong

unread,
Feb 9, 2016, 10:38:08 AM2/9/16
to NightwatchJs
Define a test environment within nightwatch.json. I call this one "sauce-ios":

        "sauce-ios" : {
            "selenium" : {
                "start_process" : false
            },
            "selenium_host" : "ondemand.saucelabs.com",
            "selenium_port" : 80,
            "username" : "${SAUCE_USERNAME}",
            "access_key" : "${SAUCE_ACCESS_KEY}",
            "desiredCapabilities": {
                "browserName": "Safari",
                "platformName": "iOS",
                "platformVersion": "9.2",
                "deviceName": "iPhone 6",
                "javascriptEnabled": true,
                "acceptSslCerts": true
            }
        },



To run the tests, I pass the option -e sauce-ios to nightwatch. 

Corrinna Rainwater

unread,
Feb 10, 2016, 3:43:54 PM2/10/16
to NightwatchJs
You can just run your nightwatch tests on saucelab devices, saucelabs converts the test into appium tests.

Appium doesn't test on real devices but on the webview.

Hth, Corrinna


On Tuesday, February 9, 2016 at 2:30:49 AM UTC-8, Hema wrote:

Hema

unread,
Feb 11, 2016, 4:31:38 AM2/11/16
to NightwatchJs
Thanks guys.

Without using Sauce Labs, Is it possible to run the tests on mobile devices using Nightwatch js? If yes, Can you please send me the steps for that?

Kind Regards,
Hema


Ellen Wong

unread,
Feb 11, 2016, 1:26:00 PM2/11/16
to NightwatchJs
It's possible through Appium. Plug in a device to your computer and set up some test environments:

        "android" : {
            "launch_url" : "http://localhost:4723/wd/hub",
            "selenium_port"  : 4723,
            "selenium_host"  : "localhost",
            "silent": true,
            "desiredCapabilities": {
                "browserName": "chrome",
                "platformName": "ANDROID",
                "deviceName": ""
            }
        },
        "ios" : {
            "launch_url" : "http://localhost:4723/wd/hub",
            "selenium_port"  : 4723,
            "selenium_host"  : "localhost",
            "silent": true,
            "desiredCapabilities": {
                "browserName": "Safari",
                "platformName": "iOS",
                "platformVersion": "9.2",
                "deviceName": ""
            }
        }

Make sure Appium is running, make sure the devices are connected and developer mode is enabled, then run your tests by specifying the appropriate environment (android, ios) for the device. In practice, one will likely run into a variety of issues along the way when trying to get this working, so hopefully this is enough to get you started. 

Jaime Wissner

unread,
Mar 7, 2016, 8:44:51 PM3/7/16
to NightwatchJs
Just a note. With Appium and SauceLabs you should be specifying what version of Appium to use. 1.4.16 is the most stable, and will work almost every time. Otherwise (specifically on iOS) you can run into problems you don't expect. Like devices not unlocking correctly.

Corrinna Rainwater

unread,
Mar 9, 2016, 4:51:15 PM3/9/16
to NightwatchJs
I think I might be running into this issue. How do I specify the Appium version?

JW

unread,
Mar 10, 2016, 1:27:47 AM3/10/16
to nightw...@googlegroups.com
It's just specifying "appiumVersion" in the desired capabilities.

-Jaime Wissner


--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/6404e9db-6ec2-42ce-8b93-9b9ac9cf5f8b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

antony prince

unread,
Jun 22, 2016, 7:46:51 AM6/22/16
to NightwatchJs
can you plz say me how to execute nightwatch js with appium to test mobile app

Catherine Wang

unread,
Aug 17, 2016, 6:56:32 AM8/17/16
to NightwatchJs
Hi guy,

Now, I want to run my nightwatch tests on mobile through AWS Device Farm. I have following confusions and could you help to answer?
  • Is there any configuration that need to do for my nightwatch tests
  • AWS Device Farm supports some test types, which is nightwatch belonged to?
  • If I configure my nightwatch test and upload to AWS Device Farm, the test can run on mobile?
And according to you, seems the tests must be converted into appium tests, what I should do for this, or just upload to AWS Device Farm, and it can convert automated?

Best Regards

在 2016年2月11日星期四 UTC+8上午4:43:54,Corrinna Rainwater写道:
Reply all
Reply to author
Forward
0 new messages