Level4

Scroll Web Page

Level4, Selenium
We can scroll the web page using JavaScript Executor in the java code. I have taken the below examples with Five different scenarios of scrolling a webpage.  Scroll Down  Scroll up  Scroll bottom of the Page  Full scroll to bottom in slow motion automatically to your Web Element 1.Scroll Down: import java.util.concurrent.TimeUnit; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; public class PageScrollDown { public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); //Launching the browser application driver.get("http://www.javaseleniumworld.com/"); //Adding wait driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS); //Maxi
Dropdowns in Selenium

Dropdowns in Selenium

Level4, Selenium
1.Select Class in Selenium WebDriver. 2.Different Select Methods       i.selectByVisibleText Methods.       ii.selectByIndex Method.       iii.selectByValue Method. 3.Different DeSelect Methods.       i.deselectByIndex Method.       ii.deselectByValue Method.       iii.deselectByVisibleText Method.       iv.deselectAll Method. The most basic approach for handling these elements is first to locate their element <group>. We’ve labeled it as a <group> because none of the Dropdown and Multiple Select is a singular entity. They do have the same identity which serves to hold more than one element. You can simply think both of them as containers for holding multiple options. The only difference between the Dropdown and Multiple Select fields is the deselecting state
Pop Ups in Selenium

Pop Ups in Selenium

Level4, Selenium
How To Handle Javascript Alerts/PopUps In Selenium WebDriver: In this post, we see how to handle javascript alerts/popus. Alerts are basically popup boxes that take your focus away from the current browser and forces you to read the alert message. You need to do some action such as accept or dismiss the alert box to resume your task on the browser. To handle alerts popupswe need to do switch to the alert window and call Selenium WebDriver Alert API methods. There are two types of alerts. Windows Based Web Based/Browser Based Here in this post, I confine to Java Script Alerts (A.K.A. Browser/Web Based Alerts). To handle Browser based Alerts (Web based alert popups), we use Alert Interface. The Alert Interface provides some methods to handle the popups. While runnin