Hi again,

It is hard to say what you doing wrong, you trying different options, but I
don't see a system in your search. Let start from

B.WebElement("innertext:=Apple").click

Here you don't say which element you use, if you have for example
<TD><DIV class=x-combo-list-item _nodup="30812"
viewIndex="1">Banana</DIV></TD>

td and div elements will have the same inner text.

if you have "Banana" world in other place, again, it may be not unique,
example
<TH>Banana</TH>
....
<DIV class=x-combo-list-item _nodup="30812" viewIndex="1">Banana</DIV>

The system can be, for example:

1. Add object to the object repository (disable smart identification)
2. Reopen the Obj Rep - sometimes smart identification still works (remebers
the index of object),  even if it disabled
3. Make exact copy of the object in by descriptive programming methods
4. Add index:=0 to the description, you even can start from it

Try
B.WebElement("innertext:=Apple", "index:=0").Highlight()
B.WebElement("innertext:=Apple", "index:=1").Highlight()
index will make your object unique for sure.

5.  If the object found, start to remove unnecessary properties

the other thing you can do
print B.WebElement("innertext:=Apple", "index:=0").outerhtml
print B.WebElement("innertext:=Apple", "index:=1").outerhtml

and you will see what QTP means, when it says the object is not unique


My main point is, if option A doesn't work, don't try immediately option
B,C, etc. You need to debug objects in the same way you debug code, you need
not to search for working solution, but locate the problem.

Roman

On Mon, Dec 14, 2009 at 11:15 PM, Daim Phillips <[email protected]> wrote:

> I have tried this but failed
>
> set B = Browser("name:=ABC").Page("title:=ABC")
> B.WebElement("innertext:=Apple",  "innerhtml:=Apple", "html tag:=DIV",
> "height:=20").click
>
> It always say to use the unique property, although innertext and innerhtml
> is always unique
> *
> One thing to Notice: *
>
> The test ran successfully when I did the first time. It executed very well
> as following
>
>
> B.WebElement("innertext:=Apple").click
> B.WebElement("innertext:=Mango").click
>
> B.WebElement("innertext:=Banana).click
>
> But as soon as I closed it, and ran it again, it started asking me to
> provide unique property.
>
> Hope anyone can guide me regarding this.
>
>
>  --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<mercuryqtp%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
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/MercuryQTP?hl=en

Reply via email to