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.

Sahi Java Popup

dlohithdlohith Members
edited November -1 in Sahi - Open Source
Hi Narayan ,

We are using java project with our own framework to automate .

I want to read the data present in the popup ( like about the product popup) ,

we need to parser the data

Could you please help us in doing this

Thanks,
Lohith

Comments

  • narayannarayan Administrators
    Hi Lohith,

    Please do not post to old threads. Start a new one so that the context is right.

    Could you please specify what you tried and how it is failing?

    Regards,
    Narayan
  • Hi Narayan,

    I am very naive user of Sahi tool . We are trying to integrate Sahi tool with our automation framework which is in Java . We are trying to get the text data present in the popup and main Browser window .

    Could you please help in getting the data .

    Thanks,
    Lohith
  • narayannarayan Administrators
    If your data is in a div, it would look something like this:

    String txt = browser.popup("popupName").div("divId").getText();
  • Hi Narayan,

    Data is in span class,

    the data is as flows

    <body>
    <p class="version"><span class="style1">Version: </span>values<br />
    <span class="versiongrey">Update: </span>values <br />

    <span class="versiongrey">Host: </span>values<br />
    <span class="versiongrey">Net Id:</span>values<br />
    <span class="versiongrey">Inst Type:</span>&values<br />
    <span class="versiongrey">App Deployed In:</span>JBoss</p>



    I was able to get few data from using following code . we have redundant span class . can we over come with any method ?

    String txt = browser.popup("about").span("style1").getText();

    need to get the data like

    Version: values
    Update: values
    Host:values
    Net Id:values
    Inst Type:values
    App Deployed In:values


    Thanks
    Lohith
  • narayannarayan Administrators
    I think you need

    String txt = browser.popup("about").span("style1").parentNode().getText();
  • Thanks Narayan ,

    I was able to get the data as required
This discussion has been closed.