Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to check if selection in menu exists..
#2
Solved: 10 Years, 9 Months ago
The only way I have found to do this is select the item and trap the error that is returned if it's missing. It's a little messy, but it works...hopefully. I haven't had a reason to try this in an actual script, just tried a few things after reading your post.

Code:
on error resume next 'disable error trap
VbWindow("APP").WinMenu("Menu").Select("Tools;Loop Options...")
if Err.Number <> 0 then
  VbWindow("APP").WinMenu("Menu").Select("Tools;XML Loop Options...")
end if
on error goto 0 'reset error trapping

Another option might be to see if the window exist instead of the Err.Number. if the expected window does not exist then select the other menu option. Either way you have to bypass the error handler to continue.

GL.
Reply


Messages In This Thread
RE: how to check if selection in menu exists.. - by jsknight1969 - 10-15-2009, 08:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Windows Application Custom Combo box selection change event not firing in uft RamUFT 0 827 02-06-2020, 08:10 AM
Last Post: RamUFT
  Web List Selection mhanaan 1 7,190 11-24-2012, 03:30 AM
Last Post: imzeeshan
  SparkDropdownList value Selection Issue DivyaKurup 2 3,205 08-14-2012, 09:42 AM
Last Post: souvikghosh_diatm
  Testing field visibility based on checkbox selection anthony1carr 1 2,460 04-03-2012, 09:37 AM
Last Post: sshukla12
  text exists or not sujaravi123 3 5,035 11-09-2011, 11:57 PM
Last Post: as_srini

Forum Jump:


Users browsing this thread: 1 Guest(s)