Hi Jian
  I am exploring the possibility of adding support for xforms:repeat  in
Tellurium . This is very similar to a table except for accessing the element
within it  i.e

<xforms:repeat id="repeater1"/>
    <xforms:input id="inp1" />
    <xforms:input id="inp2" />
</xforms:repeat>

xforms:repeater[1]/xforms:inp...@id="inp1" ]  DOES NOT WORK.

and the Selenium extension code for accessing this looks like the one below.
How do I implement this as a List / table equivalent in Tellurium . Let me
know

Regards
Hari

Selenium.prototype.getRInputRefValue = function(locator, paramarray) {
        var tagToCheck="xf:input";
        var attrToCheck = "ref";
/*
    There should be a better way to pass parameters from the java code
instead of the ugly comma separated values
*/
        var arr = paramarray.split(",");
        var inpRef="";

        if (arr.length == 2) {
            inpRef = arr[0];
            index = arr[1];
        } else {
            return;
        }

        var repeatElement = this.page().findElement(locator);
        var content = repeatElement.anonymousRepeatContent;

        var curRow = content.childNodes[index];
        var nodes = curRow.childNodes;
/*
    There should also be a better way to get the elements from a descendant
    rather than using this . But all the rest use the document element
*/
        for (var i=0; i< nodes.length; i++) {
            var tag = nodes[i].tagName;
            if(tag) {
                var attrValue = nodes[i].getAttribute(attrToCheck);
                if (attrValue ) {
                    if (attrValue == inpRef && tag == tagToCheck) {
                        var curValue = nodes[i].getCurrentValue();
                        return curValue;
                    }
                }
            }
     }
     return "";
};

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"tellurium-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/tellurium-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to