Hi
Reviving this thread again . Most of the customUi calls work by passing
the id from the UI and generate the xpath. So the following works
ui.Container(uid:"switch1", clocator: [id:"switch1", tag:"switch"],
namespace:"xforms",group:"true") {
ui.Container(uid:"case1",clocator:[id:"case-1",
tag:"case"],namespace:"xforms")
}
since the xpath is of form
xforms:swit...@id='swaitch1']//xforms:ca...@id="case1"]
But in the case of xforms repeat which means that a homogenous set of
elements can be repeated
<xforms:repeat id="repeater1"/>
<xforms:input ref="inp1" />
<xforms:input ref="inp2" />
</xforms:repeat>
means a row containing 2 fields can be repeated any number of times. an
xpath like this DOES NOT WORK
//xforms:repe...@id='repeater1']/xforms:inp...@id='inp1']
Locating inp1 within the repeater1 is part of the custom selenium code .
So I am looking for a way to change the xpath generated
Regards
Hari
On Tue, May 19, 2009 at 6:54 PM, Jian Fang <[email protected]> wrote:
> I am not very clear about what the following xform does,
>
> <xforms:repeat id="repeater1"/>
> <xforms:input id="inp1" />
> <xforms:input id="inp2" />
> </xforms:repeat>
>
> Will the inp1 and inp2 be repeated for a given times? Do you need to
> specify the times? or
> have to check in Runtime?
>
> Looks like a list, instead of a table. For example
>
> List(uid: "repeater1", clocator: [tag: "repeat"], namespace: "xforms"){
> InputBox(uid: "all", clocator: [tag: "input"], namespace: "xforms")
> }
>
> Another way is to implement xforms as Tellurium widgets
> so that you can handle them differently from a regular Tellurium object.
>
> Thanks,
>
> Jian
>
>
> On Mon, May 18, 2009 at 11:26 PM, Harihara Vinayakaram
> <[email protected]>wrote:
>
>> 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
-~----------~----~----~----~------~----~------~--~---