How to check for multiple repo items in parallel

Ask general questions here.
tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

How to check for multiple repo items in parallel

Post by tvu » Thu Jul 13, 2017 6:11 pm

Hi everyone,

Is there a way to check the existence of multiple repo items in parallel?

I want to write a script that returns to a default location in a mobile app. I wanted this to be a general purpose script to put in the tear down of each test case. I know I can check for one item and them perform some action. Then repeat this process going through various scenarios with different repo items. But, this adds a lot of wait time.

I was thinking something a long the line of this:

Code: Select all

repoItemThatExists = ReturnTheRepoItemThatExists(repoItem1, repoItem2, repoItem3);

case (repoItemThatExists)
    repoItem1:
        Do something
    repoItem2:
        Do something else
    repoItem3:
        Do magical things
For course, only one of those repo Item would exists at a time.

I want to avoid this:

Code: Select all

if (repoItem1.Exists())
{
    Do something
}

if (repoItem2.Exists())
{
    Do something else
}

if (repoItem3.Exists())
{
    Do magical things
}
If repoItem3 exists, I would have to wait for the search timeouts for repoItem1 and repoItem2 before getting to that point.

Thanks in advance.

User avatar
Vega
Posts: 109
Joined: Mon Jul 11, 2016 2:15 pm

Re: How to check for multiple repo items in parallel

Post by Vega » Thu Jul 13, 2017 7:35 pm

instead of always checking for all of the repo items of interest, why dont you just make a single function which accepts a repo item as an argument? This way you minimize the wait time by only checking the repo item which is applicable to that scenario. You could reuse this function easily using the code library and there is built in functionality to have it accept repo item adapters / repo item info objects as an argument (see attachment)
Attachments
repoz.png
repoz.png (9.4 KiB) Viewed 532 times

tvu
Posts: 195
Joined: Tue Apr 07, 2015 10:47 pm

Re: How to check for multiple repo items in parallel

Post by tvu » Thu Jul 13, 2017 7:52 pm

I am testing an app where I can run into several issues with error pop up appearing, touch operation not having any effect, app is slow to respond, etc...

When this happens, the test case would fail and leave it in an unknown condition. I want to write a script that would check for all these conditions and handle them properly. I am just trying to save on time when serially searching throw a list of conditions,