Selenium Tutorial Day 33 - Concepts
Selenium Tutorial Day 33 - Concepts
Selenium
Web Test Tool Training
Discover the automating power of Selenium
Presented by:
Kangeyan Passoubady (Kangs)
Copy Right: 2009-2011, All rights reserved by Kangeyan Passoubady (Kangs). Republishing requires author’s permission
3
Day
Selenium Concepts
types:
●Actions – Command the browser to do
something
●Accessors – Store/retrieve data from selenium
variables
●Asserts – Verify that the browser is in a certain
state
generate Assertions.
checkbox is checked".
All Selenium Assertions can be used in 3 modes: "assert",
●
"verify", and "waitFor".
●Example include, "assertText","verifyText" and "waitForText".
●When an "assert" fails, the test is aborted. When a "verify"
fails, the test will continue execution, logging the failure.
●This allows a single "assert" to ensure that the application is on
the correct page, followed by a bunch of "verify" assertions to test
form field values, labels, etc.
●"waitFor" commands wait for some condition to become true
(which can be useful for testing Ajax applications).
Discover the automating power of
Selenium Copyright © 2008-2011
Discover the automating power of Selenium
by Kangeyan Passoubady
Copyright © 2008-2011 by Kangeyan Passoubady (Kangs)
(Kangs) *
Selenium Parameters
● Two types of Selenium Parameters
●Locators – Used to find elements in html
trees
●Pattern Matchers – Used to verify values
●Id based,
or regular expressions
Discover the automating power of
Selenium Copyright © 2008-2011
Discover the automating power of Selenium
by Kangeyan Passoubady
Copyright © 2008-2011 by Kangeyan Passoubady (Kangs)
(Kangs) *
Selenium Element Locators
● Element Locators tell Selenium which HTML element a
command refers to.
●Many commands require an Element Locator as the "target"
attribute.
●Examples of Element Locator's include "elementId" and
"document.forms[0].element".
●The format of a locator is: locatorType=argument.
●To locate elements use identifier, id, name, DOM, CSS, XPath,
and link. Without an explicit locator prefix, Selenium uses the
following default strategies:
●DOM, for locators starting with "document.“
●XPath, for locators starting with "//“
●identifier, otherwise
Selenium IDE.
●Usually the ones that won't be
Javascript event
●No event triggered means Selenium