Sunday, August 19, 2012

Selenium Commands – “Selenese”


ActionsAccessors, and Assertions.
}Actions are commands that generally manipulate the state of the application. They do things like “click this link” and “select that option”. If an Action fails, or has an error, the execution of the current test is stopped.
Øselenium.click("id=gbztms");
Øselenium.select("id=citytravel_city", "label=Bangalore");
}Accessors examine the state of the application and store the results in variables, e.g. “storeTitle”. They are also used to automatically generate Assertions.
ØString Google = selenium.getTitle(); 
Øselenium.type("id=gbqfq", Google);
}Assertions are like Accessors, but they verify that the state of the application conforms to what is expected. Examples include “make sure the page title is X” and “verify that this checkbox is checked”.
ØassertTrue(selenium.isElementPresent("id=lga"));
ØassertEquals(selenium.getTitle(), "Google");

No comments:

Post a Comment

Thanks for your valuable comments