I tried to debug the evaluateXPath() method without any success. Does anyone
know how can I check in the response if the element I am asking for exists?

Thanks

2009/10/14 Hernan Castagnola <[email protected]>

> Also if I use this Xpath:
> id('c-185')  -> Works
> id('c-185')/div ->Breaks
>
>
> 2009/10/14 Hernan Castagnola <[email protected]>
>
> I have been doing some tests in order to figure out what is breaking the
>> storeXpath task and this are my findings:
>>
>>
>> html:
>>
>> <div id="home">
>>  <!-- COLUMNA 1 -->
>> <div class="column">
>>  <div id="c-185" class="block">
>>  <div class="cb">
>> <div class="bt">
>> <div/>
>> </div>
>> <div class="i1">
>> <div class="i2">
>> <h3 class="i3">
>> <a href="http://www.olx.com/for-sale-cat-185 ">
>> <strong>For Sale</strong>
>> </a>
>>
>> This is the xpath I was using.
>> //d...@id='home']/d...@class='column']/d...@class='block' and
>> @id='c-185']/d...@class='cb']/d...@class='i1']/d...@class='i2']/h...@class='i3']/a
>>
>>
>> It gets all the content until:
>> //d...@id='home']/d...@class='column']/d...@class='block' and @id='c-185']
>>
>> but if I try
>>
>> //d...@id='home']/d...@class='column']/d...@class='block' and
>> @id='c-185']/d...@class='cb'] it doesn't find the element. So when
>> "/d...@class='cb']" is added it breaks.
>>
>>
>> I am not sure why it's breaking.
>>
>> Is there any way to create my own storeXPath or any other solution to
>> this?
>>
>> Thanks in advance,
>>
>>
>> Hernan
>>
>> 2009/10/13 Hernan Castagnola <[email protected]>
>>
>>> I was wondering if I can use the
>>> *storeLinkParameter*
>>> with an xpath. It seems that only identifies elements through id
>>>
>>> http://webtest.canoo.com/webtest/manual/storeLinkParameter.html
>>>
>>> Thanks,
>>>
>>> Hernan
>>>
>>> 2009/10/13 Hernan Castagnola <[email protected]>
>>>
>>> I need to check if some links in the site I am testing have the
>>>> rel=nofollow attribute or not.
>>>> This is how I am doing this:
>>>>
>>>>   storeXPath description:"Stores nofollow value" ,
>>>> xpath:"//d...@id='home']/d...@class='column']/d...@class='block' and
>>>> @id='c-185']/d...@class='cb']/d...@class='i1']/d...@class='i2']/h...@class='i3']/a/@rel",
>>>> property:"rel"
>>>>
>>>>  verifyProperty name:"rel" , value:'nofollow'
>>>>
>>>>
>>>> I am not sure why but the store xpath method is returning the following
>>>> error:
>>>>
>>>> No match for xpath expression
>>>> <//d...@id='home']/d...@class='column']/d...@class='block' and
>>>> @id='c-185']/d...@class='cb']/d...@class='i1']/d...@class='i2']/h...@class='i3']/a/@rel>
>>>>
>>>> How ever when I check it with the xpather
>>>> "//d...@id='home']/d...@class='column']/d...@class='block' and
>>>> @id='c-185']/d...@class='cb']/d...@class='i1']/d...@class='i2']/h...@class='i3']/a"
>>>> it finds the element.
>>>>
>>>> I have been following some 2007 therads about this and it seems they
>>>> solved it adding an id to the element, but I can't do that.
>>>>
>>>> Another theory was that it was failing because there is no rel attribute
>>>> for that link. So I thought that the webtest instead of setting the 
>>>> property
>>>> to null (when the property is not present) it was returning a fail. I tried
>>>> with the href attribute and it also failed. So it has nothing to do that 
>>>> the
>>>> rel attribute is not set for that element. Is something with the xpath.
>>>>
>>>> Does anyone has any idea how can I solve this issue. Is this a webtest
>>>> bug?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Hernan
>>>>
>>>>
>>>
>>
>

Reply via email to