Selenium "keyDown" command to select value from auto complete field

Selecting value from auto complete field is little hard if you are not aware about proper key sequence technique. Just "type" command will not provide you list of value suggestions on auto complete field. "sendKeys" command will provide you list of value suggestions on auto complete field but to select value
from that drop down, you need to use "keyDown" command in selenium IDE.

"keyDown" command
"keyDown" command works like user is pressing keyboard key but not releasing it. You can press any key of keyboard using "keyDown" command. You need to provide single character or ASCII value of any key into value column of "keyDown" command. Let me give you an example.

New Test
CommandTargetValue
openhttp://jqueryui.com/autocomplete/
typeid=tagsa
keyDownid=tags\40
keyDownid=tags\40
keyDownid=tags\40
keyDownid=tags\40
keyDownid=tags\40
pause5000
keyDownid=tags\13
In above example, 1st “keyDown” command will open related keyword suggestion drop down for character “a” by pressing down arrow key. You need to use ASCII value (“\40”) of down arrow of keyboard in value column. 2nd “keyDown” command will select first value from suggestion drop down. 3rd “keyDown” command will move value selection to one step down. In this way, 5th “keyDown” command will select 4th  value from suggestion drop down. Last “keyDown” command will press enter button(“\13” is ASCII value of “Enter” button of keyboard) text box will be filled with last selected value. In this way you can select value from auto complete text box drop down. Try above example practically to get it better.

6 comments:

  1. hello sir....this is chandu.please give me answer...in my application i have a popup.without know id,name,title of popup..how can i handle popups please

    ReplyDelete
  2. hello sir...please tell me..

    how to iframes,flashes in selenium when objects of iframes,flashes are identifying at runtime..please give me answers

    ReplyDelete
  3. Hi,

    I'm having an issue when attempting to record and executing a particular item from suggest list.

    The field works this way: You type three letters and a suggest list must be displayed, which actually works on the app. But the thing is that when i attempt to execute the steps with selenium IDE, the suggest list it not being shown.

    Can you please give a hand with this?

    ReplyDelete
    Replies
    1. use following commands
      Sendkeys
      Waitforvisible
      ClickAt

      Delete
  4. Hi,

    I'm having an issue when attempting to record and executing a particular item from suggest list.

    The field works this way: You type three letters and a suggest list must be displayed, which actually works on the app. But the thing is that when i attempt to execute the steps with selenium IDE, the suggest list it not being shown.



    Can you please give a hand with this?

    ReplyDelete
  5. hi ,
    This is Swagatika. Let be i have a country dropdown having all the country in this world. and the dropdown box follows typeahead search. E.g: i type "united" in the dropdown and it will show you all the country which are partially matches with "United" but i have to select "United States of America" then how can i do that in Selenium IDE. please Suggest me.

    ReplyDelete