protractor icon indicating copy to clipboard operation
protractor copied to clipboard

appium?

Open laurelnaiad opened this issue 12 years ago • 16 comments

Hi,

I'm new to protractor and interested in testing a phonegap/angular app on emulators. From what I've read appium can drive the emulators and exposes itself via Webdriver JSON protocol. Does that mean I should be able to use protractor with appium to get the job done? I'm not 100% clear on how all of the moving parts would fit together but it seems like I might be able to tell protractor to use an appium server instead of a selenium server? Is this at all true? Any tips or advice? Am I nuts?

laurelnaiad avatar Dec 18 '13 17:12 laurelnaiad

Hm, I haven't looked at appium, but it uses the JSON Wire Protocol which is what Protractor uses, so, yeah, theoretically everything could work. It would be awesome to have an example showing this.

It looks like you'd need to get a URL for whatever server appium starts up at add that to Protractor's config as seleniumAddress. Then you need to set the capabilities in the Protractor config as described here: https://github.com/appium/appium/blob/master/docs/caps.md

I will put this on my to-do list to investigate, but would be happy if someone else takes a look first :)

juliemr avatar Dec 18 '13 20:12 juliemr

Thanks @juliemr . That's pretty much what I hoped to hear. My first goal is to figure out why the android emulators wont start on my machine (: ...if I can make this work I'll certainly share anything I learn.

laurelnaiad avatar Dec 18 '13 21:12 laurelnaiad

i'm using Protractor + Jasmine + Selenium WebdriverJS for automating angularjs application. I was able to configure and setup a sample script with all these tools to run on a desktop computer.

Now I want to run the same scripts on mobile( IOS & Android ) device / emulator.

i'm pretty new to all these tools any Info on this is really helpful.

PraveenJagarlamudi avatar Jan 19 '14 13:01 PraveenJagarlamudi

I've made a bit of progress but am stuck - appium is telling me this: https://github.com/appium/appium/issues/1915#issuecomment-35116751

lukemadera avatar Feb 15 '14 01:02 lukemadera

i am also interested in running our protractor tests on a mobile android device. if anyone has information it would be wonderful if it is shared :)

thank you.

csarnevesht avatar Feb 24 '14 22:02 csarnevesht

Got it working just like @juliemr suggested

cheers

mjvdende avatar Mar 06 '14 10:03 mjvdende

@mjvdende could you elaborate please? We haven't had luck yet so any pointers/specifics would be much appreciated!

lukemadera avatar Mar 06 '14 20:03 lukemadera

any info on this??? would really like to get this working!

csarnevesht avatar Mar 17 '14 22:03 csarnevesht

Hi, I am trying to set up Appium to test my Angularjs app. I have Protractor and Selenium running fine. But I am having issues getting protractor to play with Appium.

The following works if I unwrap the wd and use it directly;

describe('angular homepage', function() {
    it('should have the correct header', function() {
Framework');
        browser.driver.get('http://angularjs.org/');
        expect(browser.driver.getTitle()).toEqual('AngularJS — Superheroic JavaScript MVW Framework');
    });
});

However when I use protractor directly ie. browser.get() and browser.getTitle(); Appium fails with

debug: Sending command to instruments: au.alertIsPresent()
info: [INSTSERVER] Sending command to instruments: au.alertIsPresent()
info: [INSTSERVER] Socket data received (51 bytes)
info: [INSTSERVER] Socket data being routed for 'cmd' event
info: [INSTSERVER] Got result from instruments: {"status":0,"value":false}
info: atom did not return yet, checking to see if we are blocked by an alert
info: Pushing command to appium work queue: "au.alertIsPresent()"Appium 0.17.3

constantly polling until it timesout.

I am using Selenium 2.40 Protractor 0.20.1 Appium 0.17.3 with Xcode 4.6.3 (iPhone sim)

Not sure if I am missing anything but will keep on investigating.

steven2y avatar Mar 20 '14 12:03 steven2y

I am under the impression that we would use appium for testing hybrid apps.... not web sites running on phones. On Mar 20, 2014 5:56 AM, "Steve" [email protected] wrote:

Hi, I am trying to set up Appium to test my Angularjs app. I have Protractor and Selenium running fine. But I am having issues getting protractor to play with Appium.

