Blog

Latest Updates. News. Insights. Ideas.

DCB2 Archives - Sahi Pro

Sahi in DevCamp

Posted by | DCB2, Sahi, talks | No Comments

Presented on Sahi in DevCamp Bangalore held in the ThoughtWorks office. I spoke in the 10.30 slot and was pleasantly surprised by the turnout. Show cased how Sahi can be used to test https and AJAX sites using the example of gmail. The response was encouraging.

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"), ", ");
_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.

Use fully-loaded Sahi Pro FREE for a month. Download Now Request a Demo