Does Protractor + Appium works for Native or Hybrid apps
Was able to develop and execute Protractor successfully for web apps on desktop as well as Android. but faced issues with Native / Hybrid apps (based on PhoneGap).
Configuartion file:-
conf_mobile.js exports.config = { seleniumAddress: 'http://localhost:4723/wd/hub',
specs: ['example_spec_mobile.js'],
// Reference: https://github.com/appium/sample-code/blob/master/sample-code/examples/node/helpers/caps.js capabilities: { browserName: '', 'appium-version': '1.0', platformName: 'Android', platformVersion: '4.4.2', deviceName: 'Android Emulator', app: 'path to APK file' },
allScriptsTimeout: 60000 };
Specification File:- describe('homepage', function() { it('validate service url', function() { element(by.id('com.test.testApp:id/clearable_edit')).sendKeys('URL to type in text field'); element(by.id('com.test.testApp:id/serviceUrlButton')).click(); }); });
Error logs:- D:\nodejs\node_modules\protractor\example>protractor conf_mobile.js Using the selenium server at http://localhost:4723/wd/hub [launcher] Running 1 instances of WebDriver
D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:113 var template = new Error(this.message); ^ UnknownError: Not yet implemented. Please help us: http://appium.io/get-involved.html at new bot.Error (D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\error.js:113:18) at Object.bot.response.checkResponse (D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\atoms\response.js:106:9) at D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:362:20 at D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\goog\base.js:1582:15 at [object Object].webdriver.promise.ControlFlow.runInNewFrame_ (D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js: 1654:20) at notify (D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:465:12) at notifyAll (D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:442:7) at resolve (D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:420:7) at [object Object].fulfill (D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:535:5) at D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\promise.js:1520:10 ==== async task ==== WebDriver.manage().timeouts().setScriptTimeout(60000) at webdriver.WebDriver.schedule (D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:345:15) at webdriver.WebDriver.Timeouts.setScriptTimeout (D:\nodejs\node_modules\protractor\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:1301:23) at Runner.createBrowser (D:\nodejs\node_modules\protractor\lib\runner.js:180:30) at D:\nodejs\node_modules\protractor\lib\runner.js:259:24 at _fulfilled (D:\nodejs\node_modules\protractor\node_modules\q\q.js:797:54) at self.promiseDispatch.done (D:\nodejs\node_modules\protractor\node_modules\q\q.js:826:30) at Promise.promise.promiseDispatch (D:\nodejs\node_modules\protractor\node_modules\q\q.js:759:13) at D:\nodejs\node_modules\protractor\node_modules\q\q.js:525:49 at flush (D:\nodejs\node_modules\protractor\node_modules\q\q.js:108:17) [launcher] Process exited with error code 1
Any update, as we need to take the decision on what choice of language / tool to use. With Java Client libraries it is do able to automate Native Apps (Selenium WebDriver + TestNG + Appium), but does not seems to be working with protractor.
Nope, as said, it is not yet implemented. We have a team TODO for this.
Thanks for your response.
Can you also let us know what is the ETA to bring in support for Native / Hybrid apps?
Testability for hybrid apps running in WebViews is somehow critical and - at least for me - a show-stopper, if not possible. So it is good to read that there is a team TODO for this. Unfortunately an existing TODO does not mean that it will be implemented soon - that's why i would be very happy if a rough statement about the plans on implementing this appears :)
See https://github.com/angular/protractor/issues/1940
Hi juliemr..may i know when is the release date for using protractor for hybrid apps runs in webview..in our project we need to finalize the tool.
Please your help: http://stackoverflow.com/questions/30480452/cant-run-test-script-by-appium-on-node-js
@idaneliz Please have a look on you'r question at stackoverflow.
@nainighai how did you setup to be able to test against Android using protractor? can you please share what you've done?
Thanks
hi all, when ever you are trying to run an apk file directly in to the device and run the test cases through protractor , check that apk you generated should be either in dev or debug stage not in release. Was facing the same issue and resolved it by changing it to either dev or debug stage./
Hope this works.
Hi, I am trying to run Protractor tests by launching a Hybrid app on a mobile emulator. My app is getting launched but then it is getting closed with the error message: 'WebDriverError: No such context found'. I have already included autoWebview: 'true' in my conf.js file Any solution on this would be really helpful.
@ssudhanshu
Your question is better suited for StackOverflow or Gitter. Please ask a question there with the 'protractor' tag or post in the Gitter Channel to get help.
From the the getting help section of the README:
Please ask usage and debugging questions on StackOverflow (use the "protractor" tag) or in the Angular discussion group. (Please do not ask support questions here on Github.)
Thanks!
Thanks @wswebcreation
@wswebcreation is protractor still not supporting for Native App automation?
@babusurendra
True, no native support
Hi, I am trying to run Protractor tests by launching a Hybrid app on a mobile emulator. My app is getting launched but then it is getting closed with the error message: 'ERROR - Unable to start a WebDriver session.' Any solution on this would be really helpful.
@wswebcreation, Please let me know if it is possible to test Hybrid mobile app (not a web app) using Protractor + Appium.
Hi @kommuswamy
It is possible, only when your hybrid app starts with a Webview. The error you describe is a configuration error. SO or Google can help you with that.
Hi @kommuswamy
I was also facing the same issue. Generally, that WebDriver session issue comes when you have a WebView in your app and you have not switched to it. Hybrid apps contain WebViews. You need to switch to them in order to work on it.
Try adding below lines to your config file:
autoWebview: 'true',
autoWebviewTimeout: '10000',
Hi @ssudhanshu, I am facing same error which you mentioned above "No such context found." after adding the autoWebview: 'true', in my conf.js file. I am seeing the following context are available when I ran the script Available contexts: ["NATIVE_APP","WEBVIEW_com.****.mobile.prod"] did you file any request in StackOverflow or gitter?