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 do I get Sahi to recognize popup window?

danielallamdanielallam Members
edited February 2013 in Sahi Pro
I am scripting a simple test that involves a popup - I cannot get Sahi to recognize the popup at all. I would really appreciate any help at all on this as I like the tool but I am struggling with it when a popup/new window is launched. Please anyone with some Sahi knowledge, let me know where I am going wrong!

Example script:
I enter the Apple stock code in the site fidelity.com and a popup is displayed with the stock info. I have tried both window name and window title as the popup identifier, and I have tried wildcards. Nothing seems to identify it.

Example script:
_navigateTo("http://www.fidelity.com";);
_setValue(_textbox("SID_VALUE_ID"), "AAPL");
_click(_submit("Quotes"));
//The next part fails (I have tried many different identifiers passed into _popup)
_popup("Get Quote for AAPL: Fidelity Investments - Google Chrome")._click(_link("3m"));
//I also tried using _selectWindow to set popup as context for actions but can't get this to work


Best Answer

  • Answer ✓
    _popup("Get Quote for AAPL: Fidelity Investments - Google Chrome")._click(_link("3m"));
    has Google Chrome in it!

    It should just be

    _popup("Get Quote for AAPL: Fidelity Investments")._click(_link("3m"));

    This script was tested and works:
    _navigateTo('http://www.fidelity.com');
    _setValue(_textbox("SID_VALUE_ID"), "AAPL");
    _click(_submit("Quotes"));
    _popup("Get Quote for AAPL: Fidelity Investments")._click(_link("3m"));
    

Answers

  • Hi danielallam,

    Please take a look at the below link
    http://sahi.co.in/w/_lastalert
    Hope this may help you.. Good Luck !!
  • Thanks for that - sadly, doesn't apply in this case as popup is not an alert. It's really a 2nd web page with lots of different objects on it that I want to perform actions on.

    Appreciate your response though.
  • Hi Narayan,

    Yes, The above script working fine.
    Thanks much for your information.

    Thanks,
    Umashankar

  • Whoops - somehow, I didn't notice that Google Chrome creep onto the end!
    Thanks guys - I can now identify popup.
Sign In or Register to comment.