Sometimes we face some editboxes in the application that shows suggestions while you type. In some of the application you need to choose from that suggestions only to filled the edit box else it won't consider .
If you will simple type in the editbox using type method it won't give you any suggestion coz it works on keyevent so to see the suggestion you will require to use the keyPressNative() method.
While typing TEST11 in the autocomplete field
If you 'll use simply type() method,
You need to use like the following:
If you will simple type in the editbox using type method it won't give you any suggestion coz it works on keyevent so to see the suggestion you will require to use the keyPressNative() method.
While typing TEST11 in the autocomplete field
If you 'll use simply type() method,
- selenium.type("locator-of-the-autosuggest-element", "TEST11");
You need to use like the following:
- selenium.focus("locator-of-the-autosuggest-element");
- selenium.keyPressNative("32"); //space
- selenium.keyDownNative("16"); //SHIFT ON
- selenium.keyPressNative("84"); //T
- selenium.keyPressNative("69"); //E
- selenium.keyPressNative("83"); //S
- selenium.keyPressNative("84"); //T
- selenium.keyUpNative("16"); // SHIFT OFF
- selenium.keyPressNative("49"); //1
- selenium.keyPressNative("49"); //1
- selenium.type("locator-of-the-autosuggest-element", "TEST1");
- selenium.focus("locator-of-the-autosuggest-element");
- selenium.keyPressNative("49"); //1
No comments:
Post a Comment