Hi John,
thank you for your help with this.
I am trying out my second issue first, namely the 'Wholename on OFAC list'
issue. I have come up with this so far:
<verifyXPath description="Check raises an alert 2"
xpath="//tr[./td[1]/child::a='Wholename Retail on OFAC list']"/>
This actually passes the test: using the xpath I can find the element a that
matches the text specified. The second part of my test is a bit trickier it
seems. I can't seem to find the second <td> in which there is an element <font>
that has the value 'Alert'.
I tried the following:
<verifyXPath description="Check raises an alert 2"
xpath="//tr[./td[1]/child::a='Wholename Retail on OFAC
list']/td[2]/font=normalize-space('Alert')"/>
The test comes back with an error message:
xpath test: //tr[./td[1]/child::a='Wholename Retail on OFAC
list']/td[2]/font=normalize-space('Alert') evaluates to false
I also tried without normalize-space, to no avail. I also move the second part
before the closing square bracket, but no success either.
I will continue trying of course, but if you have any ideas, don't hesitate!
Thank you
Gert
P.S. I attach a sample source code.
From: [email protected]
To: [email protected]
Subject: Re: [Webtest] Verifying texts at exact location on screen
Date: Thu, 18 Feb 2010 14:42:11 -0600
What about xpath?
For 1 you can use a pretty restrictive xpath to verify the location in the dom,
in your example //tab...@id='tableCustomerData']/tr[1]/td[1]. You could store
that xpath and then verify the property or get fancier with the xpath to do the
verification within the xpath
For 2 you could use following:sibling if your data is in a table.
//tab...@id='tableCustomerData']/tr/td[contains(.,'yourCustomerId)]/following-sibling::*
Again you could store the xpath and verify the property or possibly get fancy
with xpath to do it for you.
Hope this helps, I think xpath might be the solution you are looking for do a
google search for xpath tutorial and go through the w3cschools tutorial if you
don't know about xpath. http://www.w3schools.com/xpath/
I guess you could do all that with scriptStep and some JS scripting:
http://webtest.canoo.com/webtest/manual/scriptStep.html
I might be wrong though, I am still a newbie at this - others might provide
more insight.
Enjoy!
On Thursday 18 February 2010, Gert Pauwels wrote:
> Hi,
>
>
>
> We have been using Canoo for quite some time now, and are always looking to
> extend its use. I have two issues I'd like to discuss:
>
>
>
> 1 verifying text for its exact location on the screen
>
> 2 verifying texts that on screen are displayed next to each other (but
> source page contains tabs etc.)
>
>
>
> 1 Verifying text and exact location
>
>
>
> Our webpage is divided into several sections. Each section contains a
> number of fields in any number of rows and columns. Let's look at one
> field. If for instance Customer ID is on my screen, it will have specific
> location (row 0 = top row, column 0 = left most column). I can verify that
> the field is present alright, but I would like to find a way to determine
> its exact location. If my field is in row 2, column 1 then I need to be
> able to that in Canoo. The question is how? (I've attached a screenshot)
>
> Example:
>
>
>
> first column caption: Assigned to
>
> first colunm value for that field: Richard Branson
>
>
>
> second column caption, row 3: Branch Name
>
> value for this field: Tokyo Branch
>
>
>
> How do I make Canoo know that the value Tokyo Branch is the value for
> Branch Name, and not for the Assigned to field?
>
>
>
> 2 Verifying text next to each other
>
> I need to find a way to determine whether for the text on the left hand
> side of the screen the text on the right hand side of the screen matches a
> given value. Looking at the source of the webpage, I cannot find any hooks
> to tie myself onto for this. An example:
>
>
>
> Check on EU List (some spaces, tabs or whatever later, invisible to the
> user) Alert
>
> Check on OFAC list (some spaces, tabs or whatever later, invisible to the
> user) Pass
>
>
>
> When running Canoo, I need to be sure that when I verifyText 'Alert' this
> is for the value 'Check on EU List' and not for any other text that may
> appear on the same page.
>
> If possible, how?
>
>
>
> Thanks for your assistance
>
>
>
> Gert Pauwels
>
> _________________________________________________________________
> Hotmail: Free, trusted and rich email service.
> https://signup.live.com/signup.aspx?id=60969
>
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969
<tr>
<td>
<a
href="/norkom/wlm/detection/editCheck.do?check_id=2731">Wholename Retail on
OFAC list</a>
</td>
<td>
<font color="#FF0000">
Alert
</font>
</td>
</tr>