Skip to main content
Solved

How to user outerHTML as the only object property in Recorder

  • May 19, 2025
  • 6 replies
  • 125 views

Forum|alt.badge.img+1

Hello,

I was playing around with the recorder object property trying to see how whats the minimum property that the recorder need to recognise the ui. so using only domxpath produce no issue, but im unable to make it work when using only outerhtml

for example in https://rpachallenge.com/

The outerhtml for first name is 

<input _ngcontent-c2="" ng-reflect-name="labelFirstName" id="random-value" name="random-value" class="ng-touched ng-dirty ng-invalid">

But when i only enabled this object property robot is unabled to detect the textbox. Do noted that i do not refresh the page so the id and name is still the same, and i even try to do it in normal google search, and also unable to use only outerhtml. How do we actually use outerhtml in recorder?

Best answer by Vatsy

Hi ​@nidani98,
It is always a best practice to use only the DOMXPath parameter only with the Recorder: Capture action but if you want to use outerHTML parameter only then you would have to make it dynamic.

I have listed a few dynamic options below that you can try and see if that works.

  • //input[contains(@ng-reflect-name, 'labelFirstName')]
  • //input[contains(@class, 'ng-touched') and contains(@class, 'ng-dirty')]
  • //input[@id=//input/@name]
  • //input[contains(@ng-reflect-name, 'labelFirstName') and contains(@class, 'ng-invalid')]

Cheers!

6 replies

Vatsy
Most Valuable Pathfinder
Forum|alt.badge.img+16
  • Most Valuable Pathfinder
  • Answer
  • May 19, 2025

Hi ​@nidani98,
It is always a best practice to use only the DOMXPath parameter only with the Recorder: Capture action but if you want to use outerHTML parameter only then you would have to make it dynamic.

I have listed a few dynamic options below that you can try and see if that works.

  • //input[contains(@ng-reflect-name, 'labelFirstName')]
  • //input[contains(@class, 'ng-touched') and contains(@class, 'ng-dirty')]
  • //input[@id=//input/@name]
  • //input[contains(@ng-reflect-name, 'labelFirstName') and contains(@class, 'ng-invalid')]

Cheers!


Mandar12
Forum|alt.badge.img+3
  • Navigator | Tier 3
  • May 19, 2025

well said ​@Vatsy . In case of input web fields it highly recommended to use Relative DOMX Path.


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • May 20, 2025

@Vatsy Thank you for your response.

 

I did try your dynamic outerhtml as in the image, try all 4 but unfortunately i cant make it work. Is there something that i did incorrectly?

 


Mandar12
Forum|alt.badge.img+3
  • Navigator | Tier 3
  • May 20, 2025


Hi ,maybe you can uncheck the other object properties and only keep the one required 


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • May 20, 2025

Hi ​@Mandar12 

 

Managed to do it using ​@Vatsy method, but need to put the value inside domxpath instead of the outerhtml. 


Vatsy
Most Valuable Pathfinder
Forum|alt.badge.img+16
  • Most Valuable Pathfinder
  • May 20, 2025

Hi ​@Mandar12 

 

Managed to do it using ​@Vatsy method, but need to put the value inside domxpath instead of the outerhtml. 

Hi ​@nidani98,
With this we can conclude that the dynamic XPath would work only with the DOMXPath parameter with which we don’t need any other filter parameter to be applied. This is the best practice that we use when it comes to web scraping.

Cheers!