×
☰ See All Chapters

Selenium IDE Selenese Commands

To create test scripts manually we use commands called as selenese commands. Below is the list of available selenese commands:

  1. add selection 

  2. answer on next prompt 

  3. assert 

  4. assert alert 

  5. assert checked 

  6. assert confirmation 

  7. assert editable 

  8. assert element present 

  9. assert element not present 

  10. assert not checked 

  11. assert not editable 

  12. assert not selected value 

  13. assert not text 

  14. assert prompt 

  15. assert selected value 

  16. assert selected label 

  17. assert text 

  18. assert title 

  19. assert value 

  20. check 

  21. choose cancel on next confirmation 

  22. choose cancel on next prompt 

  23. choose ok on next confirmation 

  24. click 

  25. click at 

  26. close 

  27. debugger 

  28. do 

  29. double click 

  30. double click at 

  31. drag and drop to object 

  32. echo 

  33. edit content 

  34. else 

  35. else if 

  36. end 

  37. execute script 

  38. execute async script 

  39. for each 

  40. if 

  41. mouse down 

  42. mouse down at 

  43. mouse move at 

  44. mouse out 

  45. mouse over 

  46. mouse up 

  47. mouse up at 

  48. open 

  49. pause 

  50. remove selection 

  51. repeat if 

  52. run 

  53. run script 

  54. select 

  55. select frame 

  56. select window 

  57. send keys 

  58. set speed 

  59. set window size 

  60. store 

  61. store attribute 

  62. store json 

  63. store text 

  64. store title 

  65. store value 

  66. store window handle 

  67. store xpath count 

  68. submit 

  69. times 

  70. type 

  71. uncheck 

  72. verify 

  73. verify checked 

  74. verify editable 

  75. verify element present 

  76. verify element not present 

  77. verify not checked 

  78. verify not editable 

  79. verify not selected value 

  80. verify not text 

  81. verify selected label 

  82. verify selected value 

  83. verify text 

  84. verify title 

  85. verify value 

  86. wait for element editable 

  87. wait for element not editable 

  88. wait for element not present 

  89. wait for element not visible 

  90. wait for element present 

  91. wait for element visible 

  92. webdriver answer on visible prompt 

  93. webdriver choose cancel on visible confirmation 

  94. webdriver choose cancel on visible prompt 

  95. webdriver choose ok on visible confirmation 

  96. while 

These Selenium commands can be classified into three flavours: Actions, Accessory and Assertions.

Actions: user actions on application / Command the browser to do something. Actions are commands that generally manipulate the state of the application.

e.g.         1. Click link- click / Clickandwait

  2. Selecting items

Accessors: Accessors examine the state of the application and store the results in variables, e.g. "storeTitle".

Assertions: For validating the application we are using Assertions

  1. For verifying the web pages 

  2. For verifying the text 

  3. For verifying alerts 

       Assertions can be used in 3 modes:

  1. assert 

  2. verify 

  3. waitFor  

Example: "assertText","verifyText" and "waitForText".

NOTE:

     1. When an "assert" fails, the test is aborted.

     2. When a "verify" fails, the test will continue execution

     3. "waitFor" commands wait for some condition to become true

Commonly Used Selenium Commands

These are probably the most commonly used commands for building test.

open - opens a page using a URL.

click/clickAndWait - performs a click operation, and optionally waits for a new page to load.

verifyTitle/assertTitle - verifies an expected page title.

verifyTextPresent- verifies expected text is somewhere on the page.

verifyElementPresent -verifies an expected UI element, as defined by its HTML tag, is present on the page.

verifyText  - verifies expected text and it’s corresponding HTML tag are present on the page.

verifyTable - verifies a table’s expected contents.

waitForPageToLoad  -pauses execution until an expected new page loads. Called automatically when clickAndWait is used.

waitForElementPresent -pauses execution until an expected UI element, as defined by its HTML tag, is present on the page.

 

 


All Chapters
Author