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.

Multiple click while holding Ctrl

JirkaJirka Members
edited November -1 in Sahi - Open Source
Hi,

we have in application "multiple select functionality" done by ajax. What I need is to perform multiple selection by holding CTRL and clicking on desired elements.
I have tried this, but it always selects only one row (span element):
_click(_span("item 1"));
_keyDown(_div("Selectbox"), [17,17])
_click(_span("item 2"));
_click(_span("item 3"));
_keyUp(_div("Selectbox"), [17,17])

I have found one topic here about this problem, but without solution:
http://sahi.co.in/forums/viewtopic.php?id=210

Thanks for help

Comments

  • narayannarayan Administrators
    Hi Jirka,

    _click takes a second parameter for combo: This means you can pass "CTRL", "ALT", "META", "SHIFT" as second parameter to specify combination of keypress and mouse action.

    Try:

    _click(_span("item 1"));
    _click(_span("item 2"), "CTRL");
    _click(_span("item 3"), "CTRL");

    Regards,
    Narayan
  • Thanks, it works :)

    Maybe you should write this into the manual page here:
    http://sahi.co.in/w/_click
  • narayannarayan Administrators
    Done. Thanks for pointing out. We are updating the other APIs too.
This discussion has been closed.