Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Check an object existing on a Browser
#1
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi all,

I check the object "btnNo" button existing by the code as:

Code:
rc = Browser("EmailReport").Page("Report").WebButton("btnNo").Exist(60)
or
   rc = Browser("EmailReport").Page("Report").WebButton("btnNo").WaitProperty("disabled", 0, 60000)

Sometimes rc = True and sometime rc = False, although this page loaded before 60s.
I can not understand this point. So can anybody help me on that?

Many thanks,
linhke


Attached Files Image(s)
   
Reply
#2
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi linhke,
Verifying if every time child window is in focus while you are checking for the button existence might help.



Reply
#3
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi Rajeshwar,

Could you tell me how to focus it?

Thanks,
linhke
Reply
#4
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi Linhke,

You need to capture Handle to the window and then activate the child window.

Sample Code:
Code:
shwnd= Browser("Buddy List").Object.HWND
Window("HWND:="&shwnd).Maximize
Window("HWND:="&shwnd).Activate
Reply
#5
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi Rajeshwar,
I tried as:

Code:
shwnd= Browser("Cyber_2").Object.HWND
Window("HWND:="&shwnd).Activate
but QTP inform General run error at line (shwnd=Browser("Cyber_2").Object.HWND) Sad

linhke
Reply
#6
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi Linhke,

What is the error, Please share the error description.

Window("HWND:="&shwnd).Maximize statement is working ?

Another Way to Capture handle to window:
Code:
hWnd = Browser("browser_name").GetROProperty("hwnd")
   Window("hwnd:=" & hWnd).Maximize
Reply
#7
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi Rajestwar,

Both of way is not worked. I got the Run Error when trying with these ones:
"The operation cannot be performed"

linhke
Reply
#8
Solved: 10 Years, 8 Months, 4 Weeks ago
Hi Rajeshwar,
My problem was solved. The root cause is from me. I forgot configure Object Identification for the browser to QTP identify the unique to the Creation Time.

Thanks for your support,
linhke
Reply
#9
Solved: 10 Years, 8 Months, 4 Weeks ago
Great, Good to hear that issue is resolved.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Check Object Spacing goaliema3026 0 1,610 06-25-2015, 01:10 AM
Last Post: goaliema3026
  Code not recognising Browser object as existing brigna 0 1,718 12-04-2014, 08:32 PM
Last Post: brigna
  Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser). Verify t Divya Roopa 1 8,285 03-11-2014, 12:13 PM
Last Post: devarapallliramana
  Qtp can not identify existing script prit deo 0 1,798 03-03-2014, 04:23 PM
Last Post: prit deo
  Need to embed worksheet to already existing excel mahaktikoo 1 2,316 09-27-2012, 12:13 AM
Last Post: krr

Forum Jump:


Users browsing this thread: 1 Guest(s)