when we write simple selenium RC code , Selenium Notes, Examples, videos, by.www.laxmiroy.blogspot.com/
selenium.type("fname", "niraj");
selenium.type("lname", "KUMAR");
it doest call blur functions to change cases of the first name and last name.
But by using fireEvent fuction of selenium we can call blur function.
selenium.type("fname", "niraj");
selenium.fireEvent("fname", "blur");
selenium.type("lname", "KUMAR");
selenium.fireEvent("lname", "blur");
How this works is :
First this will type "niraj" in First Name and then selenium.fireEvent("fname", "blur"); this will call the onblur fuction "upperCase()" which changes the First Name in upper case "NIRAJ".
then it types in Last Name and then selenium.fireEvent("lname", "blur"); which means it will press tab and lost the function and on the lost focus it calls
blur function lowerCase which changes the Last Name in lower case.
No comments:
Post a Comment