It is important to note that there are a few projects done in real-time and in which the Python Selenium WebDriver may be unable to execute certain directives on its own. This may be in relation to a certain web element pertaining to the end user for example.
An example of this can be seen below;
The following can be derived from the example above;
The initial matching web element should first be acted on and you can derive this through index . Note that every one of the matching web elements should be returned.
The index of the web element which you intend acting on can be used directly, such as; getElementsByName(‘username’) 
You first have to inspect the web element and then capture it with the use of an in-built system of the Python Selenium WebDriver, such as;‘find_element_by_xpath’
userName = driver.find_element_by_xpath(“//button[@name=’username’]”)
arguments . click ()
You can summaries these couple of code lines above in the following way;
There is a code line that you can use in ensure a quick scroll to the bottom of a web page on your website project. This code line is;
A typical example of this is;
Here the index is paramount and NOT the sequence in which the web elements are utilized.
driver.execute_script(“arguments.click();arguments.click();”, userName, password)
Using Python Selenium WebDriver to Capture Web Element values
You can use Python Selenium WebDriver to capture web element values. So in effect values can be returned using execute_script().
This is explained further in the example below;
Case Study 1:
‘print driver.execute_script(‘return document.getElementById(“fsr”).innerText’)‘ attempts to read out web element property. However, the web element cannot be found on the web page.
In this case study, the following message is indicated;
selenium.common.exceptions.WebDriverException: Message: unknown error: Cannot read property ‘innerText’ of null
Case Study 2:
As you can see, there is a spelling error in the “click action” name. Instead of “click ()”, you have “click ()”.
selenium.common.exceptions.WebDriverException: Message: unknown error: document.getElementById(…).clic is not a function
Every single action can be summaries as follows;
● Derive the attribute or text of a web element.
● Locate a web element.
● Perform an action on the web element, such as; “click ()”.
● Alter a web element’s attributes.
● Scroll on a web page to a particular location or to a web element.
● Be patient and wait whilst the loading of the web page is in progress.