I'm new to RanoRex tool and I'm trying understand as how do I access the repository in my code block which is Object from Repository Vs RxPath.
I have used the below lines to access the repository as suggested by Ranorex by specifying the RxPath it works fine
Unknown webElem = null;
WebDocument webDoc = null;
WebElement webElem = webDoc.FindSingle("/dom[@domain='xx.xxx.xxx.xxx']//div[#'silverlightControlHost']/object/form/progressbar/container[@automationid='MenuScroller']", 60000);
However, do we have a way by which we can achive the same by accessing the object repository and achive the same. Something like
<RepositoryName> repo = <RepositoryName>.Instance;
repo.domObject.find();
where repo.domObject = "/dom[@domain='xx.xxx.xxx.xxx']//div[#'silverlightControlHost']/object/form/progressbar/container[@automationid='MenuScroller']"
This makes me confusing as should I purely go with the respository (but the later is not possible) and if I go by the Ranorex path I land-up changing objects every now and then as the AUT is still under initial development phase and objects might change.
Please let me know if I'm missing something.
Thank you so much in advance.
~Prash
Using RxPath and Object Repository
- artur_gadomski
- Posts: 207
- Joined: Mon Jul 19, 2010 6:55 am
- Location: Copenhagen, Denmark
- Contact:
Re: Using RxPath and Object Repository
I would suggest using Repository as if paths change you have them stored all in one location and can validate/fix all of them at once, in theory. If you code them you need to search your code or run and fix the tests as stuff change.
To answer your question about how to access Repository elements in code see Sample Solution from this post:
http://www.ranorex.com/forum/manually-w ... tml#p15361
To answer your question about how to access Repository elements in code see Sample Solution from this post:
http://www.ranorex.com/forum/manually-w ... tml#p15361
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Using RxPath and Object Repository
Hi,
If you want to access the methods of the adapter represented by the repo item you have to use, for the root AppFolder, the following code:
Regards,
Markus
Ranorex Support Team
If you want to access the methods of the adapter represented by the repo item you have to use, for the root AppFolder, the following code:
repo.domObject.Self.FindSingle("...", 60000);for normal repo itmes you can directly access the virtual adapter with:
repo.domObject.YourElement.FindSingle("...", 6000);you can use all the methods of the specific element type which is represented by the repo item.
Regards,
Markus
Ranorex Support Team