Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable perform on android or iOS Device #38

Open
pranavv opened this issue Nov 28, 2016 · 14 comments
Open

Unable perform on android or iOS Device #38

pranavv opened this issue Nov 28, 2016 · 14 comments

Comments

@pranavv
Copy link

pranavv commented Nov 28, 2016

sample

i am not able to reach the iOS and android device , can you please check the capability

@innokenty
Copy link
Member

What do you do and what does it say?

@vania-pooh
Copy link
Member

@pranavv your file seems to be correct. Please clarify error details.

@aandryashin
Copy link
Contributor

aandryashin commented Nov 28, 2016 via email

@pranavv
Copy link
Author

pranavv commented Nov 29, 2016

@aandryashin @innokenty @vania-pooh

I am trying to native app automation.

File app = new File("/Volumes/Installers/UIKitCatalog.ipa");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("automationName", "XCUITest");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone");
capabilities.setCapability(MobileCapabilityType.VERSION, "10.0.1");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
capabilities.setCapability("sendKeyStrategy","setValue");
capabilities.setCapability("--no-reset", false);
capabilities.setCapability("app", app.getAbsolutePath());
URL url= new URL("http://test:test@192.168.20.5:4444/wd/hub");

Here i get an error saying unable to find any capabilities matching type null10.0.1 Webdriver exception ,
thereby i am unable to perform automation on my native apps with the desired capabilities.

if i try as you said with the following desired capabilities

File app = new File("/Volumes/Installers/UIKitCatalog.ipa");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("automationName", "XCUITest");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone");
capabilities.setCapability("browserName", "iPhone");
capabilities.setCapability(MobileCapabilityType.VERSION, "10.0.1");
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
capabilities.setCapability("sendKeyStrategy","setValue");
capabilities.setCapability("--no-reset", false);
capabilities.setCapability("app", app.getAbsolutePath());
URL url= new URL("http://test:test@192.168.20.5:4444/wd/hub");

it tries to do automation with safari rather than native app ,

my user quota xml i have mentioned browser name as iPhone for native app testing and another iPhone i have mentioned as safari .

Thanks

@pranavv
Copy link
Author

pranavv commented Nov 29, 2016

i believe selenograph or grid router cannot do automation on native app , since you check for browser name field in desired capabilities in the test case , but for native app automation we don't specify browser name generally it happens via platform name field alone.

@pranavv
Copy link
Author

pranavv commented Nov 29, 2016

https://github.com/seleniumkit/gridrouter/blob/e13ca5ecd3fda68f4e4c318a866f7a871107d548/proxy/src/main/resources/xsd/json.xsd here see you have configured json.xsd to contain browserName and version , but when browser name of iPhone goes to hub and then to appium node it starts safari in device, instead of launching the app , json.xsd should be either platforname in case of browserName unavailability

@aandryashin
Copy link
Contributor

aandryashin commented Nov 29, 2016 via email

@pranavv
Copy link
Author

pranavv commented Nov 29, 2016

@aandryashin , if i point it directly do hub , it works without browser name & with platform name , if route it through grid router it does not , because grid router sends it null in place of browser name and on seeing the browser key in json with iPhone or iOS appium automatically tries launching browser i.e safari . instead of launching native app

8080 is my hub it redirects to respective node with different port numbers

@aandryashin
Copy link
Contributor

aandryashin commented Nov 29, 2016 via email

@pranavv
Copy link
Author

pranavv commented Nov 29, 2016

@aandryashin :- i know grid router is just a proxy , tried that it does not work as it seems

@aandryashin
Copy link
Contributor

aandryashin commented Nov 29, 2016 via email

@pranavv
Copy link
Author

pranavv commented Nov 29, 2016

tried direct node , it still starts safari , i believe appium checks for browserName key in JSon caps and automatically starts safari irrespective of native or web

@pranavv
Copy link
Author

pranavv commented Nov 29, 2016

so browser name key in json caps should be absent to enable appium to run native app

@vania-pooh
Copy link
Member

@pranavv btw, do you know that Appium 1.5+ requires empty browser name for some iOS devices? Otherwise they throw an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants