List of functions Last updated: 2022-10-01

Section intro goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque finibus condimentum nisl id vulputate. Praesent aliquet varius eros interdum suscipit. Donec eu purus sed nibh convallis bibendum quis vitae turpis. Duis vestibulum diam lorem, vitae dapibus nibh facilisis a. Fusce in malesuada odio.

Functions available

Vivamus efficitur fringilla ullamcorper. Cras condimentum condimentum mauris, vitae facilisis leo. Aliquam sagittis purus nisi, at commodo augue convallis id.

Todo

Vivamus efficitur fringilla ullamcorper. Cras condimentum condimentum mauris, vitae facilisis leo. Aliquam sagittis purus nisi, at commodo augue convallis id. Sed interdum turpis quis felis bibendum imperdiet. Mauris pellentesque urna eu leo gravida iaculis. In fringilla odio in felis ultricies porttitor. Donec at purus libero. Vestibulum libero orci, commodo nec arcu sit amet, commodo sollicitudin est. Vestibulum ultricies malesuada tempor.

Function request

Vivamus efficitur fringilla ullamcorper. Cras condimentum condimentum mauris, vitae facilisis leo. Aliquam sagittis purus nisi, at commodo augue convallis id. Sed interdum turpis quis felis bibendum imperdiet. Mauris pellentesque urna eu leo gravida iaculis. In fringilla odio in felis ultricies porttitor. Donec at purus libero. Vestibulum libero orci, commodo nec arcu sit amet, commodo sollicitudin est. Vestibulum ultricies malesuada tempor.

Displaying Website URL

All commands related to URL.

.display_url()

This command prints the url of the main url sent to the webdriver.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_url()
Report Bugs

.return_url()

This command returns the url of the main url sent to the webdriver.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   website_url = run.return_url()
   print(f"Website url is: {website_url}")
Report Bugs

.valid_url()

This command checks and returns the url if its valid, if it is not valid (in case of a wrong website url, or a non working localhost url) it asserts false.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.valid_url("http://wrongurl.com")

Tip

If you see this error: AssertionError: Please enter a valid URL... http://127.0.0.1:5500/sample.html is not a valid URL. then you need to run the webpage on your localhost.

Report Bugs

.input()

This function takes an input and types it into the path given to the element.

With X-path

There are many ways of selecting an element, the most effective way is using XPATH.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.input("xpath", "//path", "Sample Value")
Report Bugs

With CSS

If XPATH is not what works great for the work, CSS selector is also an option.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.input("css", "//path", "Sample Value")
Report Bugs

Other Selectors

Other selectors which can be used:

# Selector Usage
1 name run.input("name", "//path", "Sample Value")
2 link_text run.input("link_text", "//path", "Sample Value")
3 partial_link_text run.input("partial_link_text", "//path", "Sample Value")
4 tag_name run.input("tag_name", "//path", "Sample Value")
5 class_name run.input("class_name", "//path", "Sample Value")
Report Bugs

.button()

This function takes an input of the element path and clicks it..

With X-path

There are many ways of selecting an element, the most effective way is using XPATH.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.button("xpath", "//path")
Report Bugs

With CSS

If XPATH is not what works great for the work, CSS selector is also an option.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.button("css", "//path")
Report Bugs

Other Selectors

# Selector Usage
1 name run.button("name", "//path")
2 link_text run.button("link_text", "//path")
3 partial_link_text run.button("partial_link_text", "//path")
4 tag_name run.button("tag_name", "//path")
5 class_name run.button("class_name", "//path")

.static_dropdown()

This command picks and selects the value under a select tag.

With X-path

There are many ways of selecting an element, the most effective way is using XPATH.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.static_dropdown("xpath", "//path", "index", "3")
Report Bugs

With CSS

If XPATH is not what works great for the work, CSS selector is also an option.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.static_dropdown("css", "//path", "index", "3")
Report Bugs

Types of actions

There are 3 ways by which you can select a value from the dropdown. index takes the position of the element;value takes the value given to that particular element; visible takes the element name given in the dropdown.

