Presentation is loading. Please wait.

Presentation is loading. Please wait.

Test Automation For Web-Based Applications

Similar presentations


Presentation on theme: "Test Automation For Web-Based Applications"— Presentation transcript:

1 Test Automation For Web-Based Applications
Portnov Computer School WebDriver Training Test Automation For Web-Based Applications Presenter: Ellie Skobel

2 Day 2 Selenium 3 (WebDriver)

3 WebDriver Commands (p1)
Definition get opens a specified URL title returns the page title find_element_by_* returns first found matching element. Options include: id, tag_name, class_name, link_text, partial_link_text, css_selector, xpath and name find_elements_by_* returns ALL found matching elements. Options include: id, tag_name, class_name, link_text, partial_link_text, css_selector, xpath and name execute_script Executes specified javascript code within the browser window current_url returns current window URL page_source return html source of the page close closes the current window quit quits the browser session current_window_handle returns the window handle of the currently selected window Webdriver API Documentation: here

4 WebDriver Commands (p2)
Definition window_handles returns a list of window handles of all windows belonging to the browser session maximize_window maximize window  switch_to Switch from current document to another window or frame. Often user in conjunction with window_handles switch_to_default_content Switch to the original document switch_to_alert Switch to alert  back, forward, refresh Back to previous page, forward to next page, refresh current page get_cookies returns all stored cookies for the current domain in the current session get_cookie Retrieve the value of a specific cookie by name delete_cookie Delete a specific cookie by name delete_all_cookies Delete ALL cookies for the current domain or the current session add_cookie Add a cookies (name and value pair) Webdriver API Documentation: here

5 WebDriver Commands (p3)
Definition implicitly_wait time to continue looking for an element find_element less commonly use implementation to locate first matching web element find_elements less commonly use implementation to locate ALL matching web elements get_screenshot_as_file Capture a screenshot get_screenshot_as_png Alternative way to capture a screenshot set_window_size Configure specific window size get_window_size returns current window size in pixels set_window_position Set the position of the top left corner of the window get_window_position returns the position of the top left corner of the window Webdriver API Documentation: here

6 WebElement Commands (p1)
Description tag_name Retrieve tag name of the element text returns element's visible text click performs a single click submit submits a form (similar to pressing enter/return on the keyboard) clear clears all content from a field get_attribute returns value of a webelement attribute is_selected returns true/false based on webelement's (checkbox, radio button) selection is_enabled returns true/false based on webelement's write-ability

7 WebElement Commands (p2)
Description find_element_by_* returns first found matching element. Options include: id, tag_name, class_name, link_text, partial_link_text, css_selector, xpath and name find_elements_by_* returns ALL found matching elements. Options include: id, tag_name, class_name, link_text, partial_link_text, css_selector, xpath and name send_keys Simulates entering text into a field is_displayed returns true/false based on webelement's visibility location_once_scrolled_into_view returns coordinates of the top left corner of the element, once it has been scrolled into view size returns width and height of the element in pixals location returns coordinates of the top left corner of the element id returns the value of the id attribute of the current element (read only)


Download ppt "Test Automation For Web-Based Applications"

Similar presentations


Ads by Google