Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get rid of this error in QTP?
#1
Solved: 8 Years, 4 Months, 2 Weeks ago
I am new to QTP and trying to resolve the error. I have used the dynamic method of Descriptive programming. When running the below code I get this error:
"The "[ WebButton ]" object's description matches more than one of the objects currently displayed in your application. Add additional properties to the object description in order to uniquely identify the object."
Code:
My script is:

Set oDesc=Description.Create()
oDesc("title").value="Google"
Set oDesc1=Description.Create()
oDesc1("name").value="q"
Set oDesc2=Description.Create()
oDesc2("html tag").value="INPUT"
oDesc2("height").value="30"
oDesc2("index:").value="0"

Browser(oDesc).page(oDesc).WebEdit(oDesc1).Set 10
Browser(oDesc).page(oDesc).WebButton(oDesc2).Click
I have used "index" property in order for QTP to uniquely identify the object.

Please help.
Reply
#2
Solved: 8 Years, 4 Months, 2 Weeks ago
instead of:
oDesc2("height").value="30"
try WebButton("value:=Submit").Click

where "Submit" is the text on the button
using your format my example would be
oDesc2("value").value="Submit"
Reply
#3
Solved: 8 Years, 4 Months, 2 Weeks ago
Code:
Set oDesc=Description.Create()
oDesc("title").value="Google"
Set oDesc1=Description.Create()
oDesc1("name").value="q"
Set oDesc2=Description.Create()
oDesc2("html tag").value="Submit"
oDesc2("height").value="30"
oDesc2("index:").value="0"
Reply
#4
Solved: 8 Years, 4 Months, 2 Weeks ago
Thank you. I will try your format too.

I tried this:

Browser(oDesc).page(oDesc).WebButton(oDesc2,"index:0").Click

This is working for me now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)