Found 519 Articles for Selenium

How to click on a link using Selenium webdriver in Python.

Debomita Bhattacharjee
Updated on 19-Nov-2021 11:36:58

9K+ Views

We can click on a link using Selenium webdriver in Python. A link is represented by the anchor tag. A link can be identified with the help of the locators like - link text and partial link text.We can use the link text attribute for an element for its identification and utilize the method find_element_by_link_text. With this, the first element with the matching value of the given link text is returned.Syntaxdriver.find_element_by_link_text("value of link text")We can also use the partial link text attribute for an element for its identification and utilize the method find_element_by_partial_link_text. With this, the first element with the ... Read More

How to select an option in a static dropdown in Selenium?

Debomita Bhattacharjee
Updated on 19-Nov-2021 11:03:24

2K+ Views

We can select an option in a static dropdown in Selenium webdriver. Selenium can handle static dropdowns with the help of the Select class. A dropdown is identified with select tagname and its options are represented with the tagname option. The statement - from selenium.webdriver.support.select import Select should be added to work with Select class.Methods under the Select class are listed below −select_by_visible_text (arg) – it shall select all the options which displayed text matches with the argument.Syntax−sel = Select (driver.find_element_by_id ("name")) sel.select_by_visible_text ('Visible Text')select_by_value (arg) – it shall select all the options having a value that matches with the ... Read More

Gmail login fail using Selenium webdriver. Showing element not found for password.

Debomita Bhattacharjee
Updated on 18-Nov-2021 11:35:14

665 Views

We can encounter Gmail login failure while using Selenium webdriver due to the error - element not found for password. This can be fixed by the methods listed below −Adding implicit wait - Implicit wait is applied to instruct the webdriver for polling the DOM(Document Object Model) for a specific amount of time while attempting to identify an element that is currently unavailable.The default value of the implicit wait time is 0. Once a wait time is set, it remains applicable throughout the entire life of the webdriver object. If an implicit wait is not set and an element is ... Read More

How to send a report through email using Selenium Webdriver?

Debomita Bhattacharjee
Updated on 29-Jun-2021 08:42:55

2K+ Views

We can send a report through email using Selenium webdriver. The email report can be an important feature in an automation framework. An email should be necessarily sent after the combined execution of a regression suite has completed to get an overall view of the test results.The ways to send a report through email are listed below −Using the Java library - Apache Commons available in the below link: https://commons.apache.org/proper/commons-email/.Using the Java mail JAR. The details of this is available in the below link: https://javaee.github.io/javamail/Steps to configure the Java mail JAR are listed below −Step1 − Navigate to the below ... Read More

Selenium Exception Error - Element is not clickable at point (x,y). Other element would receive the click

Debomita Bhattacharjee
Updated on 29-Jun-2021 08:39:00

1K+ Views

We may encounter the Selenium Exception Error - Element is not clickable at point(x, y). Other element would receive the click while working Selenium webdriver.This is normally seen while executing Selenium tests from the Chrome browser and not with other browsers like IE and Firefox. This happens because the Chrome browser could not compute the correct location of a webelement.Besides, in the Chrome browser, an element is clicked in its middle position. This exception can also be encountered owing to synchronization issues happening between the application and Selenium.There exists some solutions to fix this issue as listed below −We should ... Read More

How to do UI testing with Selenium?

Debomita Bhattacharjee
Updated on 29-Jun-2021 08:37:35

1K+ Views

We can do UI testing with Selenium webdriver. To achieve this, we have to follow the steps listed below which can be applied to any script developed to test the UI of the application −Step1 − Object of Webdriver should be created. For example, WebDriver driver = new ChromeDriver();The above piece of code is used to create a webdriver instance and initiate the script execution in the Chrome browser.Step2 − Launch the URL on which we want to perform the UI testing. For example, driver.get("https://www.tutorialspoint.com/about/about_careers.htm");The above piece of code shall launch the URL passed as a parameter to the get ... Read More

Jenkins for Test Automation

Debomita Bhattacharjee
Updated on 29-Jun-2021 08:33:00

584 Views

Jenkins is a continuous integration tool and used widely by both the development and testing teams. It comes without any licensing cost and is supported on multiple operating systems.In the test automation world, we run test suites with a large number of test cases, collect results on execution, prepare a dashboard and pinpoint details on failures. All these are supported in Jenkins. Let us see some of the advantages of Jenkins −Jenkins has plugins with which it can be integrated with tests developed in Selenium, Cucumber, TestNG, and so on to execute automated tests for the builds.Tests in a test ... Read More

Modern Web Automation With Python and Selenium

Debomita Bhattacharjee
Updated on 29-Jun-2021 08:28:31

735 Views

We can have modern web automation with Python and Selenium. To configure with Selenium webdriver in Python the steps described below need to be followed −Step1 −To install Python in our system, visit the link − https://www.python.org/downloads/Step 2 − Click on the Download Python button. Once the download is completed, the Python executable file should be available in our system.Step 3 − Double-click on this executable file and the Python installation landing page should be opened. Click on Install Now.Step 4 − Python should be available in the below path −C:\Users\\AppData\Local\Programs\Python\PythonStep 5 − We shall configure the path of ... Read More

How can I capture network traffic of a specific page using Selenium?

Debomita Bhattacharjee
Updated on 29-Jun-2021 08:25:11

5K+ Views

We can capture network traffic on a specific page using Selenium webdriver in Python. To achieve this, we take the help of the JavaScript Executor. Selenium can execute JavaScript commands with the help of the execute_script method.JavaScript command to be executed is passed as a parameter to this method. To capture the network traffic, we have to pass the command: return window.performance.getEntries() as a parameter to the execute_script method.Syntaxr = driver.execute_script("return window.performance.getEntries();")ExampleCode Implementationfrom selenium import webdriver #configure chromedriver path driver = webdriver.Chrome(executable_path='../drivers/chromedriver') #implicit wait driver.implicitly_wait(0.5) #url launch driver.get("https://www.google.com/") #JavaScript command to traffic r = driver.execute_script("return window.performance.getEntries();") for res in r: ... Read More

How to set Proxy in Firefox using Selenium WebDriver?

Debomita Bhattacharjee
Updated on 29-Jun-2021 08:21:57

2K+ Views

We can set a proxy in Firefox using Selenium webdriver. A proxy server enables users to access an URL of an application for testing purposes even with the presence of several layers of network.The setting up of proxy in Firefox can be done with the help of the FirefoxOptions class. The port information and the proxy server host are added to this class. The setting up of the proxy server can also be done by configuring the Firefox Profile in the FirefoxProfile class.ExampleCode Implementation with the FirefoxOptionsimport org.openqa.selenium.Proxy; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.firefox.FirefoxOptions; public class ConfigureProxy {    public ... Read More

Previous 1 ... 5 6 7 8 9 ... 52 Next
Advertisements