What's the best approach to handle different recordings

Best practices, code snippets for common functionality, examples, and guidelines.
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

What's the best approach to handle different recordings

Post by tvu » Sat Jan 09, 2016 1:35 am

We have an iOS app where the layout is different when it's loaded on an iPhone vs an iPad. We develop the automation so it's device agnostic so the scripts will work on an iPhone or an iPad. There is no where in the iOS App Ranorex project where we need to specify if it's an iPhone or iPad.

We have another Ranorex project that uses the RxBrowser to do mobile web testing. The website layout is completely different when loading on an iPhone vs an iPad. Unlike the iOS app, we have separate recordings for the iPhone vs iPad. Both type of recordings are in the same Ranorex project, but organize in such a way where they are group into an iPhone or iPad folder.

We want to have a full end to end test case. Here's an example of a test flow:
  • 1. Load the RxBrowser and load our site
    2. Login on website
    3. Purchase something
    4. Load iOS App
    5. Login on app
    6. Validate the purchase content is available
We've created a Ranorex solution and imported both iOS and Mobile Web projects. In this new solution, we are not interested in testing whether we can login on the RxBrowser via the iPhone or iPad since the Mobile Web project already tests for that. We just want to have a single test case to simply login. In this solution, we will probably have to have a parameter that indicates whether the device is an iPhone or an iPad.

I can think of two approaches on how to handle this:
  • 1. Have a user code module that simply checks for the device type and calls the required recording. The problem is how do you bind the data via code?

    2. Have a test case named 'A-Parent' that have two nested test cases named 'A-Child1' and 'A-Child2"? Data binding is done on the Parent level and passed down to the two Child test cases. Have a user code module in the setup phase of 'A-Parent' to determine the device type and then jump to the appropriate nested test case: 'A-Child1' or 'A-Child2'. In each of the nested test case, you have a user code module that breaks out to the parent level so it can continue with the test flow. How would this jumping work?
My question is, what's the best approach to either call the iPhone Login recording or the iPad Login recording? Is there a better approach than the ones I listed?