AppiumTestDistribution / appium-device-farm

This is an Appium 2.0 plugin designed to manage and create driver sessions on available devices.
https://devicefarm.org
Other
335 stars 102 forks source link

Execution happens on different device other then passed udid ( Always picks the first from the list ) #591

Closed samagarw closed 1 year ago

samagarw commented 1 year ago

Added 5 android devices .

[debug] [ADB] Connected devices: [{"udid":"2a39334b40047ece","state":"device"},{"udid":"R5CT30YNCSN","state":"device"},{"udid":"R5CT3286HHV","state":"device"},{"udid":"RZ8N92KNEGY","state":"device"},{"udid":"hibejbv84hztdq6h","state":"device"}] [device-farm] Android Device details for 2a39334b40047ece already available [device-farm] Android Device details for R5CT30YNCSN already available [device-farm] Android Device details for R5CT3286HHV already available [device-farm] Android Device details for RZ8N92KNEGY already available [device-farm] Android Device details for hibejbv84hztdq6h already available

Creating a webdriver with following capabilities :

{acceptSslCert: false, appium:automationName: UIAutomator2, appium:build: Smoke..., appium:build_id: Smoke..., appium:deviceAvailabilityTimeout: 1800, appium:deviceRetryInterval: 100, appium:name: Samsung Galaxy A21s - OSv10, appium:project_id: Samsung Galaxy A21s - OSv10, appium:udid: RZ8N92KNEGY, appium:uiautomator2ServerInstallTimeout: 50000, browserName: chrome, build_id: Smoke..., clearSystemFiles: true, dashboard:name: Samsung Galaxy..., deviceName: RZ8N92KNEGY, goog:chromeOptions: {args: [], extensions: []}, javascriptEnabled: true, name: Check, networkConnectionEnabled: true, newCommandTimeout: 9999, platform: ANDROID, platformName: Android, project: Check, project_id: Samsung Galaxy A21s - OSv10, udid: RZ8N92KNEGY, w3c: false, wdaStartupRetryInterval: 20000}

But still the execution happens on : 2a39334b40047ece device udid .

This was working fine in selenium grid but in device farm it is always picking the same device .

Attaching snapshot while executing .

Is the first device getting locked always from the list . Do we need to pass any other capabilities .

Screenshot 2022-12-23 at 5 42 44 PM
samagarw commented 1 year ago

Attaching devices in device farm :

Screenshot 2022-12-23 at 5 50 54 PM
saikrishna321 commented 1 year ago

@samagarw Plugin would pick the first available device. What is your intention here?? Can you show your capabilities ?

samagarw commented 1 year ago

@saikrishna321 : I want to run it on different devices based on udid . Why it is always picking the first device even if the udid doesn't match ? This is wrong implementation .

Based on capabilities it should pick the device .

I am passing udid as x and it it running on y because y is listed and is available first . Then what is the use of capabilities

Intention is to run on different devices based on udid or other capability . I want to test certain tests on 1 device and some on other .

Capabilities : {acceptSslCert: false, appium:automationName: UIAutomator2, appium:build: Smoke..., appium:build_id: Smoke..., appium:deviceAvailabilityTimeout: 1800, appium:deviceRetryInterval: 100, appium:name: Samsung Galaxy A21s - OSv10, appium:project_id: Samsung Galaxy A21s - OSv10, appium:udid: RZ8N92KNEGY, appium:uiautomator2ServerInstallTimeout: 50000, browserName: chrome, build_id: Smoke..., clearSystemFiles: true, dashboard:name: Samsung Galaxy..., deviceName: RZ8N92KNEGY, goog:chromeOptions: {args: [], extensions: []}, javascriptEnabled: true, name: Check, networkConnectionEnabled: true, newCommandTimeout: 9999, platform: ANDROID, platformName: Android, project: Check, project_id: Samsung Galaxy A21s - OSv10, udid: RZ8N92KNEGY, w3c: false, wdaStartupRetryInterval: 20000}

saikrishna321 commented 1 year ago

@samagarw Can you try adding the capability 'appium:udids': 'RZ8N92KNEGY',

samagarw commented 1 year ago

Yes i don't know about this capability . Added and it worked . Can you also share the list of capabilities supported ? So that i can use them next time instead of raising any issues ?

Thank you for all the support though .

saikrishna321 commented 1 year ago

@samagarw Here is the doc - https://github.com/AppiumTestDistribution/appium-device-farm#capabilities