Running appium in saucelabs cloud devices changing public ip for country specific applications testing

huangapple go评论71阅读模式
英文:

Running appium in saucelabs cloud devices changing public ip for country specific applications testing

问题

我在 SauceLabs 的 Android 设备上成功运行了自动化测试(我们还没有尝试 iOS 设备的测试),但我们的测试失败了,因为我们的应用程序仅在发出请求的设备的 IP 地址(在后台 API 中)是来自我们的国家阿根廷时才能正常工作,因为我们提供的服务只在这个国家生效。然而,SauceLabs 的设备位于欧洲。

目前,我尝试通过 Appium 将设备位置更改为阿根廷的 GPS 坐标,但我们的应用程序并不关心这一点,它只关注请求的公共 IP 地址。

因此,问题是是否有任何方法可以将设备的公共 IP 指向阿根廷的 IP,以便测试成功运行。也许是一种 Appium 的能力(但我没有看到类似的能力),或者是一些 SauceLabs 特定的功能可以实现这一点。

提前感谢!

英文:

im running our automated tests successfully in saucelabs android devices (we are yet to try our iOS device tests), but our tests are failing because our application only works if the ip address of the device that made the request (in the background api) is from our country, Argentina, because the service we provide only works in this country, but, SauceLabs devices are located in europe.

Currently i tried to change the device location with appium, to the gps coordinates from argentina, but our application don't care about it, only the public ip address of the request.

So the question is if there is any way that i can point the public ip of the device to an argentinian one, so that the tests run successfully. Maybe a appium capability of some sort, (but i didn't see any like that) or some souceLabs specific feature to do that maybe.

Thanks in advance!

答案1

得分: 1

没有Appium或Sauce的能力可以实现这一点。实际上,由于听起来后台API是检查IP地址的组件,我甚至不确定它是否可以自动处理;无法更改IP地址的地理位置。

您可以通过使用Sauce Connect使流量看起来来自另一个地址。通过在阿根廷启动它并在测试中使用它,您的流量将看起来来自您运行客户端的位置。

要在真实设备上使用Sauce Connect,您需要使用新的真实设备平台(例如,不使用旧的TestObject接口)。您可以在这里阅读有关Sauce与真实设备的更多信息:https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy+Setup+for+Real+Device+Cloud

英文:

There's no Appium or Sauce capability to achieve this. In fact, since it sounds like the Background API is the component responsible for checking the IP address, I'm not sure it even could be addressed automatically; you can't change an IP address' geo-location.

What you could do is make traffic appear to originate from another address using
Sauce Connect. By starting that in Argentina and using it in your tests, your traffic will appear to originate from the location you run the client.

To use Sauce Connect with Real Devices, you'll need to making use of the new Real Device platform (eg, not the old TestObject interface). You can read more about Sauce with Real Devices here: https://wiki.saucelabs.com/display/DOCS/Sauce+Connect+Proxy+Setup+for+Real+Device+Cloud

huangapple
  • 本文由 发表于 2020年10月5日 20:42:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/64208828.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定