Part 5: Waits In Selenium: What Happens When We Mix Sleep With Other Types Of Waits ?

Hello Folks, In this post we will learn about behavior of webdriver when we mix waits together. There are four types of waits in Selenium Webdriver. Those are: Thread.sleep() Implicit wait Explicit wait (It is also called as webdriver wait.) Fluent wait. (It is also called as webdriver wait. Every wait has its own significance

Read More

JAVA Program 5: Swap two integer variables without using third variable

Problem: Write a java program to swap values of two integer variables without using third variable. Solution: Java Program: import java.util.Scanner; public class SwapingTwoNumbers { public static void main(String[] args) { // taking input from user Scanner in = new Scanner(System.in); System.out.println(“Enter the 1st number: “); int x = in.nextInt(); System.out.println(“Enter the 2nd number: “);

Read More

Part 4: Waits In Selenium: Fluent Wait

Hello Folks, We have covered below types of waits present in Selenium WebDriver: Thread.sleep() Implicit Wait. Explicit Wait Consider below scenario: You are testing Flipkart home page. Flipkart lists top items at home page which includes electronics, furniture etc. Now scenario is you need to find first 10 mobile displayed at home page. First of

Read More

Java Program 4: Extract Numbers From String and Add

Write a JAVA program for below requirements: Take an alphanumeric string from user. Verify if it is alphanumeric. If it is alphanumeric, extract all numbers present in string. Add all numbers and print it. JAVA Program: import java.util.Scanner; import org.apache.commons.lang3.StringUtils; public class ExtractNumbersFromString { public static void main(String[] args) { int sum=0; // Reading input

Read More

How to handle StaleElementReferenceException Through Page Object Model(POM)

Hello Folks, This is on demand post. Many people asked me how to handle¬†StaleElementReferenceException through Page Object Model(POM). So thought of writing a simple post on it. I am trying to automate below steps: Load URL “https://github.com/login”. Type wrong username. Type wrong password. Click on submit. Type correct username. Type correct password. Click on submit.

Read More

Part 3: Waits In Selenium : Explicit Wait

Hello Folks, We have covered below types of waits present in Selenium WebDriver in older posts: Thread.sleep() Implicit Wait. In this post, we will learn Explicit Wait. Implicit wait is wait which is set for a session of WebDriver and it will just make WebDriver to wait till it finds the web element. But there

Read More

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.