Hi guys,
I try to construct in code an alternative of the Info object that is created automatically in repo.
For example, with the usage of repo we have this easy way if an object exists:
if (repo.MyApplication.MyButtonInfo.Exists(5000)) {
//do stuff
}
If we want this with code?
I have the following button :
/dom[@domain='ServerName:Port']//td[#'framescontainer']/div[@visible='True']/div/div/table/tbody/tr/td/table/tbody/tr/td/div[#controls_container]/div[@id='id_controls_area']/div[@ajxname='Section_3']/table[@ajxname='OPERATIONS_2']/tbody/tr/td[#id_setof_content]/table/tbody/tr/td/span[#id_next]
If I have one page with operations, this button doesn't exist. If I have multiple pages of operations this button exists. If I declare it in the repository, then it's easy to use the Info object.
I wonder how to do this without the repository, because I don't want to be dependent on many objects in the repository.
Thank you
Alternative in code for the Info object
Re: Alternative in code for the Info object
Hi,
I'm afraid, the Ranorex Info object cannot be created from code. You will have to use the repo to be able to use Info object.
In my opinion, not using repo is a wrong idea. You see, the Ranorex repo is a central place where you can store and manage all GUI elements. If properly used, it's the best place for element maintenance. Once you start using xpaths in code, you may end up with very messy and hard to maintain solution
I'm afraid, the Ranorex Info object cannot be created from code. You will have to use the repo to be able to use Info object.
In my opinion, not using repo is a wrong idea. You see, the Ranorex repo is a central place where you can store and manage all GUI elements. If properly used, it's the best place for element maintenance. Once you start using xpaths in code, you may end up with very messy and hard to maintain solution
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Alternative in code for the Info object
Thanks odklizec,
I'll follow your suggestion.
I'll follow your suggestion.