Friday, December 17, 2010

Quotes

Quotes - I received from my friends
1. Positive things start from Heart. All Bad things start from Mind. Never let the Mind rule your Heart. Let the Heart rule your Life.
2.Dont make a PROMISE, when you are in JOY. Dont reply when you are in ANGRY. Dont take a decision when you are in ANGRY. THINK TWICE,ACT WISE.
3.Every Sunset gives us one day less to Live, But every Sun Rise gives us One Day More to Hope. So Hope for the Best. BE POSITIVE.
4.Silence is the best answer for all questions..!! Smiling is the best reaction in all siturations..! Be Silence. Keep Smiling. .. gud morning.
5.Never leave ur close one's if u find few faults in them. Just remember the best times u spent 2gethr bcoz affection is more important than perfection.
6.Heated gold becomes ornament. Beated copper bcom wire, Depeted stone become statue. so the more pain u get in ur life more u become valuable and pious.
7.Foure things come not back in Life: The Spoken word, The Sped arrow,The Past life, The neglected opportunity. So we have 2 take more care of above four.
8.Never Blame A Day In Your Life. Good Days Give You Happiness Bad Days Give U Experience. Both R Essencial & Invitable in Life.
9.Dear Friend, I asked God : I want Happiness . 1st remove 'I' thats EGO, then remove 'WANT' thats desire U r left with HAPPINESS.
10.Life does not provide Warranties N Guarantees. It only provides possibilities N opportunities. Don't miss them. Make BEST of it.
11. 2 things decide the success in our life: The way Mangae when u have nothing in hand& the way we Behave when we have everything in hand.

Thursday, December 16, 2010

Automation-Selenium Ajax Application

For ajax applications waitForPageToLoad wouldn’t work since the page is not actually loaded to refresh the Ajax element. Instead of using Thread.sleep(xxx) we can wait for a specified period and then continue once we found the element.

waittime=10;
while(waittime!=0){
try { if (selenium.isElementPresent("webelement")) break; } catch (Exception e) {}
Thread.sleep(1000);
waittime--;
}



WebDriver

WebDriver
Uses Selenium’s javascript Selenium-Core. WebDriver does not depend on a javascript core embedded within the browser, therefore it is able to avoid some long-running Selenium limitations.
Sample:
package
com.sample.tests;

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.RenderedWebElement;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class LoginPage {
public static void main(String[] args) throws Exception {
// The Firefox driver supports javascript
WebDriver driver = new FirefoxDriver();

// Open Loginpage
driver.get("http://localhost:8220/login.jsp");

// Enter the query string "Cheese"
WebElement userId = driver.findElement(By.id("loginName"));
WebElement password = driver.findElement(By.id("password"));
WebElement submit = driver.findElement(By.id("submitbtn"));

loginName.sendKeys("Maddy");
password.sendKeys("pass");
submit.click();
try{
if(driver.findElement(By.id("LoggedusrNm"))!=null)
Assert.assertEquals("Done");
}catch(NoSuchElementException e){
Assert.fail("No LoggedUser label available");
}
}
}

Rational Functional Tester Feature-Benefit

Refer:
http://www-01.ibm.com/software/awdtools/tester/functional/features/