Skip to main content

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?

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.

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

Cheers!


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


@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?

 



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


Hi ​@Mandar12 

 

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


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!


Reply