How to set fake GPS location in Appium - selenium

I saw that there is the method to set the Location driver.setLocation(Location);
But which driver do I need for this?
And is this usable for Android and iOS?

For emulators or simulators, which are the easiest to configure, use the following capabilities.
Android
gpsEnabled: true
iOS
locationServicesEnabled: true
locationServicesAuthorized: true
It is required to provide the bundleId capability for the latter to work.
For real devices, things are more tricky. In Android you should be able to enable mock locations in the Developer Settings, however, I haven't been able to put it to work using Appium setLocation method. This question invoking Appium settings app through adb might help you in that regard: https://android.stackexchange.com/questions/35716/is-it-possible-to-set-devices-latitude-and-longitude-using-adb-shell.
Finally, for iOS, you can use a run configuration with a fake location from XCode, but I haven't found any method to programatically run the app with a fake location from an Appium automation.

Related

ios appium automation queries

Can we perform automation on preinstalled app like Facebook on ios real device using appium without having ipa/app file?
Can we perform automation on real ios device without having developer team id for a ios app for which we have ipa/app file?
Yes, you can specify the app bundleId in the desired capabilities and attach Appium to the pre-installed application.
No. You need to build and sign the appium-webdriveragent app with your developer certificate to be able to install it on the real iOS device.
Yes you can automate pre installed apps in your phone. But make sure following configurations are already done:
"noReset" capability should be set to true. It won't install your app on every run.
You will need apple developer account if you want to automate it on Real Device. If you are running on simulator, developer account is not needed.

How to test mobile apps on different devices

I want to test my IOS,Android and hybrid apps on various virtual devices. Please suggest me a good tool that can perform these functions.
We currently use Genymotion for testing with Android and XCode's simulator for iOS. These will allow you test a wide range of iOS/Android devices.
If you are looking for one tool to test both iOS and Android I believe Visual Studio's Xamarin supports both, there is also a browser based solution with appetize.io. I haven't used either of those so can't comment on if they are any good.
You can make use of chrome developer toolbar it has most of the device options like device horizontal/Vertical, Zoom
You get the different versions along with the different screen sizes in the simulator which you are working.
Eg: IOS(xcode) when you build it you get which version to build when running the application. Same for Android and hybrid apps

"Searching for devices..." when I try to run a new nativescript-vue project?

I create a nativescript-vue project which following the official start guide here
But when I try to start and preview it on the browser...Nothing I can get from the terminal except "Searching for devices..."
I'm new to it, can someone give me some help on it?
nativescript-vue is searching for a mobile devices connected to your environment (or emulators). Nothing will happen in the browser as this is a mobile development framework. To test it attach a real mobile device (Android or iOS but for iOS, you will need MAC and provision profiles & certificates) or create an emulator/simulator and give it a go.

Automate iOS application with amCharts element using Appium or Perfecto

Is it possible to automate iOS native application with amCharts elements using Appium or Perfecto ? [Sample amChart]
Perfecto is just mobile device cloud provider, where you can use Appium: so does not affect the possibility.
It may be tricky to parse amCharts for Appium just as it may be tricky to do so for XCUITest (that Appium use for iOS interactions). Since its Objective C wrapper chances are pretty good, but still you will be able to get only numbers and element position in best case.
I suggest to install appium-desktop, start session with your app and make screen snapshot. If appium won't parse it, you may try do it directly in XCode with XCUITest and maybe you need to add some attributes for parsing via Appium

Calabash Automation Testing

I am new in Automating the apps for testing Android and i like to advance to this level... I have researched for Appium and Calabash... but knowing the difference pretty complicated.. There are my questions:
1: For Calabash, do we need the source code, i mean can i have APK and give test cases and so on? or do I NEED the source code even if im using the elements from app?
2: I heard i can use the Appium with cucumber, and same question do i need source code for that?
I have researched about it and all i get is for Apple apps... but nothing much for android...
You don't need source code. All you need is apk file, packageName and ActivityName to launch the app.
In Appium framework, all you need is app file (for android it will be simply .apk file).
Source code will be never needed, all elements from UI that you would like to interact with, can be simply get from Appium Inspector.
For both calabash and Appium you don't need to source code. you can automate application using apk file.
Yes you can use Appium with cucumber.
To find object locators of application use calabash console and Android UI Viewer, Appium GUI.