With index:
from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.static_dropdown("xpath", "//path", "index", "3")
With value:
from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.static_dropdown("xpath", "//path", "value", "1")
With visibility:
from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.static_dropdown("xpath", "//path", "visible", "OptionName")
Report Bugs

Other Selectors

# Selector Usage
1 name run.static_dropdown("name", "//path", "value", "1")
2 link_text run.static_dropdown("link_text", "//path", "value", "1")
3 partial_link_text run.static_dropdown("partial_link_text", "//path", "value", "1")
4 tag_name run.static_dropdown("tag_name", "//path", "value", "1")
5 class_name run.static_dropdown("class_name", "//path", "value", "1")

.dynamic_dropdown()

This command picks and selects the value under a dynamic dropdown. The first path is for the dropdown, and the second path is for all the elements under the dropdown.

With X-path

There are many ways of selecting an element, the most effective way is using XPATH. Here the second path can be any, CSS or XPATH or other provided options.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.dynamic_dropdown("input", "xpath", "//path", "i", "xpath", "//path", "index", "4")
Report Bugs

With CSS

If XPATH is not what works great for the work, CSS selector is also an option. Here the second path can be any, CSS or XPATH or other provided options.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.dynamic_dropdown("input", "css", "//path", "i", "xpath", "//path", "index", "4")
Report Bugs

Types of actions

There are 2 ways by which you can select a value from the dropdown. index takes the position of the element;value takes the exact name of a specific dropdown element.

With index:
from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.dynamic_dropdown("input", "xpath", "//path", "i", "xpath", "//path", "index", "4")
With value:
from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.dynamic_dropdown("input", "xpath", "//path", "i", "xpath", "//path", "value", "India")

Other Selectors

# Selector Usage
1 name run.dynamic_dropdown("input", "name", "//path", "i", "xpath", "//path", "index", "4")
2 link_text run.dynamic_dropdown("input", "link_text", "//path", "i", "xpath", "//path", "index", "4")
3 partial_link_text run.dynamic_dropdown("input", "partial_link_text", "//path", "i", "xpath", "//path", "index", "4")
4 tag_name run.dynamic_dropdown("input", "tag_name", "//path", "i", "xpath", "//path", "index", "4")
5 class_name run.dynamic_dropdown("input", "class_name", "//path", "i", "xpath", "//path", "index", "4")

.slowmo()

This command slows down the browser instance for the inputted time in seconds. (This does not slow the whole browser instance, it only slows it for that particular command and continues back with its original speed.)

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.slowmo(2)
Report Bugs

Dealing with alert boxes

This command helps you to accept, decline and print the text of an alert box.

.popup_accept()

Use this command to accept an alert box.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.popup_accept()
Report Bugs

.popup_decline()

Use this command to decline an alert box.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.popup_decline()
Report Bugs

.popup_text

Use this command to print the text displayed on the alert box..

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   popup_text = run.popup_text()
   print(f"This is the popup text: {popup_text}")
Report Bugs

.file_upload()

This command lets you input your absolute filepath and upload it to the element which requires an upload.

With X-path

There are many ways of selecting an element, the most effective way is using XPATH.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.file_upload("xpath", "//path", "filepath")
Report Bugs

With CSS

If XPATH is not what works great for the work, CSS selector is also an option.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.file_upload("css", "//path", "filepath")
Report Bugs

Other Selectors

# Selector Usage
1 name run.file_upload("name", "//path", "filepath")
2 link_text run.file_upload("link_text", "//path", "filepath")
3 partial_link_text run.file_upload("partial_link_text", "//path", "filepath")
4 tag_name run.file_upload("tag_name", "//path", "filepath")
5 class_name run.file_upload("class_name", "//path", "filepath")

Waits

Waits are used when you have the automated task execution elapse a certain amount of time before continuing with the next step.

.implicit_wait()

By implicitly waiting, WebDriver polls the DOM for a certain duration when trying to find any element. This can be useful when certain elements on the webpage are not available immediately and need some time to load. Value is given in seconds.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.implicit_wait(4.5)
Report Bugs

