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.

Need help with recording menu dropdowns created using javascript!!

absolut_lukeabsolut_luke Members
edited November -1 in Sahi - Open Source
Hey all,
In the testing i was doing the other day, we have a bunch of menu dropdowns on the web page. All these dropdown items are updated through javascript and not through actual html markup.
Physically it is not possible to find any html element in the html source. B'coz of this, i am unable to record the clicks made on any of the dropdowns ..
Any help in this matter will b appreciated. tx

-henal

Comments

  • narayannarayan Administrators
    Henal,

    Why are you unable to record it? Does Sahi not identify those elements?
    Please tell us the browser and Sahi version you use.

    Regards,
    Narayan
  • firefox 3.0.10
    sahi - 2009-03-04
    the thing is, it records something of the type -

    _click(_link("mmlink1"));

    this same command is recorded for any click in the menu (no matter what option in the dropdown or which dropdown you are selecting) .... also, on playback, this command fails.
  • hey narayan,
    i have logged an example for this .. please find the details below:

    website: gs.com (www2.goldmansachs.com)

    test script:

    _click(_image("Services"));
    _click(_link("Environment"));
    _click(_link("\ucc44\uc6a9\uc815\ubcf4 (\ud55c\uad6d\uc5b4)"));
    _click(_link("Learn about our Divisions"));
    _click(_image("Technology"));


    when you visit the website .... you'll see that for the second command in the script _click(_link("Environment")) , the link environment is in the dropdown of "Citizenship".
    Now, in my first test, the test failed here itself b'coz it couldn't open the dropdown and hence was unable to find the link "Environment".
    For my second test, once the script reached that part, i manually hovered my mouse over the "Citizenship" tab and hence the dropdown came into picture and went through successfully.

    Please tell me what i need to overcome this. Do let me know if you need more information. Thanks.


    -henal
  • narayannarayan Administrators
    Henal,

    You need to add a mouseOver step before you click the menu.

    _click(_image("Services"));
    _mouseOver(_image("Citizenship"));
    _click(_link("Environment"));

    Mouseovers are not automatically recorded by Sahi (other wise there will be too many unnecessary statements when ever you move your mouse).

    In the last stable build, elements were clickable only when visible.
    This has been made optional in the coming build and the recorded code will work even though the link is not visible. You can choose to keep it strict or lenient via sahi.properties. The next build will be available in a couple of days.

    Regards,
    Narayan
  • is it possible to simulate _mouseOver??? something like Ctrl+hover themouse .... just curious.. .

    I am not sure if the solution provided by you will help me solve the main issue. Will document and post it shortly .... hopefully it will work fine ... tx !!

    -henal
  • also, i never really came across _mouseOver in any of the documentation ..... can you please point me to a location where i can find simple tricks like this one :) ..
    tx :)

    -henal
Sign In or Register to comment.