Automation testing on OS level - ios

I am working on an iOS application in which automation testing will be done on OS level( can open any application through script). I have searched a lot, all I found is we are allowed to automate the test script within our own application only. Okay, My question is How the EggPlant is able to automate the test on OS level( can open contacts, phone application through scripts)?
Note: This will be an in-House enterprise application and not destined for apple app store.

Mobile test automation tools use vendor provided APIs to interact with operating system. For iOS it's UI Automation.

You can only automate what is within the binary of your application. For instance, if your app uses a web view you can access the internet, but you cannot exit your application from the automation test and open Safari. EggPlant doesn't operate based on the binary of your application, it "looks" at the screen and executes gestures or processes based on what it sees.

Related

Automated tests in iOS with RobotFramework

I'm working in a project of develop a responsive webapp and I'm in charge of creating automated tests in order to test everything in 3 different places, Desktop web, Android web and iOS web with RobotFramework and Appium Library
Desktop and Android it's not the first time I've done it so I quickly configured everything, on the other hand I never tested or even develop anything for iOS (not even used an iPhone irl) and I know from a past experience that XCode has required to send data to the phone, in a similar way to adb for Android.
The real question that my research was not able to respond is: Is a MacOS environment running XCode needed in order to run regression tests? Or is it possible in someway just use Windows, Robot and a physical phone/emulator to run regression tests?
In the case that a MacOS is required do I need Apple Developer ID? (I remember a few years back that it was required for any iOS related development).
In case you're using MacOS and running with Real Device iOS you will require to have Developer Account to provision profile WebDriverAgent or Otherwise you need to have certificate from your developer to install on your Mac. Create Your Apple Dev Account. And if you want try with Windows you can try with Appium Studio.
Yes, you need a MacOS to test with Appium/AppiumLibrary and Robot Framework.
You don't need an Apple Developer ID to test on iOS (only need it when publishing apps to Apple Store).

automate mobile device apps by direct communication to the phone via REST api

I'm currently working on a project that relies heavily on appium / selenium for automation. These frameworks are great for starting out, but the robustness isn't quite there, and requires a lot of extra hardware / software to run the automation. Such as macOS, xcode, adb, appium, selenium, usb connection or connected through WIFI ( what we currently have to use ). There is just a lot of dependencies in this automation stack, and it would be nice to have a cleaner, more reliable, and scalable solution.
So I'm wondering. Does any one know a way to run automation for iOS and Android via REST api using a server that lives directly on the device allowing us to communicate to the device like curl -POST <device_ip>:<port>/session/{sessionId}/openApp.
Think of the WebDriverAgent that Facebook built, but instead of being built with xcodebuild, that Agent just lives on the device. Essentially when you build this framework it starts up that server I'm describing, but its reliant on xcode, and i ultimately would like to remove xcode from having to be in the picture. I know that there are so many issues today I see with people having issues with both the WDA server and xcode. Specially with new versions, and how the WebDriverAgent is now archived by facebook.
Can't we just create an app that can act as the WebDriverServer running at all time, and will just use the same logic as today.. via start session, find elements by Id, click on them, and move on. This would also remove the need to running Appium on your computer, and rely on it to proxy your commands to that WDA server with iOS.
I know android is a much simpler picture, and I'm currently a little more focused on how to solve this with iOS at the moment.
I would appreciate any insight into this issue / question, and if anyone has suggestions on Appium, iOS automation, android automation, or other points that can be made please send me your feedback.
We do run our automation using real devices!
I have use Appium / Selenium to access from Rest API . In my opinion it is easier than building your own.
One of the solution was is we are currently working in a project using Flutter - that still need your Xcode to sign in the dependencies. You will also need to make sure libimobiledevice and ideviceinstaller are installed, and lastly modify Flutter. And we call the real device from rest api . We are currently scaling and monitoring the performance.
Another viable alternative which I can think of, doing it through XCTest will be easier than Appium . Just provide the end point in your app and create a wrapper in XCTest. Call the rest api and run the test in XCTest. It is more stable and faster in long run.
But for bulk of projects , I am still using Appium to test for iOS while we are evaluating this solution.
If you're open to using commercial tools, you can consider using xcuitrunner. It installs a recent version of Appium's fork of WebDriverAgent on your iOS device, launches it (and keeps it alive), and returns you a HTTP endpoint which you can use to interact directly with the WebDriverAgent.
It helps remove a couple of dependencies (such as Xcode), which may be difficult to manage. You'll still need a code signing certificate and provisiong profile from Apple, though.

Is there any tool available to automate iOS default (Emai)l app?

I have explored couple of tools like Appium,KIF, for these tools we need to own the app (to enable Automation Instrument) to automate. And also tried with .IPA files available on the internet (Gmail email client) on iOS simulator, not got any success yet.
I have requirement to automate iOS default Email app, is there any tool/approach to do this?
Yup, Apple has it pretty locked down for apps that are not yours. For that situation, you can try using Sikuli, which uses a computer vision approach to automation. (Sikuli uses OpenCV under the hood).
If you also want to automate an app on a real device, you can use Sikuli combined with a camera and Tapster, a robot for interacting with a device. (Disclosure: I started the Appium and Tapster projects.)

Automate iPhone Setting/Facebook app using UI Automation

I have refereed the below forum for automating iPhone Settings using UI Automation tool. It's showing "iOS Simulator failed to install the application." error when started recording:
Automation of Settings app, iPhone
Could you please share how to automate iPhone Settings using UI Automation tool? Could you please share also how to automate third party app like Facebook or Twitter using UI Automation tool?
If you're talking about the Settings app on the device itself, you cannot use UI Automation to automate any interactions with it. However, there's a way to access the Settings app on the simulator. See my response on the posting you've linked.
As for automating the Facebook or Twitter apps, UI Automation can only be used with applications in which you have access to the source code.

How to test iOS web application using Instruments UIAutomation

When I test native application I can choose target (application from real device listed in the choose target list; or in the case with simulator - choose Profile menu item in application project).
But how can I choose target for web application?
Do I have to choose some browser as a target in this case? Device has Safari and Chrome browsers. Chrome browser appears in the list of targets. But when I try to run script, it does not works. Chrome is just launched, but any actions are performed.
I have also tried to create XCode project that simply open web page in browser. But when I try to run the script error "target application is not the frontmost" appears.
Is there some possibility to choose applications installed on the device as a target, if they are not present in the Instruments choose target list? There is a link to the web application on device home page. Can I somehow choose it as a target? In Organizer (called from XCode) only one - native - application is displayed.
UI Automation will only work for native applications built by you with Xcode. From your question it sounds like you want to launch Mobile Safari or Chrome for iOS and manipulate that with UI Automation. That won't work. Instruments can let you connect to applications you didn't compile running on the simulator or device, but only some of the instruments work and UI Automation isn't one of them.
If your web app was wrapped in a native shell then you could use UI Automation. You might want to look into Phone Gap. It's a full fledged wrapper that tries to expose native functionality to web apps, which you wouldn't need. But the fact that it's a well supported wrapper around web pages could be a great place to start if you still wanted to try this.
UI Automation doesn't support web automation. Try Selenium web driver for iOS, helps to automate web apps on iOS Safari browser. runs on both device and on simulator.

Resources