1
votes

I'm using de Selenium IDE ( firefox addon ) and I want to execute ctrl + click on an element.

The record function, doesn't seem to record the "Ctrl+Click" command.

I tried to use SendKeys, but I can't find a special key for Click.

Anyone that knows how to do this?

2

2 Answers

0
votes

The solution I found so far is to use the command runScript like this:

var e = jQuery.Event("click"); e.ctrlKey = true; $('#id').trigger(e);

0
votes

There is controlKeyDown ( ) command and corresponding controlKeyUp() command. It worked for me:
click|item_1
controlKeyDown
click|item_2
click|item_3
...
controlKeyUp

Also, see Sel IDE reference:
controlKeyDown( ): Press the control key and hold it down until doControlUp() is called or a new page is loaded.
controlKeyUp ( ): Release the control key.

Just found some alternative way on this link:
sendKeys | id=search | o${KEY_CTRL}${KEY_LEFT}${KEY_CTRL}g