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.

Using _popup(identifier) with popup title blank in the webpage I mean <tittle></title>

estebannestebann Members
edited July 2013 in Sahi - Open Source
I'm using the _popup(identifier) instruction in sahi. When the web page in it's html code has the tag <tittle>Window Name</title>, sahi works OK. All the instructions related with popups works ok.

_popup("/.*/").
_popup("Window Name).

But when the popup WebPage doesn't have title(<tittle></title>) those instructions don't work.

Sahi doesn't recognize the popup window because It doesn't has title.

I've searched at forum but I haven't found answer yet

I just need, when the popup page has title in blank; How Sahi identified the popup WebPage ?


In Javascript you can change the title of the any WebPage with "document.title='New Title'" but in sahi this doesn't work.

When the popup WebPage doesn't have title in its place it puts the URL of the page.
The title is for instance "http://localhost:8081/FormularioPHP/consultardirecto.php";
I've tried too calling the popup with the URL :

"_popup("http\:\/\/localhost\:8081\/FormularioPHP\/consultardirecto\.php")._setValue(_textbox("nick"), "john");" but this doesn't work
I've tried too, for this case:

_popup("/.*/")._setValue(_textbox("nick"), "john");
_popup("") ._setValue(_textbox("nick"), "john");
_popup()._setValue(_textbox("nick"), "john");
document.title="Windows Name"



Thanks for your time :-)


Forums where I've searched:

http://www.tytosoftware.com/forums/discussion/3400/handling-popup039s-in-sahi-script
http://tytosoft.www51.a2hosting.com/forums/discussion/2711/unable-to-record-popup-message/p1?post#Form_Body
http://tytosoft.www51.a2hosting.com/forums/discussion/2711/unable-to-record-popup-message/p1

Answers

  • Hi,
    Try using _selectWindow("your_url");

    _selectWindow("your_url");
    _setValue(_textbox("nick"), "john");
    ..
    ...
    ....
    _selectWindow();

    Please let me know if it works for you.

    Regards.
  • Thank for your help, but unfortunately it doesn't worked my friend; sahi remains freeze and not continue running the script.

    Logs:
    _popup("your_url")._setValue(_textbox("nick"), "john");
    Window/Domain not found: popupNameFromStep=your_url; derivedName=; windowName=; windowTitle=; wasOpened=1; domain=
  • Anyone else?
  • Hi estebann,
    By "your_url", i mean the url of your popup window. You will have to replace the "your_url" in the piece of code i mentioned above with the actual URL of the popup window.

    Regards.
  • Hi estebann,
    When you hover over the elements on your popup window, do you see any value inside <Prefix> in the recorder tab of your controller?

    Regards.
  • No, I don't see the prefix because the html code doesn't have the tag <titl></title> then sahi doesn't recognize de WindowsName
  • I've got the same behavior with a Sahi Pro v5.1.2
    Clicking on a button on the main page pops up a window without title.
    Sahi controller shows the prefix popup_xxxxxxx but this is dynamically generated.
    It's then not possible to script this through a regexp with _popup function.
    Anyone succeeded in get the current popup id?
  • tkitoitkitoi Members
    edited September 2014
    ...
  • tkitoitkitoi Members
    edited September 2014
    ...
Sign In or Register to comment.