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.

IE autocompleter

ClaritasClaritas Members
edited November -1 in Sahi - Open Source
OS: Windows XP
Browser: Internet Explorer 8
Sahi Build: v3.5, 2011-07-19

I found Sahi a few days ago, and I really enjoyed playing with it.
It worked quite well, until I tried out one of my testcase with IE.

The autocompleter doesn't want work when I search for something.
* For example if I visit Google => type "sahi t" => choose "sahi testing"
~> The recording will fail.
* Or if I go to ingatlannet.hu => type "Szeg" => choose "Szeged"
~> The Sahi Controllel can record it, so it will work with Chrome or Firefox but IE refuses it.

I've already tried _keyDown, _keyUp, _keyPress, _type but nothing worked.
Is there any idea?:(

Comments

  • narayannarayan Administrators
    Sahi records only when the focus has left a particular field. In case of google search field, the focus never goes out of the textbox, so it does not record.

    _setValue(_textbox("q"), "sahi t");

    works in a script.

    Regards,
    Narayan
  • ClaritasClaritas Members
    edited December 2011
    But I need to check somehow the autocompleter part in a company site, because my boss said that. The _setValue() is okay, but that is just the typing part ... I can't record choosing options from the autocompleter list. Our testcases in Selenese atm, and my task is to rewrite them. We have got a lot of testcases, so I need to choose the best testing solution. The IE was always critical for us, so we often checked the autocompleters.

    The old testcase could select from the autocompleter list. I found Sahi so nice, but if it can't support every function, maybe I need to choose something else. The strangest thing Sahi might supports it, because it is good in firefox or chrome. :S
  • narayannarayan Administrators
    Hi Claritas,

    The code below seems to work. Could you please check if this works for you?

    _navigateTo("http://www.google.co.in/";);
    _setValue(_textbox("q"), "sahi to");
    _click(_cell("sahi tool"));

    Regards,
    Narayan
  • Dear Narayan,
    Of course I check every reply, because I don't want to give up!:)
    I tried it with Firefox and Chrome, and it was fine.
    After that I checked it with IE.

    The fully detailed description:
    1. In the Playback window...
    _navigateTo("..."); // sorry I can't post links, so I replaced it with dots ...
    _click(_cell("sahi tool"));
    --Stopped Playback: FAILURE--

    2. In the Logs...
    Test Total Steps Failures Errors Success Rate Time Taken (ms)
    real.sah 3 0 1 66% 15917

    Starting script
    _navigateTo("..."); at 2011.12.16. 9:20:55 // can't post links
    _setValue(_textbox("q"), "sahi to"); at 2011.12.16. 9:20:56
    _click(_cell("sahi tool"));
    Error: The parameter passed to _click was not found on the browser at 2011.12.16. 9:21:07
    Stopping script

    3. What I can see...
    * It navigated to the Google fine.
    * It could type the good value
    * I couldn't see the autocompleter list, so Sahi couldn't choose from it.

    I remember for that in FF or Chrome there was a bit waiting, and after that the autocompleter list appeared.
    If you want, I can create a video, but I think I wrote down everything. :$
    (In IE I've already visited the SSL manager.)
  • I tried it more time, because ... I hoped there will be different result, and it became different. The strange is that once it was good ... so I became excited. But after that when I started the test again, the IE crashed. If I try again that test atm, the IE crashes every time. So I went to different site (ingatlannet.hu)

    The Code...
    _setValue(_textbox("telepules"), "Szeg");
    _click(_listItem("Szeged[1]"));

    The Controllel...
    _setValue(_textbox("telepules"), "Szeg");
    _click(_listItem("Szeged[1]"));
    --Stopped Playback: FAILURE--

    The Logs...
    Test Total Steps Failures Errors Success Rate Time Taken (ms)
    iefix.sah 2 0 1 50% 13326

    Starting script
    _setValue(_textbox("telepules"), "Szeg"); at 2011.12.16. 9:54:00
    _click(_listItem("Szeged[1]"));
    Error: The parameter passed to _click was not found on the browser at 2011.12.16. 9:54:11
    Stopping script
  • I tried out with IE6,7 and 9 too. In IE9 everything is fine, but with previous versions the test gets failed.
  • narayannarayan Administrators
    Hi Claritas,

    The reason Sahi did not work on your application for IE versions < 9 was because your application uses a javascript library called MooTools which overwrites the native fireEvent function of the browser in an incompatible way. In order to fix this problem, do the following:

    Open sahi/htdocs/spr/concat.js

    1) Search for

    el.fireEvent("on" + type, evt);

    and replace it with

    el.fireEvent(this.getEventTypeName(type), evt);

    2) Search for

    target.fireEvent("on" + evType, evt);

    and replace it with

    target.fireEvent(this.getEventTypeName(evType), evt);

    3) At the end of concat.js, add

    Sahi.prototype.getEventTypeName = function (type) {
    return ((typeof MooTools) == "object") ? type : ("on" + type);
    }

    4) Restart Sahi, clear browser cache, and test again.

    Regards,
    Narayan
  • Dear Narayan,

    Thanks a lot for the reply, everything works fine everywhere!
    I'm sure in that I can rewrite all the tests to Sahi. :)

    Best wishes,
    Claritas
This discussion has been closed.