So, what do you do when UFT cannot identify and object?
OK, I've used all the unique property values of an WebElement found through ObjectSpy, I even threw in (manually added) and Index value.
Here is my Code:
Set MyBrowser = Browser("Micclass:=Browser","CreaTionTime:=0").Page("Title:=.*")
MyBrowser =WebElement("Class:=WebElement","HtmlTag:=FIGCAPTION","InnerText:=Auto", "Index:=0").Click
And I'm getting the following error messege:
Cannot identify the object "[ WebElement ]" (of class WebElement).
Verify that this object's properties match an object currently displayed in your application.
Line (8): "MyBrowser =WebElement("Class:=WebElement","HtmlTag:=FIGCAPTION","InnerText:=Auto", "Index:=0").Click".
Tip: If the objects in your application have changed, the Maintenance Run Mode can
help you identify and update your steps and/or the objects in your repository.
So, I ran the script through 'Maintenance Mode,' and UFT commeneted out mline 8 and produced the followiing code: MyBrowser =Browser("AllState").Page("Auto Insurance Quotes").Link("Auto").Click
And, the script ran successfully!
The question here is : ObjectSpy spied the proprty as "WebElement' and I used accordingly, AND 'Oparetion' is 'Click'
UFT idenfied the object as 'Link' with 'Click' operation!
Would anybody please tell me the difference and reason(s) for failure?
Thank for reading.
You code at the top is syntactically incorrect, you are creating a Browse/Page object and then trying to redefine it with a Click method.
When I spy the object I see its class as WebList, this works for me:
Browser("micClass:=Browser").Page("micClass:=Page").WebList("html id:=state").Select "FL"