The following works if I unwrap the wd and use it directly;

describe('angular homepage', function() { it('should have the correct header', function() { Framework'); browser.driver.get('http://angularjs.org/'); expect(browser.driver.getTitle()).toEqual('AngularJS -- Superheroic JavaScript MVW Framework'); }); });

However when I use protractor directly ie. browser.get() and browser.getTitle(); Appium fails with

debug: Sending command to instruments: au.alertIsPresent() info: [INSTSERVER] Sending command to instruments: au.alertIsPresent() info: [INSTSERVER] Socket data received (51 bytes) info: [INSTSERVER] Socket data being routed for 'cmd' event info: [INSTSERVER] Got result from instruments: {"status":0,"value":false} info: atom did not return yet, checking to see if we are blocked by an alert info: Pushing command to appium work queue: "au.alertIsPresent()"Appium 0.17.3

constantly polling until it timesout.

I am using Selenium 2.40 Protractor 0.20.1 Appium 0.17.3 with Xcode 4.6.3 (iPhone sim)

Not sure if I am missing anything but will keep on investigating.

Reply to this email directly or view it on GitHubhttps://github.com/angular/protractor/issues/361#issuecomment-38163056 .

laurelnaiad avatar Mar 20 '14 13:03 laurelnaiad

i was able to get this working with the follow:

protractor.conf:

    seleniumAddress: 'http://localhost:4723/wd/hub'
      capabilities: {
    device: 'iPhone Simulator',
    name: "My Hybrid App",
    platform: 'Mac',
    app: "abs_path_to_my_app/platforms/ios/build/emulator/Hello.app",
    browserName: '',
    newCommandTimeout: 60
  },

Spec:

  beforeEach ()->
    browser.driver.getAllWindowHandles().then((handles) ->
      browser.driver.switchTo().window(handles[0])
      ptor = protractor.getInstance()
    )

mike00ward avatar Mar 25 '14 17:03 mike00ward

I'm going to use https://github.com/angular/protractor/issues/697 as a master issue for protractor mobile support

Instructions on how to set up protractor to test Chrome on Appium are here: https://github.com/angular/protractor/blob/master/docs/browser-setup.md#how-to-set-up-protractor-with-appium

hankduan avatar Apr 24 '14 23:04 hankduan

Not sure if this belongs on #697 or here but this is my config for testing my app on Mobile Safari via Appium.

{
    capabilities: {
        name: 'iOS 7 - iPad',
        browserName: 'iPad',
        app: 'safari',
        deviceName: 'iPad Simulator',
        version: '7.1',
        'device-orientation': 'landscape',
        nonSyntheticWebClick: false,
        tags: ['ios'],
        build: process.env.BUILD_TAG
    },
    allScriptsTimeout: 30000,
    seleniumAddress: 'http://localhost:4723/wd/hub',

    specs: [
        './**/*.spec.js'
    ]
}

Note that Appium is releasing a v1 soon (May 2nd I think) and there are (at least) a couple of changes. nonSyntheticWebClick is being renamed to nativeWebTap and will default to false, so you should be able to omit that line with the new version. Also, there seem to be some changes coming to property names in the capabilities object.

bclinkinbeard avatar Apr 25 '14 02:04 bclinkinbeard

Hello! is there any update on this?? I'm really looking fw to try to test against web-mobile... but I'm keep getting Async Callbacks for safari and Error while running testForAngular: This is feature will be implemented soon! for android Also, I've tried to look at what @juliemr suggested on her first post, but I'm getting a 404. https://github.com/appium/appium/blob/master/docs/caps.md

Was anyone been successful on this?

Thanks

bmsoko avatar Jun 10 '15 14:06 bmsoko

@PraveenJagarlamudi can you share your project? or how where you able to configure it? It'll be much appreciated!!!!

Thanks

bmsoko avatar Jun 10 '15 18:06 bmsoko

@bmsoko I was able to test against mobile web by making these changes to the configuration file.

  1. seleniumAddress: 'http://127.0.0.1:4723/wd/hub', ( by default appium server listens to 4723 port)
  2. capabilities: { 'browserName' : 'chrome', 'deviceName' : 'Android Emulator' }

PraveenJagarlamudi avatar Jun 17 '15 17:06 PraveenJagarlamudi