.explicit_wait()

This allow your code to halt program execution, or freeze the thread, until the condition you pass it resolves. The condition is called with a certain frequency until the timeout of the wait is elapsed. This means that for as long as the condition returns a falsy value, it will keep trying and waiting. This command requires you to input, the time period (in seconds), the condition to perform, here again you have choice for xpath/css or other provided selectors, and lastly you have to provide the selector path.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.explicit_wait(5, "element_to_be_clickable", "xpath", "//path]")
Report Bugs

.mouse_hover()

This command lets you hover the mouse over an element.

With X-path

There are many ways of selecting an element, the most effective way is using XPATH.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.mouse_hover("xpath", "//path")
Report Bugs

With CSS

If XPATH is not what works great for the work, CSS selector is also an option.

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.mouse_hover("css", "//path")
Report Bugs

Other Selectors

# Selector Usage
1 name run.file_upload("name", "//path", "filepath")
2 link_text run.file_upload("link_text", "//path", "filepath")
3 partial_link_text run.file_upload("partial_link_text", "//path", "filepath")
4 tag_name run.file_upload("tag_name", "//path", "filepath")
5 class_name run.file_upload("class_name", "//path", "filepath")

Clicks

.right_click()

This command is used to right click on an element or anywhere on the browser window.

With X-path

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.right_click("xpath", "//path")
Report Bugs

With CSS

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.right_click("css", "//path")
Report Bugs

.double_click()

This command is used to double click on an element or anywhere on the browser window.

With X-path

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.double_click("xpath", "//path")
Report Bugs

With CSS

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.double_click("css", "//path")
Report Bugs

.right_click()

# Selector Usage
1 name run.right_click("name", "//path")
2 link_text run.right_click("link_text", "//path")
3 partial_link_text run.right_click("partial_link_text", "//path")
4 tag_name run.right_click("tag_name", "//path")
5 class_name run.right_click("class_name", "//path")

.double_click()

# Selector Usage
1 name run.double_click("name", "//path")
2 link_text run.double_click("link_text", "//path")
3 partial_link_text run.double_click("partial_link_text", "//path")
4 tag_name run.double_click("tag_name", "//path")
5 class_name run.double_click("class_name", "//path")

Frames

.shift_to_frame()

Use this command to shift to a frame and perform other functions in the frame provided.

With X-path

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.shift_to_frame("xpath", "//iframe")
Report Bugs

With CSS

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.shift_to_frame("css", "//iframe")
Report Bugs

.leave_frame()

Use this function to exit from the current frame and perform other functions to the webpage.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.leave_frame()
Report Bugs

Other Selectors

How to dapibus sollicitudin justo vel fermentum?

Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui.

How long bibendum sodales?

Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui.

Where dapibus sollicitudin?

Aenean et sodales nisi, vel efficitur sapien. Quisque molestie diam libero, et elementum diam mollis ac. In dignissim aliquam est eget ullamcorper. Sed id sodales tortor, eu finibus leo. Vivamus dapibus sollicitudin justo vel fermentum. Curabitur nec arcu sed urna gravida lobortis. Donec lectus est, imperdiet eu viverra viverra, ultricies nec urna.

Displaying Text

.return_text()

This command returns the text written on a particular element.

With X-path

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   text = run.return_text("xpath", "//path")
   print(text)
Report Bugs

With CSS

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   text = run.return_text("css", "//path")
   print(text)
Report Bugs

.display_text()

This command prints the text written on a particular element.

With X-path

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_text("xpath", "//path")
Report Bugs

With CSS

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_text("css", "//path")
Report Bugs

.return_all_inner_text()

This command returns texts in a list of all elements with similar selector path.

With X-path

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   a = run.return_all_inner_text("xpath", "//path")
   print(a)
Report Bugs

With CSS

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   a = run.return_all_inner_text("css", "//path")
   print(a)
Report Bugs

Getting attributes

.return_attribute()

