nkongara
nkongara

Reputation: 1229

How to Write the Test Suite using UIAutomation?

I'm started looking at UIAutomation for automating our iOS application. Everything seems to be fine, but I need ideas on how to create test suite with UIAutomation ?

How can I initialize the application (restart the application) for every test case? I see in other tool (Robotium for android) every test case can be independent of other.

Basically What I'm looking for is, Whenver a test case is failed/complete how would I take it to the initial state so that next test cases will be continued with out any failure ?

Thanks, Kongara

Upvotes: 0

Views: 1170

Answers (1)

Sh_Andrew
Sh_Andrew

Reputation: 352

It could implemented in different ways. This are a couple of methods(not the best but the easiest):

  1. Restore application initial state from your test script before running each test. (not a best way because if the restoration will fail - all other tests will fail too)
  2. Run UI Automation from the command line. Since UI Automation can run only 1 script during the cmd line execution - you must create a Python or any other launch script that will do:

a. Reads a txt/xml config file. Conf file contains a list of js file names. Each .js file is your separate test. For example TestSuiteCFG.txt:

test1.js
test2.js
... 
testN.js

b. Launch UI Automation from cmd line in 'for' loop from 1 to N with test name parameter that was read in the 1st step. UI automation will be started as many times as tests in your CFG file. Each new test UI Automation will be re-started and you will meet your "next test cases will be continued with out any failure" requirement.

This way will also allow you to manage your testing process. Create as many CFG files (or test Suite files) with different sets of tests (limited/full regression, acceptance and other) and run your test suites by executing only one script. Also it could be easily integrated into the CIT servers

Upvotes: 1

Related Questions