
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 869 Articles for Automation Testing

677 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

13K+ 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

4K+ 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

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

12K+ 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

8K+ 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

6K+ 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

264 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

289 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

14K+ Views
We can run Chrome browser Incognito mode with Selenium webdriver. Incognito mode is a safe mode of opening a browser. This can be done with the help of the DesiredCapabilities and ChromeOptions class.We shall create an object of the ChromeOptions class and apply addArguments method on it. Then pass −−incognito as a parameter to that method. We shall then create an object of the DesiredCapabilities class.We shall apply setCapability method on the object of the DesiredCapabilities class and pass the ChromeOptions.CAPABILITY and the object of ChromeOptions class as parameters to that method.Finally, this browser chrome profile shall be fed to ... Read More