Locators in Selenium (medium)

AwedExuberance avatar
AwedExuberance
·
·
Download

Start Quiz

Study Flashcards

30 Questions

Which command in Selenium IDE is used to locate GUI elements?

locator

What is the most common way of locating elements in Selenium IDE?

By ID

Which locator in Selenium IDE is used to locate elements by their name attribute?

name

Which locator in Selenium IDE is used to locate elements by their link text?

link text

Which locator in Selenium IDE is used to locate elements using the Document Object Model (DOM)?

DOM

Which locator in Selenium IDE is used to locate elements by their ID using the Document Object Model (DOM)?

getElementById

Which locator in Selenium IDE is used to locate elements by their name using the Document Object Model (DOM)?

dom:name

Which method of locating an element through DOM in Selenium collects an array of elements that have the same name?

getElementsByName

What is the syntax for using the getElementById method of DOM in Selenium?

document.getElementById('id of the element')

What is the syntax for using the getElementsByName method of DOM in Selenium?

document.getElementsByName('name')[index]

What is the index number to access the 'Economy class' radio button using the getElementsByName method?

0

What is the index number to access the 'Business class' radio button using the getElementsByName method?

1

What is the method of locating an element through DOM in Selenium that applies only to elements within a named form?

dom:name

What is the syntax for using the dom:name method of DOM in Selenium?

document.forms['name of the form'].elements['name of the element']

Which type of locator in Selenium applies only to hyperlink texts?

Link Text

What is the target format for locating elements by name in Selenium?

name=name_of_the_element

How can filters be used when multiple elements have the same name in Selenium?

By using additional attributes

What is the correct format for locating elements by ID in Selenium?

id=id_of_the_element

What is the correct format for locating elements by class in Selenium?

class=class_of_the_element

How can the Text tool be used in Photoshop CC?

To add text to images

What is a NoSQL database?

A type of database that stores data in a flexible, schema-less format

Which method of locating elements in Selenium IDE can be used even when the element is not within a named form?

Locating by DOM

What is the disadvantage of using XPath as a method of identifying elements in Selenium IDE?

It is the most complicated method

Which method of locating elements in Selenium IDE can access almost any element, even those without class, name, or id attributes?

Locating by XPath

What is the syntax for locating an element by its ID in Selenium IDE?

id=id_of_the_element

What is the syntax for locating an element by its name using filters in Selenium IDE?

filter=value_of_filter

What is the syntax for locating an element by its link text in Selenium IDE?

link=link_text

What is the syntax for locating an element by its name in Selenium IDE?

name=name_of_the_element

What is the syntax for locating an element by its name without using filters in Selenium IDE?

name=name_of_the_element

What is the syntax for locating an element by its index number in Selenium IDE?

index of the element

Study Notes

Locating Elements in Selenium IDE

  • The command used to locate GUI elements in Selenium IDE is not specified, but various locators can be used to locate elements.

Locators in Selenium IDE

  • The most common way of locating elements in Selenium IDE is not specified, but various locators can be used.

By Name Locator

  • The name locator is used to locate elements by their name attribute.
  • The link locator is used to locate elements by their link text.

DOM Locators

  • The dom locator is used to locate elements using the Document Object Model (DOM).
  • The dom:id locator is used to locate elements by their id using the DOM.
  • The dom:name locator is used to locate elements by their name using the DOM.

getElementsByName Method

  • The getElementsByName method collects an array of elements that have the same name.
  • The syntax for using the getElementsByName method is not specified, but the index number is used to access the desired element.
  • The index number to access the 'Economy class' radio button using the getElementsByName method is 0.
  • The index number to access the 'Business class' radio button using the getElementsByName method is 1.

dom:name Method

  • The dom:name method is used to locate elements by their name using the DOM.
  • The syntax for using the dom:name method is dom:name=.
  • The link locator applies only to hyperlink texts.

Target Format for Locating Elements by Name

  • The target format for locating elements by name in Selenium is name=.

Using Filters in Selenium

  • Filters can be used when multiple elements have the same name in Selenium.
  • The syntax for locating an element by its name using filters is name=&filter=.

Locating Elements by ID and Class

  • The correct format for locating elements by ID in Selenium is id=.
  • The correct format for locating elements by class in Selenium is class=.

XPath Locator

  • XPath is a method of locating elements in Selenium IDE that can access almost any element, even those without class, name, or id attributes.
  • The disadvantage of using XPath is not specified.

Other Locators

  • The css locator can be used even when the element is not within a named form.
  • The syntax for locating an element by its ID in Selenium IDE is id=.
  • The syntax for locating an element by its name using filters is name=&filter=.
  • The syntax for locating an element by its link text is link=.
  • The syntax for locating an element by its name is name=.
  • The syntax for locating an element by its name without using filters is name=.
  • The syntax for locating an element by its index number is index=.

Learn how to use locators in Selenium IDE to successfully click on the "REGISTER" link and navigate to the registration page using the Document Object Model (DOM). Master the technique of accessing page elements in Selenium IDE.

Make Your Own Quizzes and Flashcards

Convert your notes into interactive study material.

Get started for free
Use Quizgecko on...
Browser
Browser