18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Getting text from a web page and using it
Hi,
Would it be possible to grab some text, which is the content of a certain <div id="whatever">? How can this text be used later?
Lets say I have this html:
And for bonus points... Has anybody automated printing? I need to print that page that pops up to a pdf printer, and I don't know even if that can be done with sahi.
Best regards,
Javier
Would it be possible to grab some text, which is the content of a certain <div id="whatever">? How can this text be used later?
Lets say I have this html:
Text that never changes <div id="hereComesWhatiNeed">
<span class="primary_value">
The Text I Need</span>
</div>
I would need to use that "The Text I Need" string to force a popup window to have such title (for instance) I don't really have a clue of how to grab that text and use it later. My goal is to click on a link and associate the content of that popup with the text "The text i need".And for bonus points... Has anybody automated printing? I need to print that page that pops up to a pdf printer, and I don't know even if that can be done with sahi.
Best regards,
Javier
Comments
Would it be possible to set this as a global windows variable, environment or something so other programs can access the text contained in $txt?