This command returns the css attribute of a particular element, argument required by the function can be any attribute of css.

With X-path

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   text = run.return_attribute("xpath", "//path", "placeholder")
   print(text))
Report Bugs

With CSS

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   text = run.return_attribute("css", "//path", "placeholder")
   print(text)
Report Bugs

.display_attribute()

This command prints the css attribute of a particular element, argument required by the function can be any attribute of css.

With X-path

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_attribute("xpath", "//path", "placeholder")
Report Bugs

With CSS

Example:

You have you add the url of the page that you are checking in "url" field.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_attribute("css", "//path", "placeholder")
Report Bugs

Other Selectors

How to dapibus sollicitudin justo vel fermentum?

Donec sodales sagittis magna. Sed consequat, leo eget bibendum sodales, augue velit cursus nunc, quis gravida magna mi a libero. Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui.

How long bibendum sodales?

Fusce vulputate eleifend sapien. Vestibulum purus quam, scelerisque ut, mollis sed, nonummy id, metus. Nullam accumsan lorem in dui.

Where dapibus sollicitudin?

Aenean et sodales nisi, vel efficitur sapien. Quisque molestie diam libero, et elementum diam mollis ac. In dignissim aliquam est eget ullamcorper. Sed id sodales tortor, eu finibus leo. Vivamus dapibus sollicitudin justo vel fermentum. Curabitur nec arcu sed urna gravida lobortis. Donec lectus est, imperdiet eu viverra viverra, ultricies nec urna.

Checkboxes

.return_is_checked()


This command returns true if the checkbox is checked else returns false.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   a = run.return_is_checked("xpath", "//path")
   if a:
       print("yes")  # checkbox is checked
   else:
       print("no")  # checkbox is not checked
Report Bugs

.display_is_checked()


This command prints "Checkbox is checked" if the checkbox is checked else prints "Checkbox not checked".

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_ is_checked("xpath", "//path")
Report Bugs

.check_all()


This command checks all the checkboxes.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.check_all()
Report Bugs

Visible Elements

.return_is_visible()


This command returns true if the element is visible on the browser else returns false.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   a = run.return_is_visible("xpath", "//path")
   if a:
       print("yes")  # is visible
   else:
       print("no")  # not visible
Report Bugs

.display_is_visible()


This command prints "Element is visible" if the element is visible on the browser else prints "Element not visible"

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_is_visible("xpath", "//path")
Report Bugs

Clickable Elements

.return_is_clickable()


This command returns true if the element is clickable else returns false.

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   a = run.return_is_clickable("xpath", "//path")
   if a:
       print("yes")  # is clickable
   else:
       print("no")  # not clickable
Report Bugs

.display_is_clickable()


This command prints "Element is clickable" if the element is clickable on the browser else prints "Element not clickable".

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_is_clickable("xpath", "//path")
Report Bugs

Drag and Drop

.drag_and_drop()


This command prints "Element is clickable" if the element is clickable on the browser else prints "Element not clickable".

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_is_clickable("xpath", "//path")
Report Bugs

.drag_and_drop()


This command prints "Element is clickable" if the element is clickable on the browser else prints "Element not clickable".

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_is_clickable("xpath", "//path")
Report Bugs

.drag_and_drop()


This command prints "Element is clickable" if the element is clickable on the browser else prints "Element not clickable".

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_is_clickable("xpath", "//path")
Report Bugs

Click and Hold

.click_and_hold()


This command prints "Element is clickable" if the element is clickable on the browser else prints "Element not clickable".

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_is_clickable("xpath", "//path")
Report Bugs

.click_and_hold()


This command prints "Element is clickable" if the element is clickable on the browser else prints "Element not clickable".

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_is_clickable("xpath", "//path")
Report Bugs

.click_and_hold()


This command prints "Element is clickable" if the element is clickable on the browser else prints "Element not clickable".

from FUNCTIONS.helper import Checker
def test_example(browser):
   run = Checker("url", browser)
   run.display_is_clickable("xpath", "//path")
Report Bugs