Micro Focus QTP (UFT) Forums
identification difference between descriptive prog and repository - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: identification difference between descriptive prog and repository (/Thread-identification-difference-between-descriptive-prog-and-repository)



identification difference between descriptive prog and repository - gerfred - 07-27-2010

hello,

I try to use a descriptive element in order to parameterize a part of objet description (innerhtml for now)

When I use this descriptive line QTP gave me an error (Cannot identify the object "[ WebElement ]" (of class WebElement). Verify that this object's properties match an object currently displayed in your application.)

Code:
Browser("").Page("").WebElement("html tag:=SPAN, class:=dijitTreeLabel, innertext:=test").
Click ==> KO

If I add this element to repository manually and add the same things for identification, it works

lets say add testObj in repository as WebElement using :
innertext => test
html tag => SPAN
class => dijitTreeLabel

Code:
Browser("").Page("").WebElement("testObj")
.Click => it works


Where do I make an error ?


RE: identification difference between descriptive prog and repository - PrabhatN - 07-27-2010

Hello gerfred,

Try
Code:
Browser("").Page("").WebElement("html tag:=SPAN", "class:=dijitTreeLabel","innertext:=test").Click   instead of Browser("").Page("").WebElement("html tag:=SPAN, class:=dijitTreeLabel, innertext:=test").Click

You have to specify every property within different sets of double quotes.

Hope this will work now.


RE: identification difference between descriptive prog and repository - gerfred - 07-27-2010

many thanks it works for now

regards,


RE: identification difference between descriptive prog and repository - bfakruddin - 07-28-2010

Code:
systemutil.Run "iexplore", "www.google.com"

'* Using Descriptive Programming
msgbox Browser("Creationtime:=0").GetROProperty("name")

Dim des
Set des=description.Create()
des("micclass").value="Link"

Set val = Browser("Creationtime:=0").page("index:=0").ChildObjects(des)

For i=0 to val.count-1
    res = val(i).getroproperty("name")
    print res
    If (res = "Sign in") Then
        Browser("Creationtime:=0").page("index:=0").Link("name:="&res).Click
        Exit For
    End If
Next



'* Using Object Repository
Browser("Google").Page("Google").Link("Sign in").Click