Below is the code that was need to automate gmail.
function login($username, $password){
_setValue(_textbox("Email"), $username);
_setValue(_password("Passwd"), $password);
_click(_submit("Sign in"));
}
login("sahi.abcde", "tough123");
_click(_spandiv("Compose Mail"));
_setValue(_textarea("to"), "<dummy.email@example.com>, ");
_setValue(_textbox("subject"), "important subject");
_rteWrite(_rte(0, _near(_textbox("subject"))), "lots of content");
_click(_spandiv("Send[9]"));
_assertExists(_cell("Your message has been sent. View message"));
_click(_link("Sent Mail"));
_assertExists(_spandiv("To: dummy.email"));
_click(_checkbox(0, _near(_spandiv("To: dummy.email"))));
_expectConfirm("You are about to move the entire conversation to the Trash. Are you sure you want to trash the entire conversation containing your sent message?", true)
_click(_spandiv("Delete[14]"));
_assertExists(_cell("The conversation has been moved to the Trash. Learn more Undo"));
_assertExists(_cell("No sent messages! Send one now!"));
_click(_link("Sign out"));
This was the first cut, of which all lines except those using _near were recorded via the Sahi controller.
I will follow up with a more detailed post on other discussions I had in DevCamp.
Note that _near is available only in the most recent nightly build (2009-04-11)
This nightly release was made for folks at DevCamp who wish to replicate what I demoed.
No comments:
Post a Comment