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.

How to access data from tspan element

asra_mdasra_md Members
edited May 2013 in Sahi - Open Source
Hi,

I am new to SAHI and have little knowledge of scripting. I want to access the data 1.01 from the below code. Please help me out.

<tspan x="3">1.01</tspan>

Regards,

ASRA

Answers

  • Hi Asra,

    The following steps should help you resolve your issue.
    1) Open sahi/htdocs/spr/concat.js
    2) find the function named prepareADs.
    3) Add this line at the end of this function.
    this.addAD({tag: "TSPAN", type: null, event:"click", name: "_svg_tspan", attributes: ["sahiText", "id", "className", "index"], action: "_click", value: "sahiText"});
    4) Save the file.
    5) Now open sahi/config/normal functions.txt.
    6) Add the following at the end of the file:
    _svg_tspan
    7) Save the file.
    8)Restart Sahi.

    Sahi should now identify your tspan from the recorder as _svg_tspan("1.01").

    Regards.
  • Thanks a lot Pratyush.
  • Glad to help.
This discussion has been closed.