Welcome to the new Sahi Forums!
Sahi: popup windows
  • Hi team,

    Is there any option in Sahi to capture Pop ups?

    Regards,
    Chejness.
  • 14 Comments sorted by
  • Hi Chejness,

    If you are talking about alerts, prompts and confirms, have a look at these APIs


    _lastAlert
    _lastConfirm
    _lastPrompt
    _expectConfirm
    _expectPrompt

    Also have a look at Sahi APIs to familiarize yourself with other available functions.

    Regards,
    Narayan
  • Hi team,

    I am exploring Sahi for the automation of web applications.
    For recording pop ups,
    _expectConfirm("OK", true) solved the problem.
    But I also want to capture the message displayed on the Confirm pop up.
    Any help on this?

    For example:
    As in the link in Sahi website for the "_expectConfirm" description:
    click on the link: "Click for confirm dialog"
    It displays: "This is an example confirm dialog. Get it?"
    How can we capture this message?
    Also, How to capture if it opens a new window?
    Help needed urgently.


    Regards,
    Chejness.
  • Use _lastConfirm()
  • _assertEqual("This is an example confirm dialog. Get it?", _lastConfirm());
    seems not working in my system!
  • Hi,

    I think the first argument in _expectConfirm is the text (label) that appears in the popup. so it should take care of the assertion itself.
    _expectConfirm("The text displayed", true);

    check this:
    http://sahi.co.in/w/_expectconfirm

    Regards,
    Pankaj
  • hey thanks!
    it worked.

    I want to record even the pop up windows, where the pop up is opened as a seperate page?
    Any pointers on this?
  • Hi,

    I suppose it is some thing like:
    Suppose you want to click a link on the pop up page, then u can use:
    _popup("Pop up name or ID")._click("Object name or ID");
    You can use this approach for other actions also.

    Regards,
    Pankaj
  • What about HTML Model and Modeless popup support ? Can these be filled and checked?

    I wish hat this site should explain in details. Comparison with other product. The most missed thing is found was Platform information. What language platform languages are suppored. I really liked the sahi and seem it promising. But you need to show it properly. Check out other web sites like selenium. I found sahi better then selenim especially in terms of flexibility but presentation is not good on web. The user need more info on features of the product and comparisions.
  • Hi Vishal,

    Modal dialogs (alerts, prompts and confirms and windows invoked via ShowModalDialog) are all supported by Sahi. The required APIs are mentioned in one of the previous posts in this thread.

    Regarding the website, other people have also reported similar problems and we are working on it, though it has been a lower priority so far. We are taking this up more seriously now, and you should see a better site in a couple of weeks. We look forward to more comments and feedback from you and others in making Sahi and the eco system better.

    Thanks,
    Narayan
  • How will SAHI behave when there will be another pop up window from first pop up window?
    I tried but it didnt worked to identify it.

    Is it possible to use code like below?

    _popup("Pop Up Test",_popup("Double Pop up",_click(_submit("Text Here"))));
  • It would just be

    _popup("Double Pop up")._click(_submit("Text Here"));
  • i had tried in that manner but it didnt worked. Infact my case for double pop up window sahi is unable to recognized objects.
    I have tried to simulate same thing at other site then ur suggested method worked.
    The issue is with 2nd popup window only. Because when i tried recording/object spying 2nd popup taking 1st popup window as parent then also it didnt worked.
    What could b the reason behind that.
  • I think the second popup is opened via javascript and document.write is being used to populate its body contents. In that case Sahi's code is not injected. If this is the case and you have a sample web page, I can show you how to automate it. You will mostly not be able to record on that window.
  • i too face the same problem in case of pop up. But the interesting thing is that i am able to get value of href value of tag(<a""), but not able to get the value for td.
    My webpage looks somewhat like this :-

    <td input="test" rmbrow="1,2" position="1" title="test">
    <a value="test" href="javascript.xyz" title="test_abc">test_abc</a>
    </td>

    The above code is in the second popup window. When i try to get value for link, it gives me correct value, but it is giving "null" for td.

    var $test_value=_link("test_abc").getAttribute("value");

    when i run this command, it gives me value of $test_value as "test", but when i run similar command

    var $test_table=_cell("test").getAttribute("ïnput");

    it gives me result as "null". tried various combination but of no use.
    Please help

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter