Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Surpress (or other) Warning messages
#1
Solved: 11 Years, 4 Months, 3 Weeks ago
I have 8 dialog boxes that Can open depending on a link. There are just to many reports and name changes to track which report will use which dialog box. So, my code looks at each dialog box that opens and determines my the characteritics which dialog box has opened, then runs my code for the test.

My code:
Code:
If blFlagA1="True" AND blFlagA2="True" AND blFlagA3="True" AND blFlagA4="True" Then
  ...
End If

If blFlagB1 = "True" AND blFlagB2 = "True" Then
  ...
End If

If blFlagCA1="True" AND blFlagC2="True" AND blFlagC3="True" Then
  ...
End If
...

But I noticed in my Results, for each object that the Flags are not found, I recive a Warning Message: "The object was not found using the test object description. Check the object's properties". Which is correct as the correct dialog box for these does not exist. Continuing on in the code will find the correct Flag matches, or end in error.

How can I turn off the Warning when/if the first, second ... etc If/Then statement is not encountered?

Any ideas?
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi Lorena...
Please check if the object exists first for each flag. It is a good practice which will avoid some run time errors.

Browser(..).Page(..).Exist(1) -- it return true or false ...based on tht u can build ur logic.

Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi Lorena,

This error comes usually when smart Identification is turned on. The object was not found in The OR so qtp is searching it using the smart identification (any object with similar description). Thats why u r getting the warning message.

I faced the similar problem once. I deleted the old object from The OR and added the new one. My problem was solved.

U can also try this. I hope this would work for u as well.

Do let me know if it doesn't work.

Regards,
Ankesh

Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
@vIns, yes, some of the objects are in my OR. But they change names daily, so I need to use DP to execute my code.

@Ankesh, you are correct. I disabled the smart ID. But now my script is failing in others places. Must I relearn my objects?

thx
Reply
#5
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi..u can use regular expression in OR to identify the objects for which the name changes...
Reply
#6
Solved: 11 Years, 4 Months, 3 Weeks ago

Hey dont disable the Smart Identification. Just re-add the object and use it in ur script (just to chk if it works).

Yes @VIns suggestion sounds good to me. U can use regular expression in The OR itself for the objects changing its properties daily.
Reply
#7
Solved: 11 Years, 4 Months, 3 Weeks ago
perfect, good study
Reply
#8
Solved: 11 Years, 4 Months, 3 Weeks ago
Im not so good with RegExp, but I will try. I will look into this... Thx! ;-)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help for instruction to click on Skip button in the warning message vijilesh 0 1,555 09-16-2018, 03:48 PM
Last Post: vijilesh
  need to check Alert messages in scripting setukaran 2 3,499 11-21-2014, 01:16 AM
Last Post: prs2014
  Warning in Report profqa 2 4,490 12-06-2013, 10:12 AM
Last Post: profqa
  Problem in Handling Security Warning Window yasseema 3 5,081 06-06-2013, 10:11 AM
Last Post: vinod123
  How does QTP detect error messages? melody 4 5,543 09-23-2011, 04:37 AM
Last Post: dial_QTP

Forum Jump:


Users browsing this thread: 1 Guest(s)