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.

Shift Click

kchankchan Members
edited November -1 in Sahi - Open Source
Are you able to get this working? I have a similar requirement, but I need to perform SHIFT + Click.

Comments

  • narayannarayan Administrators
    Hi kchan,

    For shift click, could you try:

    _keyDown(element, [16,0], "SHIFT"); // press down shift key
    _click(element);
    _keyUp(element, [16,0], "SHIFT"); // leave shift key

    Regards,
    Narayan
  • kchankchan Members
    Thanks for the reply. However, your suggestion does not work. I'ved tried it in both Firefox 3 and Internet Explorer 6.

    I've also tried:
    _keyDown(element, 0, "SHIFT"); // press down shift key
    _click(element);
    _keyUp(element, 0, "SHIFT"); // leave shift key

    I looked at concat.js and think I'd be able to hack in something to simulateMouseEvent() to set event.shiftKey = true, but I'd prefer not to resort to that.

    I would've thought _keyDown() would apply the keypress to all relevent events until I specifically call _keyUp(); that's what selenium does anyhow.
Sign In or Register to comment.