Skip to main content

You are here

FindElement

Automate the log in steps for this website.

The following would be the manual steps required to log on to the test user account for "TestLogin". I have created this account for this exercise.

Username: TestLogin
Password: TestPassword

The manual steps are:

Various ways to locate an element on a page

These are the various way to locate or find elements on a page. I made the compilation from the SeleniumHQ website. Very handy snippets for the office.

By ID
====

This is the most efficient and preferred way to locate an element. Common pitfalls that UI developers make is having non-unique id’s on a page or auto-generating the id, both should be avoided. A class on an html element is more appropriate than an auto-generated id.
Example of how to find an element that looks like this:
<div id="firstname">...</div>

Tags: 

Premium Drupal Themes by Adaptivethemes