Hi,
The mobile app I'm testing needs to interact with another application on a desktop. In my test cases, user needs to perform certain actions on the mobile app and some other actions on the desktop. So my question is as follows:
Is it possible to programmatically switch between two automation roots (i.e. a mobile device and a desktop) within the same automated test case?
Thanks for any tips or suggestions...
Switching between Automation Roots?
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Switching between Automation Roots?
Hello Machisperer,
Thank you for your post.
In order to switch to a specific endpoint during test run, the following codeline can be used:
If you want to switch from an endpoint to the desktop, please use the following line:
regards,
Stephan
Thank you for your post.
In order to switch to a specific endpoint during test run, the following codeline can be used:
Code: Select all
Host.MakeCurrentHost("Name of your Endpoint");
Code: Select all
Host.MakeCurrentHost("Localhost");
Stephan
-
- Posts: 7
- Joined: Wed May 02, 2018 3:48 pm
Re: Switching between Automation Roots?
Thanks Stephan! Exactly what I needed
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Switching between Automation Roots?
Perfect!
I'm glad, I could help.
Kind regards,
Stephan
I'm glad, I could help.
Kind regards,
Stephan
Re: Switching between Automation Roots?
Does anyone have any clue as to apply the lessons above to multiple endpoints? I want to run the same test suite through each of my endpoints, one after the other...
Re: Switching between Automation Roots?
Hi,
I would suggest creating a batch file that runs the test on all your endpoints.
In your output folder you can find shortcuts for each of your endpoints. You can run a test on a specific endpoint if you run the related shortcut.
So in your case, you could create a batch file that executes all shortcuts one after the other.
regards, qwertzu
I would suggest creating a batch file that runs the test on all your endpoints.
In your output folder you can find shortcuts for each of your endpoints. You can run a test on a specific endpoint if you run the related shortcut.
So in your case, you could create a batch file that executes all shortcuts one after the other.
regards, qwertzu
You do not have the required permissions to view the files attached to this post.
Re: Switching between Automation Roots?
Thanks qwertzu, I shall look into that option once I have exhausted my current one. I can switch endpoint programmatically, so I can create a list of my endpoints, and loop through each of those list items, executing the test suite on each. At least, that is the idea.
So far, I have two unknowns:
Unknown One:
Can I run a whole test suite from code? i.e :
This will run one test case (an .rxrec in my case). But I want to run:
This would run a whole .rxtst
Unknown two:
Can I get a list of endpoints programmatically?
Thats where I'm at at the moment, any pointers or advice would be much appreciated.
So far, I have two unknowns:
Unknown One:
Can I run a whole test suite from code? i.e :
Code: Select all
public static void runatest()
{
MyProject.Specific_Test.Start();
}
Code: Select all
public static void runaproject()
{
MyProject.Start();
}
Unknown two:
Can I get a list of endpoints programmatically?
Thats where I'm at at the moment, any pointers or advice would be much appreciated.
Re: Switching between Automation Roots?
Unknown two is solved:
Code: Select all
List<string> available_hosts = new List<string>();
available_hosts = Host.AvailableHosts.ToList();
foreach( string possibility in available_hosts)
{
Report.Log(ReportLevel.Info, possibility);
}
Re: Switching between Automation Roots?
jsmith wrote: ↑Tue Oct 23, 2018 3:14 pmThanks qwertzu, I shall look into that option once I have exhausted my current one. I can switch endpoint programmatically, so I can create a list of my endpoints, and loop through each of those list items, executing the test suite on each. At least, that is the idea.
.......
....
But I want to run:This would run a whole .rxtstCode: Select all
public static void runaproject() { MyProject.Start(); }
Just revisiting this this morning. Can anyone advise if they have successfully started a whole test suite from code?
Re: Switching between Automation Roots?
Okay so I have found a solution.
I have created an excel document which lists the name of each of my endpoints.
Then set this document as a datasource for my test case
I have then created a User code to change Endpoint to whatever string I pass in as a parameter.
Then I have bound the data to the recording.
And set the input parameter for the User code call as a variable.
This is working pretty much perfectly.
I have created an excel document which lists the name of each of my endpoints.
Then set this document as a datasource for my test case
I have then created a User code to change Endpoint to whatever string I pass in as a parameter.
Then I have bound the data to the recording.
And set the input parameter for the User code call as a variable.
This is working pretty much perfectly.