|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
StoreXpath (Not finding the xpath element) - Save element property - Test nofollow "@rel"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:"//div[@id='home']/div[@class='column']/div[@class='block' and @id='c-185']/div[@class='cb']/div[@class='i1']/div[@class='i2']/h3[@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 <//div[@id='home']/div[@class='column']/div[@class='block' and @id='c-185']/div[@class='cb']/div[@class='i1']/div[@class='i2']/h3[@class='i3']/a/@rel> How ever when I check it with the xpather "//div[@id='home']/div[@class='column']/div[@class='block' and @id='c-185']/div[@class='cb']/div[@class='i1']/div[@class='i2']/h3[@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 |
|
|
Re: StoreXpath (Not finding the xpath element) - Save element property - Test nofollow "@rel"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 <castagnolah@...> I need to check if some links in the site I am testing have the rel=nofollow attribute or not. |
|
|
Re: StoreXpath (Not finding the xpath element) - Save element property - Test nofollow "@rel"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">
This is the xpath I was using. //div[@id='home']/div[@class='column']/div[@class='block' and @id='c-185']/div[@class='cb']/div[@class='i1']/div[@class='i2']/h3[@class='i3']/a It gets all the content until: //div[@id='home']/div[@class='column']/div[@class='block' and @id='c-185'] but if I try //div[@id='home']/div[@class='column']/div[@class='block' and @id='c-185']/div[@class='cb'] it doesn't find the element. So when "/div[@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 <castagnolah@...> I was wondering if I can use the |
|
|
Re: StoreXpath (Not finding the xpath element) - Save element property - Test nofollow "@rel"Also if I use this Xpath:
id('c-185') -> Works id('c-185')/div ->Breaks 2009/10/14 Hernan Castagnola <castagnolah@...> I have been doing some tests in order to figure out what is breaking the storeXpath task and this are my findings: |
|
|
Re: StoreXpath (Not finding the xpath element) - Save element property - Test nofollow "@rel"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 <castagnolah@...> Also if I use this Xpath: |
| Free embeddable forum powered by Nabble | Forum Help |