In Java, a string is an object representing a sequence of characters. It’s used to store and manipulate text-based information. Properties of Strings: Immutable Nature: Once a string is created, its content cannot be changed. Any operation that appears to modify a string actually creates a new string. Creation: Strings can be created using double… Continue reading Java String
Tag: Java
Handling Alerts in Java Selenium
Alerts are a common feature in web applications. They can be simple information messages, confirmation prompts, or even critical error notifications. Handling these alerts effectively is crucial for any Selenium test automation script. In this article, we’ll explore how to deal with alerts in Java Selenium. Handling Alerts in Java Selenium Selenium WebDriver provides a… Continue reading Handling Alerts in Java Selenium
Handling Dynamic Elements In Java Selenium
When automating web applications with Selenium in Java, one common challenge is dealing with dynamic elements. Dynamic elements are elements on a web page whose attributes, positions, or presence may change dynamically during runtime. This can happen due to various reasons, such as asynchronous loading, AJAX requests, or dynamic content updates. Handling dynamic elements effectively… Continue reading Handling Dynamic Elements In Java Selenium
Prioritize Test Cases in TestNG
How to prioritize test cases (For selenium Automation – TestNG Framework) When Multiple test cases are written under one class, it will execute according to the alphabetical order(ASCII), for making it execute based on our condition, we will prioritize the test cases → ByDefault all the tests in the class will be executed in the… Continue reading Prioritize Test Cases in TestNG
Methods used in Selenium WebDriver for Automation
Selenium web driver in simple terms is an API library that contains a list of predefined classes and interfaces that contains predefined methods Basic Methods that are used in Selenium web driver: get() → Used to open specified URL’s web page, (HTTP:// needs to be provided) manage() → manage().window().maximized(); → To maximize the window manage().window().minimize();… Continue reading Methods used in Selenium WebDriver for Automation
Taking Screenshots using Selenium webdriver
Testing steps: Load the page using the given URL (Log in | Register (formsscasb.tk)) Select the Sign-Up link Fill out all the fields and uncheck the checkbox Click the Create Account button Take the screenshot Quit browser Code: Script: public static void main(String[] args) throws Exception { WebDriverManager.edgedriver().setup(); EdgeOptions options = new EdgeOptions(); options.addArguments(“start-maximized”); WebDriver… Continue reading Taking Screenshots using Selenium webdriver
Logout using selenium web driver with dynamically handling the dropdown
Testing steps: Load the page using the given URL (Log in | Register (formsscasb.tk)) Login using valid credentials → (Email: radhika.rakesh@jobinandjismi.com, Password: test@12345) Select the arrow dropdown near the account name at the top right of the page and selects the logout option Dynamically handling the dropdown Script: public static void main(String[] args) throws Exception… Continue reading Logout using selenium web driver with dynamically handling the dropdown
Search a item using selenium webdriver
Testing steps: Load the page using the given URL (Log in | Register (formsscasb.tk)) Login using valid credentials → (Email: radhika.rakesh@jobinandjismi.com, Password: test@12345) Select the search icon Enter an item into the search field → (62-058 High Yield MICR Toner Cartridge: HP LaserJet M506x) Select the Go button View and select the product to view… Continue reading Search a item using selenium webdriver
Collections framework (Usages)- For selenium
What is a Collections Framework? A collections framework is a unified architecture for representing and manipulating collections.All collections frameworks contain the following: Interfaces: These are abstract data types that represent collections. Interfaces allow collections to be manipulated independently of the details of their representation. In object-oriented languages, interfaces generally form a hierarchy. Implementations: These are the concrete… Continue reading Collections framework (Usages)- For selenium