Selenium - Selenese Commands


Advertisements


A command refers to what Selenium has to do and commands in selenium are of three types. Click on each one of them to know more about the commands.

Locators

Element Locators help Selenium to identify the HTML element the command refers to. All these locators can be identified with the help of FirePath and FireBug plugin of Mozilla. Please refer the Environment Setup chapter for details.

  • identifier = id Select the element with the specified "id" attribute and if there is no match, select the first element whose @name attribute is id.

  • id = id Select the element with the specified "id" attribute.

  • name = name Select the first element with the specified "name" attribute

  • dom = javascriptExpression Selenium finds an element by evaluating the specified string that allows us to traverse through the HTML Document Object Model using JavaScript. Users cannot return a value but can evaluate as an expression in the block.

  • xpath = xpathExpression Locate an element using an XPath expression.

  • link = textPattern Select the link element (within anchor tags) which contains text matching the specified pattern.

  • css = cssSelectorSyntax Select the element using css selector.



Advertisements