Axe Test Automation PlatformGeneral discussion relating to the Axe Test Automation Platform from Odin Technology |
||
Posts by Odin employees marked:
|
Hi
AXE v3.2/ Selenium (Java) I am setting up a new AXE project and am still waiting for a few config changes so I can run it in an environment, hence this is a theoretical question. I have objects on a page where a random string of character is generated. This string is different each time the page loads (an example is below, with the random string replaced with XXXX for ease of reading)... <div class="miapDataEntryField"> <div class="miapLabelCol"> <span class="outputText" id="viewPC_XXXXX:viewUserAccount:userName_field"> Text - Username How would you suggest identifying these objects for the Object Map? (note that all of the class attributes appear for other objects on the page, therefore are not unique enough to use nor really give me the option of using xPath). Following the random string is a colon - the identifier following this is unique (in this example, I am referring to ":viewUserAccount:userName_field" . Many thanks Mark
Hi Mark,
Like most GUI test execution tools, Selenium provides a means to locate objects using regular expressions. This would appear to solve the problem in your case. If you Google something like 'selenium locator regular expressions' you will find lots of good articles on this. e.g. http://seleniumready.blogspot.com/2010/10/use-regex-in-selenium-locators.html So for your example, you could try something like: //span[matches(@id, 'viewPC_.*:viewUserAccount:userName_field')] Sam |