"focus" Command in Selenium IDE
"focus" is useful to set focus on targeted fields. Generally it is used with input fields like text box, text area, radio button, check box, button etc.. It will simply move cursor on targeted element or field.
Selenium "keyUp" Command
works in that case you can try combination of "keyDown" and "keyUp" command. "keyPress" works as user pressing and releasing a key while "keyDown" simulates a user pressing a key and "keyUp" for user releasing a key. In this way "keyPress" command = "keyDown" + "keyUp" commands.
Let we look "focus", "keyDown" and "keyUp" command with example.
New Test | ||
Command | Target | Value |
open | http://only-testing-blog.blogspot.com/p/blog-page.html | |
focus | //input[@id='group_515952624_1'] | |
keyDown | //input[@id='group_515952624_1'] | \32 |
pause | 5000 | |
keyUp | //input[@id='group_515952624_1'] | \32 |
Above example will just select "Please be agree to publish your topic on our blog" check box and you can do it simply with "click" or "select" command but here my concern is to showing you an example of "focus" "keyDown" and "keyUp" commands.
- 2nd command "focus" will set focus on "Please be agree to publish your topic on our blog" check box.
- 3rd command, will press and hold 'space' key of keyboard.
- 5th command will release 'space' key of keyboard.
Here, "keyPress" command is not working(you can try it) so that i used "keyDown" + "keyUp" commands as an alternate of "keyPress" command.
No comments:
Post a Comment