Sunday, December 28, 2014

In this tutorial I will explain you how to download txt, pdf, csv, excel and doc file using firefox profile. You can write a selenium script to download file, if you know the MIME type of the file that you wanted to download. google_ad_client = "ca-pub-8489590936844748"; google_ad_slot = "7087636712"; google_ad_width = 336; google_ad_height = 280; Download File Using Selenium...
In this tutorial I will explain how to click on WebElement using JavaScriptExecutor. Sometimes click() does not work then you can use JavaScriptExecutor to click button or WebElement. google_ad_client = "ca-pub-8489590936844748"; google_ad_slot = "7087636712"; google_ad_width = 336; google_ad_height = 280; Click WebElement Using JavaScriptExecutorimport org.openqa.selenium.By; import...

Tuesday, December 16, 2014

If the WebDriver does not get web element then the WebDriver will wait for specified time and WebDriver will not try to search the element during the specified time. Once the specified time is over, WebDriver will start searching the web element only one time before throwing the exception. google_ad_client = "ca-pub-8489590936844748"; google_ad_slot = "7087636712"; google_ad_width =...
If a particular web element takes more than a minute to load then you may want to wait for the element to load properly and then go to the next line of code. In selenium, it is possible with Explicit Wait. google_ad_client = "ca-pub-8489590936844748"; google_ad_slot = "7087636712"; google_ad_width = 336; google_ad_height = 280; Selenium Explicit Wait Example import org.openqa.selenium.Alert; import...

Monday, December 15, 2014

This article shows you how to take screenshot using Selenium Webdriver. Screen shot may help you to identify and debug the problem. google_ad_client = "ca-pub-8489590936844748"; google_ad_slot = "7087636712"; google_ad_width = 336; google_ad_height = 280; Take Screenshot Using Selenium Webdriverimport java.io.File; import org.apache.commons.io.FileUtils; import org.openqa.selenium.By; import...
In this tutorial, I will tell you how to write text in the forms. Selenium webdriver provides a method called sedKeys() which help us to write text in the forms automatically. google_ad_client = "ca-pub-8489590936844748"; google_ad_slot = "7087636712"; google_ad_width = 336; google_ad_height = 280; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import...
Suppose we have a requirement to drag a webelement from one location and drop in another using a selenium script. In selenium webdriver, we can perform drag and drop or mouse operations by using Actions class. google_ad_client = "ca-pub-8489590936844748"; google_ad_slot = "7087636712"; google_ad_width = 336; google_ad_height = 280; import java.util.concurrent.TimeUnit; import...