Hi ,
Is there a way to uniquely identify an instance of an application ?
if there are multiple instances of the application started and all of them
have the same set of UI elements and match the objects in the repository
though the actions are performed on the object that has focus ,
Just wanted to know if there is any way to uniquely identify the instance
of the application and set focus to it when operations/actions are required to be
performed on a specific application instance ?
Regards,
Prad
uniquely identify an java application instance
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: uniquely identify an java application instance
Hi,
You could use the Index, the Instance attribute or the ChildIndex attribute in the root element of your application.
Regards,
Markus
Ranorex Support Team
You could use the Index, the Instance attribute or the ChildIndex attribute in the root element of your application.
Regards,
Markus
Ranorex Support Team
Re: uniquely identify an java application instance
Thanks ,
I see that but still did not come across a method to set focus to a particular instance of the application
from the test case code
would like to be able to do something like this
repo.Form.Activate( instance_1 )
perform operations
repo.from.Activate(instance_2)
Regards,
Prad
I see that but still did not come across a method to set focus to a particular instance of the application
from the test case code
would like to be able to do something like this
repo.Form.Activate( instance_1 )
perform operations
repo.from.Activate(instance_2)
Regards,
Prad
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: uniquely identify an java application instance
Hi,
This is not possible this way.
The distinction whether it is instance 1 or 2 takes place in the RxPath of the form element.
For instance if there are two instances of the calculator running, one form is identified with the RxPath "/form[@title='Calculator' and @processname='calc' and @class='CalcFrame' and @instance='0']" and the second one with "/form[@title='Calculator' and @processname='calc' and @class='CalcFrame' and @instance='1']".
You can see that the instance attribute is used to uniquely identify the two forms.
In order to bring one of the forms in foreground you have to use the related repository item:
There is also a method of the "Form" adapter which allows you to get the active state of the form:
Regards,
Markus
Ranorex Support Team
This is not possible this way.
The distinction whether it is instance 1 or 2 takes place in the RxPath of the form element.
For instance if there are two instances of the calculator running, one form is identified with the RxPath "/form[@title='Calculator' and @processname='calc' and @class='CalcFrame' and @instance='0']" and the second one with "/form[@title='Calculator' and @processname='calc' and @class='CalcFrame' and @instance='1']".
You can see that the instance attribute is used to uniquely identify the two forms.
In order to bring one of the forms in foreground you have to use the related repository item:
var calculator = repo.Calculator.Calculator; var calculator1 = repo.Calculator1.Calculator; // you can whether use EnsureVisible or Activate calculator.EnsureVisible(); calculator1.Activate();If you just want to use one repository item for each of the forms you could also use a repository variable and the data driven approach to distinguish between the instances and to perform the actions on a specific instance of your application.
There is also a method of the "Form" adapter which allows you to get the active state of the form:
bool isActive = calculator.Active;, for more information please take a look at the API documentation of the Form adapter: Form Class.
Regards,
Markus
Ranorex Support Team