var xmlStr = '' +
'<people>' +
' <person gender="male">' +
' <name>Ant</name>' +
' <hair>Shaggy</hair>' +
' <eyes>Blue</eyes>' +
' <height measure="metric">176</height>' +
' </person>' +
' <person gender="male">' +
' <name>Paul</name>' +
' <hair>Spiky</hair>' +
' <eyes>Grey</eyes>' +
' <height measure="metric">178</height>' +
' </person>' +
'</people>';
var $x = new XML(xmlStr);
_assertEqual("Ant", $x.person[0].name.toString());
_assertEqual("Grey", $x.person[1].eyes.toString());
for each (var $p in $x.person){
var $measure = $p.height.@measure.toString();
_assert($measure == "metric");
_assert($p.height > 170);
}
Friday, June 26, 2009
Parsing XML in Sahi scripts
Tuesday, June 23, 2009
Configuring Eclipse for Sahi
Thursday, June 04, 2009
Increasing interaction with Sahi users
Wednesday, June 03, 2009
HTTPS Problem Resolution: Unable to tunnel through proxy
Thursday, May 21, 2009
Sahi V2 Release 2009-05-21 is now available!
Please use and give feedback to make next release more stable. Download here
* Features added
Optimizations to increase speed.
Optimized listing of log files.
Added better error messages for el = null errors.
Added tests for failing features.
Added _parentNode(el, tagName, occurrence),
Added _parentCell(el, occurrence)
Added _parentRow(el, occurrence)
Added _parentTable(el, occurrence)
Added _cell("cellText")
Added _in() and modified other accessors to take inElement as parameter
saveAs looks at Content-Disposition: attachment to download files
Added tests around accessor identification
Test and highlight on the Recorder tab work on selected text
Temp files saved via "Save As" have session id prefixed to prevent overwrite.
_near
_rte for richtext editors based on iframe
Reset button added to Playback. Does not refresh page.
_scriptPath added
_type added to type partial content without blur or onchange.
moved to chunked encoding
Added element.visibility_check.strict = false to sahi.properties. This is the default now.
Added download.download_if_contentdisposition_is_attachment = false to sahi.properties.
Set this to true to automatically download files with header Content-Disposition:attachment.
Causes problems with blogger.com profile images.
Stubs for Sahi's APIs and basic objects like window and document added.
This allows variable declarations like
var $ln = _link("Form Test");
_click($ln);
Added xhr.wait_when_ready_state_3 to sahi.properties.
Set to false for cases if some XHRs never reach readyState 4. Needed for gmail.
* Bugfixes
Playback to recorder tab switch when moving between multiple domains during playback fixed.
Messages displayed multiple times during retry of step removed. Shows only once.
Fixed NaN error in _logException and _logExceptionAsFailure.
Fixed Content-Type related errors for state.js.
Fixed order of response headers (SignIn Cookie problem).
Log viewer shows file not found message and does not throw exception on console.
Autosuggest on Controller Accessor field does not disappear to the right.
APIs dropdown only lists public APIs of Sahi
_imageSubmitButton indexes fixed. (Treats alt and title equivalently)
saveAs NPE fixed
Fixed traffic logging. It had stopped working after moving to streams.
Divs are identified as _div instead of _spandiv
Spans are identified as _span instead of _spandiv
Wednesday, May 20, 2009
Sahi Forums updated
The new Sahi forums have a few nice features, namely:
- Tagging topics.
- Sending private messages.
- Ability to mark a topic "Closed".
- Private forums for paid customers.
- Adding attachments (for paid customers).
Wednesday, April 22, 2009
Sahi V2 Nightly Unstable Build 2009-04-23 Released
This build has a few significant improvements. It now uses Rhino 1.6R2 as its Javascript engine.
NOTE that this and further builds need Java 1.5 or greater.
* API _near, similar to _in has been added. Any element can be found relative to another by using _near.
Eg.
_checkbox(0, _near(_span("user name 1")))
_link("delete", _near(_span("user name 1")));
* All Sahi accessor API calls can be set to variables now.
Eg.
can be written now as
_click(_link("click me"));
$ln = _link("click me");
_click($ln);
* Check for visibility of elements is now controlled via element.visibility_check.strict property in sahi.properties. It is set to false by default.