Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Testing on Mobile Devices with Location Services

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Wird geladen in …3
×

Hier ansehen

1 von 57 Anzeige

Testing on Mobile Devices with Location Services

Herunterladen, um offline zu lesen

During this webinar we look into location services on Android and iOS real devices, as well as emulators and simulators.

We provide you with tips and tricks on when to change the mobile Geo-IP and when to change the mobile GPS, how to use ADB commands to enable the device location, and how to handle the location services permission alerts. We also discuss Appium capabilities for Location Services, using GeoLocation with Appium Desktop, and more.

Key takeaways:
- Understand what Location Services are
- Understand GPS compare to Geo-IP
- Know the Appium commands for Location Services
- The differences in the use of Location Services between Android and iOS
- Learn how to automate tests that involve Location Services

During this webinar we look into location services on Android and iOS real devices, as well as emulators and simulators.

We provide you with tips and tricks on when to change the mobile Geo-IP and when to change the mobile GPS, how to use ADB commands to enable the device location, and how to handle the location services permission alerts. We also discuss Appium capabilities for Location Services, using GeoLocation with Appium Desktop, and more.

Key takeaways:
- Understand what Location Services are
- Understand GPS compare to Geo-IP
- Know the Appium commands for Location Services
- The differences in the use of Location Services between Android and iOS
- Learn how to automate tests that involve Location Services

Anzeige
Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Ähnlich wie Testing on Mobile Devices with Location Services (20)

Anzeige

Weitere von Sauce Labs (20)

Aktuellste (20)

Anzeige

