[ptt-users] TestMaker: "Error getting page String index out of range"

Lars Huttar lars_huttar at sil.org
Thu Sep 27 13:47:26 PDT 2007


Hello all,

I've been reading up on TestMaker 5 the last few days.
I dabbled with it a few months ago, but after reading about the new 
features in v5, decided to take the plunge and invest the time to see if 
TM can do what we need.
The introductory info has gotten me pretty excited, but after running 
into some significant potholes early on, the excitement is starting to 
be replaced by wondering whether TM can be relied upon to do the job 
without requiring lots of time to work around problems.

What I'm trying to get to work right now is this.
I have a TestGen4Web unit test with the following action:
        <action type="click" refresh="true" step="2">
            
<xpath><![CDATA[*/a[@href="proof/summary-by-continent"]]]></xpath>
            <value><![CDATA[]]></value>
        </action>

When the test runs, I get the following output in Local TestNode Output:
> Step  2: (click)
>     Executing: click
> Error getting page String index out of range: -5
> Got page: Ethnologue Publishing Home [which is the old page, not the 
> page I'm clicking on the link for]
So somehow, this action is failing because, as it seems, the 
[@href="..."] predicate is failing via a string index out of range.

Initially when I generated the unit test using TestGen4Web, the <xpath> was:
            <xpath><![CDATA[*/A[@CDATA="Summary by
        area"]]]></xpath>
which resulted in the output
>     Executing: click
> oldXpath  */A[@CDATA="Summary byarea"]: newXpath 
> "//a[string()="Summary byarea"]"
> Elem null
> Error getting page null

So it looked like that was failing because the CDATA containing a 
carriage return was not working as a selector.
That's why I changed the predicate to use [@href="..."].

The "String index out of range" messages seems to be a Python error.
I'm wondering whether this <xpath> stuff is really XPath, or just a 
semblance thereof. I haven't been able to find reference documentation 
for it.
For example @CDATA doesn't seem to be real XPath, and then there's the 
question of whether HTML elements like A are case-sensitive.
I guess this is a TestGen4Web issue, but it seems to be obstructing use 
of TM, so maybe that makes it of concern to TM.

Any help is appreciated.

Lars






More information about the Users mailing list