Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Debomita Bhattacharjee
590 articles
Explain JMeter installation in macOS
Apache JMeter is a popular open-source tool for performance testing and load testing of web applications. Installing JMeter on macOS is straightforward and can be accomplished by downloading the binary distribution and running it from the command line. Prerequisites Before installing JMeter, ensure that Java 8 or later is installed on your macOS system. You can verify your Java installation by running the following command in Terminal: java -version Step-by-Step Installation Step 1 − Download JMeter Navigate to the official Apache JMeter download page: https://jmeter.apache.org/download_jmeter.cgi Step 2 − ...
Read MoreHow to install Selenium WebDriver on Mac OS?
We can install Selenium WebDriver on Mac OS to automate web browsers for testing purposes. Selenium is a popular framework for web automation that supports multiple browsers including Chrome, Firefox, and Safari. We shall use Homebrew package manager along with pip for a streamlined installation process. Prerequisites Before installing Selenium WebDriver, ensure you have the following installed on your Mac − Python 3.x − Check with python3 --version Homebrew − Install from https://brew.sh/ Google Chrome browser − Download from official website Step-by-Step Installation Step 1: Install Selenium Python Package Install Selenium using ...
Read MoreHow to open a browser window in full screen using Selenium WebDriver with C#?
We can open a browser window in full screen using Selenium WebDriver in C# by using the Maximize() method. This method is applied on the WebDriver object through the window management interface and expands the browser to fill the entire screen. Syntax Following is the syntax for maximizing a browser window − driver.Manage().Window.Maximize(); For setting specific window size, you can also use − driver.Manage().Window.Size = new Size(width, height); Using Maximize() Method The Maximize() method is the most common approach to open a browser in full screen mode. It automatically ...
Read MoreMoving mouse pointer to a specific location or element using C# and Selenium
We can move mouse pointer to a specific location or element in Selenium WebDriver with C# using the Actions class. This class provides methods to simulate user interactions like moving the mouse, clicking, and performing complex gestures on web elements. To move the mouse to an element, we use the MoveToElement method and pass the element locator as a parameter. To move to specific coordinates, we use the MoveByOffset method. All actions must be executed using the Perform method. Syntax Following is the syntax for creating an Actions object and moving to an element − ...
Read MoreAccessing HTML source code using Python Selenium.
We can access HTML source code with Selenium WebDriver using two primary methods. The page_source method retrieves the complete HTML of the current page, while JavaScript execution allows us to access specific portions of the DOM, such as the body content. Syntax Following is the syntax for accessing HTML source using the page_source method − src = driver.page_source Following is the syntax for accessing HTML source using JavaScript execution − h = driver.execute_script("return document.body.innerHTML") Method 1: Using page_source Method The page_source method returns the complete HTML source code of ...
Read MoreHow to get HTML code of a WebElement in Selenium?
We can get the HTML code of a WebElement using Selenium WebDriver by accessing the innerHTML attribute. The innerHTML represents the HTML content between the opening and closing tags of an element, which includes both text content and any nested HTML elements. The getAttribute() method is used to retrieve the innerHTML value by passing "innerHTML" as a parameter. This method returns the complete HTML markup contained within the selected element. Syntax Following is the syntax to get the innerHTML of a WebElement − String htmlContent = element.getAttribute("innerHTML"); Where element is the WebElement object ...
Read MoreHow to set style display of an html element in a selenium test?
We can set the style display of an HTML element with Selenium WebDriver using JavaScript execution. The DOM interacts with page elements through JavaScript, and Selenium executes JavaScript commands using the executeScript method. This approach is particularly useful when you need to modify CSS properties like visibility, display type, or other styling attributes programmatically during test execution. Some operations like setting the style display must be performed by JavaScript Executor. The getElementById method locates the element, then we apply the style.display property to set the display type such as block, none, inline, or flex. Syntax Following is ...
Read MoreHow to simulate pressing enter in html text input with Selenium?
We can simulate pressing enter in HTML text input fields using Selenium WebDriver. The sendKeys method allows us to send key presses to web elements, including the Enter key. This is commonly used for form submissions, search operations, or triggering input validation. Syntax Following is the syntax to simulate pressing Enter using Selenium − element.sendKeys(Keys.ENTER); Alternatively, you can use Keys.RETURN which produces the same result − element.sendKeys(Keys.RETURN); Both Keys.ENTER and Keys.RETURN represent the same key press action and can be used interchangeably in Selenium automation. Required Import To ...
Read MoreCapturing JavaScript error in Selenium.
We can capture JavaScript errors in Selenium WebDriver to identify console errors that appear in the browser's Developer Tools. These errors can occur due to functional issues on the page or performance problems caused by excessive logging. JavaScript errors are typically visible in the Console tab of browser Developer Tools and can impact application functionality. Selenium provides logging capabilities to capture and analyze these errors programmatically. Browser Developer Tools - Console Tab ...
Read MoreWait for complex page with JavaScript to load using Selenium.
We can wait for a complex page with JavaScript to load with Selenium. After the page is loaded, we can invoke the Javascript method document.readyState and wait till complete is returned. Understanding document.readyState The document.readyState property returns the loading status of the document. It has three possible values: loading - The document is still loading interactive - Document has finished loading but sub-resources may still be loading complete - The document and all sub-resources have finished loading Syntax JavascriptExecutor js = (JavascriptExecutor)driver; js.executeScript("return document.readyState").toString().equals("complete"); Method 1: Using document.readyState Check ...
Read More