Support Team wrote:Hello Voughan,
May I ask if you could explain your question in more detail, maybe based on another sample? Why is it necessary for you to convert the XPath expression into a RxPath instead of generating the RxPath directly?
Regards,
Robert
I'm attempting to create resilient automation to test our integration with Oracle Fusion. The DOM is particularly complected and ugly and we know from previous experience (using QTP) that attributes like ID, class, etc, will change as patches are applied and versions updated.
The RxPath straight from the spy is
Code: Select all
/dom[@domain='REDACTED']//button[#'pt1:USma:0:MAt2:1:AP1:lv21:1:lv10:0:t2:0:lv2:2:cb1']
While I realize I can adjust how RxSpy identifies and evaluates attributes, as you'll see below there doesn't appear to be a good way to get RxSpy to provide me a resilient RxPath.
Rx Fusion Perf Begin.png
For 90% of what I'm doing regular expressions are working pretty well. However in this particular case I've got over a dozen "Begin" buttons. Four are visible in the attached image, but there are also 4 other sets with various number of "Begin" buttons.
Furthermore, these scenarios are
data-driven and the button ID is
NOT consistent between users and sessions. The Xpath I proposed allows me to define a row by its contents, in this case containing "Performance Review" and a "Begin" button. Once my row element is identified I can just grab the first and only "Begin" button that's there.
In other similar situations I've been able to use child/descendant elements that were easier to identify and tracked back to the parent/ancestor element that I desired. In this case there are so many div and table objects between identifiable elements that this method become less resilient.
The Xpath of this object according to FirePath is this:
Code: Select all
html/body/div[2]/form/div[6]/div/div/div/div/div[2]/div/div/div/div[1]/div[2]/div/div/div/div/div/div[1]/div[2]/div/div[3]/div/div/div/div[1]/div[1]/div/div[3]/div/div[2]/div/div/div/div/div[1]/div/div/div[3]/div/div[2]/div/div/div[2]/div/div/div/div/div/div/div/div/div/div/div/div[4]/div/div[1]/div[2]/div/div[2]/div/div/div/div[1]/div/div/div[2]/table/tbody/tr[2]/td/div/div/div/div[1]/div[3]/div/div/table/tbody/tr/td[2]/div/div/div[1]/button
Rx Fusion Begin DOM.png
I've approached our dev team to see if there was a way to insert our own attributes to these elements, but that is simply not possible.
And the extra wrinkle in this situation is that I'm developing automation that will be supported and used by less technical QA folks. My goal is to do this all without creating any custom user code, and so far I've managed to stick to that requirement.
You do not have the required permissions to view the files attached to this post.