Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Inconsistent click on an object
#1
Not Solved
I have an object on a Crystal Report window that the click event does not work consistently. The object, which is the Print button/icon, receives focus, but the click event does not happen every time. The recorded line of code is as follows:

Code:
SwfWindow("Report").SwfObject("SwfObject").Click

I've tried the click event with coordinates and without and I've also tried mapping the object as a virtual object, but nothing seems to work. Any ideas on how to force the click event will be appreciated. Thanks!

(I'm using QTP 9.2 with Crystal Report 11 and a Windows .Net application.)
Reply
#2
Not Solved
Did u check the Object properties when the click event didnt work??
Reply
#3
Not Solved
Yes, I did. It shows only the two objects that are indicated in the code example I've provided in my original post: SwfWindow: Report > SwfObject:SwfObject, which is the same as what displays if the Print button/icon is spied on using the .Net Windows Form Spy.

The normal Object Spy reveals a more detailed hierarchy: SwfWindow: Report > SwfObject: ReportUserControl > SwfObject:CrystalReportViewer > SwfObject: ToolBar > SwfObject: SwfObject. I tried adding the additional objects via the Define New Test Object option in the Object Repository, but that didn't help either.

The only thing that has seemed to help is to click on another button/icon on the Crystal Report and then click on the Print button/icon, but QTP is still not consistently clicking both buttons/icons.

It might also be a timing issue as I added a Wait before clicking the buttons/icons to give the report time to load and it has helped somewhat, but the button/icon click events are still not occurring consistently. Thank you!
Reply
#4
Not Solved
Hmmmm....
Instead of just wait statement, use the following...
Do
Wait 1
Loop Until (your object).Exist(1) ..... or (focus is true, somethng like that)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Right Click On a Image and Click on a Link in WebElement RameshKrishnan 4 5,140 07-10-2013, 04:13 PM
Last Post: RameshKrishnan
  How do I left click on the right click menu in WinTreeView? RandomGrin 0 3,658 12-22-2012, 04:22 AM
Last Post: RandomGrin
  How do I left click on the Right click menu? RandomGrin 2 3,956 12-18-2012, 09:47 PM
Last Post: RandomGrin
  Click Object hamzaz 3 2,866 07-26-2012, 04:38 PM
Last Post: Arul
Question Inconsistent Class Name Archens 0 2,532 04-20-2012, 07:43 PM
Last Post: Archens

Forum Jump:


Users browsing this thread: 1 Guest(s)