Found 871 Articles for Automation Testing

How do I use Selenium IDE?

Debomita Bhattacharjee
Updated on 02-Feb-2021 12:25:55

267 Views

We can use and install Selenium IDE by following a few steps one by one. It is for integrated development of Selenium scripts. It is primarily used as an extension of Firefox.Some facts about Selenium IDE are listed below −Requires no technical knowledge of the testers.Record and playback feature available.Has the option to run either a single test case or all test cases in a suite.Allows usage of breakpoints for debugging.Auto−completion feature for commands in Selenium.Supports multiple locators like xpath, css, id, and so on.Tests can be saved in multiple formats like Python, C#, and so on.Initially used as a ... Read More

Handle Firefox Not Responding While Using Selenium WebDriver With Python?

Debomita Bhattacharjee
Updated on 02-Feb-2021 12:25:36

566 Views

We can handle the situation in which the Firefox is not responding with the help of the Selenium webdriver in Python. This can be achieved with the help of the FirefoxProfile class.We shall create an object of this class and apply the set_preference method on it. Then pass these preferences − dom.max_script_run_time and dom.max_chrome_script_run_time with their values set to 0 as parameters to that method.Finally, this information shall be sent to the webdriver object.Syntaxf = webdriver.FirefoxProfile() f.set_preference("dom.max_chrome_script_run_time", 0) f.set_preference("dom.max_script_run_time", 0)We can get the above parameters of the browser by following the below steps −Open the Firefox browser.Type about:config in browser ... Read More

Save a Web Page with Python Selenium

Debomita Bhattacharjee
Updated on 02-Feb-2021 12:19:00

11K+ Views

We can save a webpage with Selenium webdriver in Python. To save a page we shall first obtain the page source behind the webpage with the help of the page_source method.We shall open a file with a particular encoding with the codecs.open method. The file has to be opened in the write mode represented by w and encoding type as utf−8. Then use the write method to write the content obtained from the page_source method.Syntaxn = os.path.join("C:\Users\ghs6kor\Downloads\Test", "PageSave.html") f = codecs.open(n, "w", "utf−8") h = driver.page_source f.write(h)Let us make an attempt to save the below webpage −Examplefrom selenium import webdriver ... Read More

Can Selenium use multi threading in one browser?

Debomita Bhattacharjee
Updated on 02-Feb-2021 12:18:44

3K+ Views

Selenium can use multi−threading in one browser with the help of TestNG framework. TestNG provides the feature of parallel execution which works on the concept of Java multi−threading.To execute tests based on various parameters, the TestNG has an XML file where we have the configurations. The attributes parallel and thread−count are used for parallel execution.The parallel attributes can have the following values −Classes − to execute all tests in a class within a one thread.Instances − to execute all methods in the same instance within one thread.Tests − to execute all methods in the same tag within one thread.Methods − ... Read More

How to programmatically configure Chrome extension through Selenium WebDriver?

Debomita Bhattacharjee
Updated on 02-Feb-2021 12:13:01

4K+ Views

We can programmatically configure Chrome extension through Selenium webdriver. We can have multiple extensions of the Chrome browser while we manually open the browser and work on it.However, while the Chrome browser is opened through Selenium webdriver, those extensions which are available to the local browser will not be present. To configure an extension, we have to obtain the .crx extension file of the extension.Then we have to add that extension to the browser which is launched by Selenium webdriver. To get all the extensions available to the browser enterchrome://extensions on the browser.To get add an extension for example: Momentum, ... Read More

Download image with Selenium Python

Debomita Bhattacharjee
Updated on 02-Feb-2021 12:13:19

10K+ Views

We can download images with Selenium webdriver in Python. First of all, we shall identify the image that we want to download with the help of the locators like id, class, xpath, and so on.We shall use the open method for opening the file in write and binary mode (is represented by wb). Then capture the screenshot of the element that we desire to capture with the screenshot_as_png method.Finally, the captured image must be written to the opened file with the write method. Let us make an attempt to download the image of an element having the below html −Syntaxwith ... Read More

Find out when a download has completed using Python & Selenium

Debomita Bhattacharjee
Updated on 02-Feb-2021 12:06:23

6K+ Views

We can find when a download has completed with Selenium webdriver in Python. We shall use the ChromeOptions class for this purpose. First, we shall create an object of the ChromeOptions class.Then apply the add_experimental_option method on the object created. We shall pass browser preferences and download.default_directory: as parameters to that method. Finally, this information shall be passed to the driver object.Once the download is completed, we can verify it with the help of the os.path.isfile method. The path of the downloaded file is passed as a parameter to that method. The method os.path.exists shall also be used to verify ... Read More

Handling Browser Authentication using Selenium

Debomita Bhattacharjee
Updated on 04-Mar-2024 12:39:14

4K+ Views

We can handle browser authentication with Selenium webdriver. We have to pass the credentials appended with the URL. The username and password must be added with the format: https://username:password@URL. Let us make an attempt to handle the below browser authentication.Once the User Name and Password are entered correctly and the OK button is clicked, we are navigated to the actual page with the text Congratulations! You must have the proper credentials.Syntaxhttps://username:password@URL https://admin:admin@the−internet.herokuapp.com/basic_authHere, the username and password value is admin.URL is www.the−internet.herokuapp.com/basic_authExampleimport org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class BrwAuthnPopup{    public static void main(String[] args) {     ... Read More

Where can I find a definitive Selenium WebDriver to Firefox Compatibility Matrix?

Debomita Bhattacharjee
Updated on 02-Feb-2021 12:01:19

197 Views

We can find a definitive Selenium webdriver to Firefox compatibility matrix. To verify the Firefox browser compatibility with the Selenium webdriver, note the Selenium webdriver version.Then navigate to the link −https://firefox−source−docs.mozilla.org/testing/geckodriver/Support.html.Verify the Firefox version needed for the Geckodriver and Selenium.For any compatibility related concerns, we can navigate to the link &minushttps://github.com/SeleniumHQ/selenium/blob/trunk/java/CHANGELOGAlso, there is a good matrix for support available in the link −https://github.com/santiycr/selenium−firefox−support−matrix

What is the difference between Selenium's Remote Control vs WebDriver?

Debomita Bhattacharjee
Updated on 02-Feb-2021 12:01:35

211 Views

The differences between Selenium RC and Selenium webdriver are listed below −FunctionalitiesSelenium RCSelenium WebdriverServerNeeds the server to trigger test execution.No need for the server to trigger test execution.Object OrientedNot much support from object oriented concepts.Majority of tests based on object oriented concepts.Dynamic LocatorsNo identification of elements with dynamic locators.Identification of elements with dynamic locators.AlertsNo support for alerts.Supports alerts.Mouse ActionsNo support for mouse actions.Supports mouse actions.DropdownNo support to handle dropdown.Supports handling dropdown.iPhone/AndroidNo support for iPhone/Android testing.Supports iPhone/Android testingListenerNo support for Listener.Supports Listeners.PerformanceIt does not communicate directly with the browser. So it is slower in execution.Execution is fast as it communicates directly ... Read More

Advertisements