18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Can Sahi parse xPath?

gdlex4015gdlex4015 Members
edited November -1 in Sahi - Open Source
I am trying to populate textbox using xPath to find it, Sahi does not seem to be able to do that, here is a snippet of code:

_setValue(_textbox("//span[@class ='fieldName' and text()='Training Course Name']"), "New Training Course"));

Did anyone ran into this problem?

Thanks

Comments

  • narayannarayan Administrators
    _textbox("//span...") will not work.

    But you can add your xpath library by adding the js file in config/inject_top.js (if needed)

    Then you can locate the element using xpath and pass that element into the sahi api, say _setValue.
    _setValue(elementByXPath, 'value');
    
Sign In or Register to comment.