gridrouter icon indicating copy to clipboard operation
gridrouter copied to clipboard

Unable perform on android or iOS Device

Open pranavv opened this issue 8 years ago • 14 comments
trafficstars

sample

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

pranavv avatar Nov 28 '16 11:11 pranavv

What do you do and what does it say?

innokenty avatar Nov 28 '16 12:11 innokenty

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

vania-pooh avatar Nov 28 '16 17:11 vania-pooh

Hello, Pranav!

Browser name attribute should be exact the same as it comes in capabilities, so for Android devices browser name should be lowercase android like the following:

For iOS devices please try to specify device as browser name:

iPhone or iPad

Please, correct your browsers.xml and see if it helps.

Alexander Andryashin.

2016-11-28 20:39 GMT+03:00 Ivan Krutov [email protected]:

@pranavv https://github.com/pranavv your file seems to be correct. Please clarify error details.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/seleniumkit/gridrouter/issues/38#issuecomment-263339069, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWNbRRHQ93E1VVYZPwZhWghhrX6iygRks5rCxHZgaJpZM4K9s6W .

aandryashin avatar Nov 28 '16 18:11 aandryashin

@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:[email protected]: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:[email protected]: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 avatar Nov 29 '16 04:11 pranavv

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 avatar Nov 29 '16 04:11 pranavv

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

pranavv avatar Nov 29 '16 05:11 pranavv

Grid router uses browser name and version, just to determine host where to proxy request, rest of work is doing by selenium, appium, android emulator or webdriver.

As I can see, three different, incompatible browsers are configured on the same host: 192.168.20.10. Please clarify configuration of that host, is there selenium server running, appium or android emulator? It is possible to run all those apps on single host, but on different ports, if so, you have to correct port numbers in your browser.xml to point to appropriate application.

Alexander Andryashin.

2016-11-29 7:08 GMT+03:00 Pranav Venkatachalam [email protected]:

i believe selenography or grid router can do automation on native app , since you check for browser name field in desired capabilities, but for native app automation we don't specify browser name generally .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/seleniumkit/gridrouter/issues/38#issuecomment-263471061, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWNbVLTCqs-YR051Kx3UWElcorLgYVHks5rC6VGgaJpZM4K9s6W .

aandryashin avatar Nov 29 '16 05:11 aandryashin

@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

pranavv avatar Nov 29 '16 05:11 pranavv

Pranav,

Grid routed does not start browser it just point to host where the browser can be started. I do not know how appium handles requests In case of multiple different coises available. Please try to launch appium standalone without selenium hub and point to it in browsers.xml.

Alexander Andryashin.

2016-11-29 8:34 GMT+03:00 Alexander Andryashin [email protected]:

Grid router uses browser name and version, just to determine host where to proxy request, rest of work is doing by selenium, appium, android emulator or webdriver.

As I can see, three different, incompatible browsers are configured on the same host: 192.168.20.10. Please clarify configuration of that host, is there selenium server running, appium or android emulator? It is possible to run all those apps on single host, but on different ports, if so, you have to correct port numbers in your browser.xml to point to appropriate application.

Alexander Andryashin.

2016-11-29 7:08 GMT+03:00 Pranav Venkatachalam [email protected]:

i believe selenography or grid router can do automation on native app , since you check for browser name field in desired capabilities, but for native app automation we don't specify browser name generally .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/seleniumkit/gridrouter/issues/38#issuecomment-263471061, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWNbVLTCqs-YR051Kx3UWElcorLgYVHks5rC6VGgaJpZM4K9s6W .

aandryashin avatar Nov 29 '16 05:11 aandryashin

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

pranavv avatar Nov 29 '16 05:11 pranavv

Ok, I see. Try appium without selenium hub, I beleve it should not trying to start safari.

2016-11-29 8:42 GMT+03:00 Alexander Andryashin [email protected]:

Pranav,

Grid routed does not start browser it just point to host where the browser can be started. I do not know how appium handles requests In case of multiple different coises available. Please try to launch appium standalone without selenium hub and point to it in browsers.xml.

Alexander Andryashin.

2016-11-29 8:34 GMT+03:00 Alexander Andryashin [email protected]:

Grid router uses browser name and version, just to determine host where to proxy request, rest of work is doing by selenium, appium, android emulator or webdriver.

As I can see, three different, incompatible browsers are configured on the same host: 192.168.20.10. Please clarify configuration of that host, is there selenium server running, appium or android emulator? It is possible to run all those apps on single host, but on different ports, if so, you have to correct port numbers in your browser.xml to point to appropriate application.

Alexander Andryashin.

2016-11-29 7:08 GMT+03:00 Pranav Venkatachalam [email protected] :

i believe selenography or grid router can do automation on native app , since you check for browser name field in desired capabilities, but for native app automation we don't specify browser name generally .

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/seleniumkit/gridrouter/issues/38#issuecomment-263471061, or mute the thread https://github.com/notifications/unsubscribe-auth/ABWNbVLTCqs-YR051Kx3UWElcorLgYVHks5rC6VGgaJpZM4K9s6W .

aandryashin avatar Nov 29 '16 05:11 aandryashin

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 avatar Nov 29 '16 06:11 pranavv

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

pranavv avatar Nov 29 '16 06:11 pranavv

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

vania-pooh avatar Nov 29 '16 08:11 vania-pooh