Also I have to reuse already created scripts for testing. As I've developed Ruby test scripts with me, which I should be reusing for iOS testing from my windows machine. I per my exploration, iOS testing has it's dependency on XCode, so you need Mac machine. It's never been faster or easier to take a Speedtest. Download the free Speedtest desktop app for Windows to check your internet speeds at the touch of a button. Get a real-time check of your ISP's performance and detect trends over time with data on.
Testing IOS apps are a task compare to Android apps testing, because of very few IOS emulator available as compare to android emulators available in the market. Due to Android emulators, we quickly test, run and execute Android apps on Windows, MAC and Linux computer. Hence, to test IOS apps for iPhone, iPad very few alternatives are available. Appium is popular due to its flexibility and usability on both Android and iOS, and it works. Tutorial: Automated Testing on iOS (with Appium, Test NG and Java on Mac). It drives iOS, Android and Windows mobile apps using the WebDriver protocol. In terminal, enter the following.
I'm pulling together some of the notes around iOS mobile testing that I've gleaned from research and interviews with TestTalks guests around mobile testing. Also picking an iOS testing framework is just the beginning so make sure to check out my post on how you can take the guessing out of you mobile testing coverage efforts.
Here are 7 iOS tools that seemed to be mentioned most (and that many people are using) that you need to know about for mobile automation testing. For the video version check [click here]
1. XCTest
For unit testing, you can use the framework called XCTest. XCTest is provided by Apple and has pretty good integration with the IDE for writing your tests, running your tests and even doing TDD workflow.
If you performed any unit testing prior to iOS 6, you may have heard of a tool called OCUnit. OCUnit has now depreciated, and ever since Xcode 5, the recommended testing framework has been XCTest.
2. UI Automation
For your more typical functional tests (or black-box tests), in which you're going to write code that simulates an end user navigating your app, there is UI Automation. UI Automation is provided by Apple and is the Apple-sanctioned way of performing iOS functional testing.
To use UI Automation you need to use Instruments, one of the tools that comes with Xcode.
The only problem with UI Automation is that tests are written in JavaScript, where iOS code itself is written in Objective-C or Swift, which differs significantly from JavaScript.
UI Automation itself is pretty lightly documented. If you have problems using it, you're kind of left up to trial and error. What's even worse is that there's is not much of a community around it that you can consult for support.
Also — when newer versions of XCODE are released Apple rarely, if ever, issues any new updates to UI Automation.
That's kind of the state of testing in terms of what Apple provides.
If the Apple tools don't meet your needs there are also a couple of pretty popular third party ways to test your iOS code that might actually work better for you.
3. OCmock
I'm aware that many teams love and heavily use OCmock. It's like your typical mock object framework, and it's really good for stubbing out and making mock objects of stuff, like code that leverages in a remote API, like a web service.
You can also use it for code that relies on a UI being available, like UI objects that you can't easily instantiate yourself through unit tests.
4. KIF (Keep It Functional)
A good alternative to UI Automation is a tool called KIF.
KIF stands for 'Keep it Functional.' I like to refer to it as UI Automation ++.
It's third party, and it's open source.
You write tests much in the same way as UI Automation, where you're simulating a user, tapping through the app.
Like UI Automation, it relies on accessibility labels; you define your application, which has the side benefit of making your app accessible to people who may be visually impaired that are being prompted through audio queues and how to use your app.
Basically UI Automation and KIF both rely on you defining accessibility labels on your UI elements in terms of how they navigate the app.
A couple of specific benefits KIF has over UI Automation is that you actually are writing the test in Objective-C which is now supporting Swift. There's no learning curve of swapping languages between Objective-C and JavaScript, like you had to do with UI Automation.
Additionally, the way KIF tests are executed in the same type of target that your unit tests are executed in, which is not the case for UI Automation.
In order to execute UI Automation tests, you have to use the other tool by Apple called Instruments (it's also their profiler tool). It's actually a great tool, but kind of like UI Automation that is tacked onto it.
As always your goal should always be to make your tests repeatable and quickly executable. By integrating with the same way that XCTest runs unit tests, KIF makes those kind of GUI- based tests much faster to execute.
5. FBSnapshotTestCase
FBSnapshotTestCase was created and is maintained by Facebook. Its basic function is that it allows you to verify your UI code by doing visual diffs between saved screenshots.
You can do it at a more granular level than the full screenshot of the device. You can pick a little UI view in what you subclass when you see a little widget on the screen; anything from a piece of text to something more complicated. You can also isolate that snapshot test case to that UI view subclass.
I definitely see some usefulness in that beyond the normal kind of simulated click and play you might get with UI Automation.
6. FRANK – BDD for iOS
If you want to do end-to-end testing in iOS and wish you could use BDD and Cucumber, no worries –there's a tool called Frank that will allow you to create acceptance tests and requirements using Cucumber.
Frank gives you the ability to run your BDD tests against your iOS application since it acts like an adaptor that connects your app to Cucumber.
To use UI Automation you need to use Instruments, one of the tools that comes with Xcode.
The only problem with UI Automation is that tests are written in JavaScript, where iOS code itself is written in Objective-C or Swift, which differs significantly from JavaScript.
UI Automation itself is pretty lightly documented. If you have problems using it, you're kind of left up to trial and error. What's even worse is that there's is not much of a community around it that you can consult for support.
Also — when newer versions of XCODE are released Apple rarely, if ever, issues any new updates to UI Automation.
That's kind of the state of testing in terms of what Apple provides.
If the Apple tools don't meet your needs there are also a couple of pretty popular third party ways to test your iOS code that might actually work better for you.
3. OCmock
I'm aware that many teams love and heavily use OCmock. It's like your typical mock object framework, and it's really good for stubbing out and making mock objects of stuff, like code that leverages in a remote API, like a web service.
You can also use it for code that relies on a UI being available, like UI objects that you can't easily instantiate yourself through unit tests.
4. KIF (Keep It Functional)
A good alternative to UI Automation is a tool called KIF.
KIF stands for 'Keep it Functional.' I like to refer to it as UI Automation ++.
It's third party, and it's open source.
You write tests much in the same way as UI Automation, where you're simulating a user, tapping through the app.
Like UI Automation, it relies on accessibility labels; you define your application, which has the side benefit of making your app accessible to people who may be visually impaired that are being prompted through audio queues and how to use your app.
Basically UI Automation and KIF both rely on you defining accessibility labels on your UI elements in terms of how they navigate the app.
A couple of specific benefits KIF has over UI Automation is that you actually are writing the test in Objective-C which is now supporting Swift. There's no learning curve of swapping languages between Objective-C and JavaScript, like you had to do with UI Automation.
Additionally, the way KIF tests are executed in the same type of target that your unit tests are executed in, which is not the case for UI Automation.
In order to execute UI Automation tests, you have to use the other tool by Apple called Instruments (it's also their profiler tool). It's actually a great tool, but kind of like UI Automation that is tacked onto it.
As always your goal should always be to make your tests repeatable and quickly executable. By integrating with the same way that XCTest runs unit tests, KIF makes those kind of GUI- based tests much faster to execute.
5. FBSnapshotTestCase
FBSnapshotTestCase was created and is maintained by Facebook. Its basic function is that it allows you to verify your UI code by doing visual diffs between saved screenshots.
You can do it at a more granular level than the full screenshot of the device. You can pick a little UI view in what you subclass when you see a little widget on the screen; anything from a piece of text to something more complicated. You can also isolate that snapshot test case to that UI view subclass.
I definitely see some usefulness in that beyond the normal kind of simulated click and play you might get with UI Automation.
6. FRANK – BDD for iOS
If you want to do end-to-end testing in iOS and wish you could use BDD and Cucumber, no worries –there's a tool called Frank that will allow you to create acceptance tests and requirements using Cucumber.
Frank gives you the ability to run your BDD tests against your iOS application since it acts like an adaptor that connects your app to Cucumber.
The Cucumber recipes book has a nice step-by-step recipe(28) called Test iOS Using Frank that is really helpful.
7. APPIUM
Appium is a free, open-source, cross-platform mobile UI automation framework. It allows you to write UI tests for your mobile apps, for Android iOS, and some other OSs. It also lets you write it using the Selenium JSON writer you know and love from web automation. Appium is becoming an industry standard for mobile testing, much as Selenium WebDriver become the industry standard for browser-based automation a few years ago. Check out my Appium Tutorial for Beginners for more info on Appium.
Mobile Automation Awesomeness for Your Earbuds
I highly recommend that you not only learn more about these tools, but heed the advice of engineers who have successfully used these tools to automate their own projects in the real world. Check out:
- Daniel Knott: Hands-On Mobile App Testing
- Andy Obusek: iOS Testing: The Apple Watch is Coming – Are You Ready?
- Steve Hazel: How to Make Your Automation Better & New Sauce UI
This guide provides instructions for preparing Xamarin.UITests for upload to App Center Test. Select your platform to begin.
Xamarin.iOS apps must have the Xamarin Test Cloud Agent linked into the app's .ipa file. The Xamarin Test Cloud Agent is a special, embedded HTTP server that allows Xamarin.UITests to interact with the iOS user interface. The Test Cloud Agent is added to the iOS project via NuGet.
Run Ios On Windows
Tip
Non-Xamarin iOS apps are also supported by Xamarin.UITest, but instead of the Xamarin Test Cloud Agent require linking Calabash.
Visual Studio for Mac
For an iOS project in Visual Studio for Mac, right-click on the Packages folder, select Add Package. Search for Xamarin Test Cloud Agent, and click Add Package:
Visual Studio (Windows)
Important
Xamarin.UITests for iOS apps can't be executed locally on Windows. You can still create, compile and upload to App Center Test from Windows.
For an iOS project in Visual Studio for Windows, right-click on project and select Manage NuGet Packages from the context menu. In the NuGet Package Manager Search for Xamarin Test Cloud Agent and click OK to install that package:
Initialize the Xamarin Test Cloud Agent
After adding the Xamarin Test Cloud Agent to the iOS project, you must initialize the Xamarin Test Cloud Agent when the iOS app starts. Edit the AppDelegate class and add the following snippet to the FinishedLaunching
method:
Warning
Apple will reject your app if you submit an app that includes the Xamarin Test Cloud Agent. The Xamarin Test Cloud Agent is only supported for apps signed with Development Provisioning Profiles. When submitted to App Center Test, IPAs are automatically re-signed with one of our Development Provisioning Profiles if possible.
Ios Texting On Windows 10
When you surround the initialization code in the ENABLE_TEST_CLOUD conditional compile statement, the Xamarin linker will leave the Xamarin Test Cloud Agent in builds that use the ENABLE_TEST_CLOUD flag. Normally Debug builds but not Release builds. New Xamarin.iOS apps created in Visual Studio use this approach.
Ios Testing On Windows 10
Generating an upload command
Once a test suite is prepared, you can setup a test run to upload and run your tests. That process will generate a prototype command line like this:
The command line requires some modifications:
- You must provide paths for the arguments
--app-path
&--build-dir
. - You may need to specify the UITest package you're using, if the CLI can't automatically find it:
--uitest-tools-dir /Users/{your username}/.nuget/packages/xamarin.uitest/{UITest version}/tools