SUBSCRIBE HERE TO GET POST UPDATES VIA EMAIL :

Delivered by FeedBurner

Use of "altKeyDown" and "altKeyUp" in selenium with example

"altKeyDown" command

"altKeyDown" command works just like you are pressing alt key of your keyboard. It will keep pressed alt key until "altKeyUp" not executed. You can use this command when you need to perform any action by pressing alt key.

Let me show you use of "altKeyDown" command with example. In bellow given example, altKeyDown command will press and hold alt key down then click command will click on targeted element.

New Test
CommandTargetValue
openhttps://www.google.co.in/
altKeyDown

clickcss=#gb_2 > span.gbts
altKeyUp


"altKeyUp" command


"altKeyUp" will release the pressed alt key. In above example, altKeyUp command will release pressed alt key using altKeyDown command.

3 comments:

  1. Good to know, I would like to share one of the Software Testing Company. Indium software is one of the best Independent software testing company* established in 1999 | offshore QA Firm | Offshore & In-Housing Software Testing Services. Indium has its registered office in California, Georgia and also has multiple offshore delivery centers in India.
    Services like Mobile application testing services, Game software testing services, Software Testing services, QA services, Software verification and validation, Offshore Software testing, QA Validation services, Test consulting services, automated software testing, quality assurance software, web based application testing .

    ReplyDelete
  2. Hello,
    Pls clarify on the below:
    In the above example when executed altkeydown menu bar is not shown in google page .

    click css=#gb_2 > span.gbts(Are you clicking on menu bar or anywhere for the menu to go off)

    ReplyDelete
  3. does this works for do scroll up and down?

    ReplyDelete