Modify Repository for inconsistant names.
Posted: Thu Nov 11, 2010 4:58 am
Hi
Our application changes the name of several objects each time it is built. I have changed the repository for the recorded project to use xpath to find the objects after each build but the repository seems to get overwritten every time I open Ranorex. How do I impliment xpath to find an object if Ranorex keeps overwriting my changes - not much point in having the power of xpath if you cant impliment it?
i.e.
The recorded path in the repository is:
_atagfind_userInfo = new RepoItemInfo(this, "ATagFind_User", "body/div/form/div[@id='headerbar']/div[@id='mainmenu']/table/tbody/tr/td[3]/div[@id='ctl00_TopMenun8Items']/table/tbody/tr[@id='ctl00_TopMenun39']/td/table/tbody/tr/td/a[@innertext='Find User']", 10000, null);
However, when we rebuild our product the /tr[@id='ctl00_TopMenun39'] menu is sometimes shuffled internally on the build to have a topmenu item number anywhere between 0 and 100 e.g. /tr[@id='ctl00_TopMenun42']
I can get around this by using regular expressions like /tr[@id~'ctl00_TopMenun[0-9]'] but this gets overwritten by Ranorex every time. Anyone know how to get around this?
Thanks
Our application changes the name of several objects each time it is built. I have changed the repository for the recorded project to use xpath to find the objects after each build but the repository seems to get overwritten every time I open Ranorex. How do I impliment xpath to find an object if Ranorex keeps overwriting my changes - not much point in having the power of xpath if you cant impliment it?
i.e.
The recorded path in the repository is:
_atagfind_userInfo = new RepoItemInfo(this, "ATagFind_User", "body/div/form/div[@id='headerbar']/div[@id='mainmenu']/table/tbody/tr/td[3]/div[@id='ctl00_TopMenun8Items']/table/tbody/tr[@id='ctl00_TopMenun39']/td/table/tbody/tr/td/a[@innertext='Find User']", 10000, null);
However, when we rebuild our product the /tr[@id='ctl00_TopMenun39'] menu is sometimes shuffled internally on the build to have a topmenu item number anywhere between 0 and 100 e.g. /tr[@id='ctl00_TopMenun42']
I can get around this by using regular expressions like /tr[@id~'ctl00_TopMenun[0-9]'] but this gets overwritten by Ranorex every time. Anyone know how to get around this?
Thanks