-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Does Protractor + Appium works for Native or Hybrid apps #1798
Comments
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 #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. |
@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, Hope this works. |
Hi, |
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:
Thanks! |
Thanks @wswebcreation |
@wswebcreation is protractor still not supporting for Native App automation? |
True, no native support |
Hi, |
@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. |
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"] |
Hi @kommuswamy That means like mine, you have multiple contexts in your app like Native & WebView or multiple WebViews. You need to switch to the particular WebView where your elements are present. To switch to a particular WebView, you need to install wd and wd-bridge. You can use npm to install those. Once you install wd and wd-bridge. Add the below changes in your config and spec file. I tried this approach and the error of no such context found was resolved. Config file : Spec file : |
Hi @ssudhanshu , |
HI @wswebcreation, my app start with two contexts native and webview. is it possible to automate with the protractor? |
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
The text was updated successfully, but these errors were encountered: