seleniumkit / gridrouter

Selenium-based solution to serve 1000+ browsers
Other
152 stars 36 forks source link

Unable perform on android or iOS Device #38

Open pranavv opened 7 years ago

pranavv commented 7 years ago

sample

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

innokenty commented 7 years ago

What do you do and what does it say?

vania-pooh commented 7 years ago

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

aandryashin commented 7 years ago

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 : > @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 > , > or mute the thread > > . >
pranavv commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 notifications@github.com:

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 .

pranavv commented 7 years ago

@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 commented 7 years ago

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 aandryashin@gmail.com:

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 notifications@github.com:

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 .

pranavv commented 7 years ago

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

aandryashin commented 7 years ago

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 aandryashin@gmail.com:

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 aandryashin@gmail.com:

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 notifications@github.com :

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 .

pranavv commented 7 years ago

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 commented 7 years ago

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

vania-pooh commented 7 years ago

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