Testing on Mobile Devices with Location Services

  1. 1. Testing on Mobile Devices with Location Services Eyal Yovel, Solutions Architect April, 2021
  2. 2. About me 2 ○ Solutions Architect at Sauce Labs, based in London, UK ○ I have over 15 years of experience in software development and software automation ○ I have a passion for learning new technologies and new test frameworks Eyal Yovel @eyalyovel https://github.com/eyaly
  3. 3. Agenda 3 ○ Introduction ○ Changing geo location manually ○ Changing geo location using Appium Desktop ○ Automate end-to-end user flow with location services - iOS ○ Automate e2e user flow with location services – Android ○ Automate e2e user flow with location services – Execution ○ Automate e2e user flow with location services – Web App ○ About Geo-IP
  4. 4. © Sauce Labs, Inc. 4 What Why Location Services
  5. 5. © Sauce Labs, Inc. 5
  6. 6. © Sauce Labs, Inc. 6 GPS receiver GPS satellites Assisted GPS How does GPS work on my phone?
  7. 7. 7 How does GPS work on my phone? Latitude Longitude Altitude
  8. 8. 8 Latitude and Longitude
  9. 9. 9 Latitude and Longitude Latitude - Imaginary lines that measure distance north and south of the equator Longitude - Imaginary lines that measure distance east and west of the prime meridian Altitude - How high a location is above sea level
  10. 10. 10 Latitude and Longitude
  11. 11. 11 Changing Geo Location Manually
  12. 12. 12 Changing Geo Location - iOS Simulator
  13. 13. 13 Changing Geo Location - Android Emulator
  14. 14. 14 Changing Geo Location - Sauce Labs Real devices
  15. 15. 15 Set/Get Geo Location - Appium Commands
  16. 16. 16 Set Geo Location - Appium Command
  17. 17. 17 Get Geo Location - Appium Command
  18. 18. 18 Demo App https://github.com/saucelabs/sample-app-mobile/releases
  19. 19. 19 Set/Get Geo Location - Appium Commands -Demo
  20. 20. 20 End to End User Flow with Location Services - iOS Preparation Permission Alert Test the page
  21. 21. 21 End to End User Flow with Location Services - iOS
  22. 22. 22 End to End User Flow with Location Services - iOS https://github.com/eyaly/testng-geo-location-examples
  23. 23. 23 End to End User Flow with Location Services - iOS https://github.com/eyaly/testng-geo-location-examples
  24. 24. 24 End to End User Flow with Location Services - iOS https://github.com/eyaly/testng-geo-location-examples
  25. 25. 25 End to End User Flow with Location Services - iOS https://github.com/eyaly/testng-geo-location-examples
  26. 26. 26 End to End User Flow with Location Services - iOS
  27. 27. 27 End to End User Flow with Location Services - iOS
  28. 28. 28 End to End User Flow with Location Services - iOS iOS >= 13 iOS =< 12
  29. 29. 29 End to End User Flow with Location Services - iOS https://appium.io/docs/en/writing-running-appium/caps/ // this capability will work for alerts with 2 options (iOS 12 and below) capabilities.setCapability("autoAcceptAlerts", true);
  30. 30. 30 End to End User Flow with Location Services - iOS https://github.com/appium/appium-xcuitest-driver#settings-api // change the setting to accept alerts with 3 options // and select the "Allow While Using App" (iOS 13 and above) getiosDriver().setSetting("acceptAlertButtonSelector", "**/XCUIElementTypeButton[`label == "Allow While Using App"`]");
  31. 31. 34 End to End User Flow with Location Services - iOS
  32. 32. 35 End to End User Flow with Location Services - iOS https://github.com/eyaly/testng-geo-location-examples
  33. 33. 36 End to End User Flow with Location Services - Android Preparation Permission Alert Test the page
  34. 34. 37 End to End User Flow with Location Services - Android For API level 29 (Android 10) and above: Enable: adb shell settings put secure location_mode 3 Disable: adb shell settings put secure location_mode 0 For API level 28 (Android 9) and below: Enable: adb shell settings put secure location_providers_allowed +gps Disable: adb shell settings put secure location_providers_allowed -gps
  35. 35. 38 End to End User Flow with Location Services - Android
  36. 36. 39 End to End User Flow with Location Services - Android
  37. 37. 40 End to End User Flow with Location Services - Android Android >= 10 Android =< 9
  38. 38. 41 End to End User Flow with Location Services - Android https://appium.io/docs/en/writing-running-appium/caps/ // Grant permission for alert popups capabilities.setCapability("autoGrantPermissions", true);
  39. 39. 42 End to End User Flow with Location Services - Android // Grant permission for alert popups capabilities.setCapability("autoGrantPermissions", true);
  40. 40. 43 End to End User Flow with Location Services - Android // Grant permission for alert popups capabilities.setCapability("autoGrantPermissions", true);
  41. 41. 45 End to End User Flow with Location Services - Execution
  42. 42. 46 End to End User Flow with Location Services - Execution
  43. 43. 47 End to End User Flow with Location Services - Execution
  44. 44. 48 And what about Web Apps…?
  45. 45. 49 And what about Web Apps…?
  46. 46. 50 End to End User Flow with Location Services - Web
  47. 47. 51 End to End User Flow with Location Services - Web
  48. 48. 52 End to End User Flow with Location Services - Web
  49. 49. 53 End to End User Flow with Location Services - Web https://github.com/eyaly/testng-geo-location-examples
  50. 50. 54 Let’s talk about something new…
  51. 51. 55 Let’s talk about something new…
  52. 52. 56 Let’s talk about Geo-IP GeoIP refersto the method oflocating a computer terminal’s geographic location by identifying that terminal’s IP address. (https://help.nexcess.net/77285-other/what-is-geoip) An IP address is assigned to each device (e.g. computer, printer) participating in a computer network that uses the Internet Protocol for communication (https://en.wikipedia.org/wiki/Internet_geolocation)
  53. 53. 57 How to change my Geo-IP - Use VPN (Virtual Private Network) services - VPN Provider: WonderProxy (https://wonderproxy.com/) - Use WonderProxy to change the Geolocation of your test traffic Sauce: https://wonderproxy.com/docs/devs/guides/globalize-your-testing-with-sauce https://wiki.saucelabs.com/pages/viewpage.action?pageId=48365781
  54. 54. 58 How to Test from different countries - Use Sauce Connect (tunnel) + WonderProxy
  55. 55. 59 How to Test from different countries
  56. 56. Q&A Q&A
  57. 57. Let’s do this.

×