Submitted by harrydev on Sat, 03/01/2014 - 00:14
A test automation framework is a collection of re-usable methods which helps in automating test process.
Automation of test process include automation of following modules:
Test Execution: This is the place where a tool is used to execute the scripts.
Submitted by harrydev on Fri, 02/21/2014 - 13:15
We will look in detail for each of the webdriver methods that we have. The first that we use is 'driver.get(url)' after starting the browser.
When we get the driver object, the below are the methods that we can perform operation on a driver. In IDE like eclipse, when we add period (. ) you will show all the below methods.
Submitted by harrydev on Sat, 02/15/2014 - 13:44
Delete Cookie with Name
Delete All Cookies
User can delete a cookie from the browser's "cookie jar". The domain of the cookie will be ignored.
User can delete the named cookie from the current domain. This is equivalent to setting the named cookie's expiry date to sometime in the past.
User can also delete all the cookies for the current domain using driver.manage().deleteAllCookies();
Deleting the specific cookie with cookie name "--utmb"
Submitted by harrydev on Sat, 02/15/2014 - 09:25
Using webdriver we can easily pass the cookie to the domain. In order to pass cookie, we should use a method named "addCookie(cookie)"
Method Name: addCookie(Cookie cookie)
Purpose: To add a specific cookie into cookies. If the cookie's domain name is left blank, it is assumed that the cookie is meant for the domain of the current document.
Parameters: cookie - The name and value of the cookie to be add.
Submitted by harrydev on Sat, 02/15/2014 - 08:42
Selenium webdriver can perform required task with respect to browser cookies. We add , delete, delete particular cookie by passing the name, and so on. Let us look all of the in details.
First let us see how add cookie works:
Submitted by harrydev on Sat, 02/15/2014 - 00:27
Method Name: navigate.to(URL)
Purpose: This methods Load a new web page in the current browser window. This is done using an HTTP GET operation, and the method will block until the load is complete.
Parameters: URL – It should be a fully qualified URL.
Submitted by harrydev on Mon, 02/03/2014 - 12:41
The first thing you’ll want to do with WebDriver is navigate to a page. The normal way to do this is by calling get:
get(java.lang.String url) url - The URL to load. It is always best to use a fully qualified URL
driver.get("http://www.google.com"); which loads a new web page in the current browser window.
Submitted by harrydev on Mon, 02/03/2014 - 12:19
This Exception occurs when driver is trying to perform action on the element which is no longer exists or not valid.
WebElement ele = driver.findElement(By.id("sample"));
// Before clicking some thing happened and DOM has changed due to page refresh, or element is removed and re-added
Now at this point, the element which you're clicking is no longer valid.
so it throws up its hands and gives control to user, who as the test/app author should know exactly what may or may not happen.
Submitted by harrydev on Mon, 02/03/2014 - 11:11
In order to perform a 'mouse hover' action, we need to chain all of the actions that we want to achieve in one go. So move to the element that which has sub elements and click on the child item. It should the same way what we do normally to click on a sub menu item.
With the actions object you should first move the menu title, and then move to the sub menu item and click it.
First we need to create new action builder instance by passing the webdriver instance, then.
Below is the sample code to perform Mouse hover action
Submitted by harrydev on Fri, 01/24/2014 - 15:04
Companies not only want to test software adequately, but also as quickly and thoroughly as possible. To accomplish this goal, organizations are turning to automated testing.
To increase the test coverage
Reduces the need for manual testing and discovers defects manual testing cannot expose and also manual testing is error prone and a time consuming process.
Running the tests again and again gives us the confidence that the new work we added to the system did not break the code that used to work and also to make sure that the changes we introduced are working.