cancel
Showing results for 
Search instead for 
Did you mean: 

Force Click option (ignore object/use coordinates)?

ratner
Occasional Contributor

Force Click option (ignore object/use coordinates)?

Hi. I've got a bit of a problem. My app has a navigation toolbar (designed for use on touchscreens). I can click on breadcrumbs inside the toolbar to take me to a particular page. However, when I record my TC test, it treats it as one object, and fails every time I try to play it back. Is there a way to ignore this object all together, and force a click on specific coordinates? Or is there a better option? Any help is greatly appreciated. Thank you.
8 REPLIES 8
Ryan_Moran
Valued Contributor

RE: Force Click option (ignore object/use coordinates)?

.Click(x,y)

Will generally be your "coordinate" click within an object.

You can also try using text recognition and click by text like so:

Obj.TextObject("File Menu","1").Click()

http://support.smartbear.com/viewarticle/55418/


''-Praise the sun and Give Kudos.''
ratner
Occasional Contributor

RE: Force Click option (ignore object/use coordinates)?

Thank you for your prompt reply. I understand that when it records a Click action, it records an object name along with its coordinates. However, in my case, the navigation bar with several breadcrumbs inside (see attached file) is been treated as one object, and for whatever reason when I play back my test, it just fails, saying that it doesn't exist. I don't think the text recognition is going to work as well, because once again, it doesn't recognize text inside that navigation bar.
ratner
Occasional Contributor

RE: Force Click option (ignore object/use coordinates)?

If you look at the image that I attached, you can see that I'm currently on Initial Metrology page (tab, if you will) of the Navigation Bar. I can click on the Run, or Batch, and that will take me to that particular page. But TC doesn't recognize it, and fails on the Click.
Ryan_Moran
Valued Contributor

RE: Force Click option (ignore object/use coordinates)?

I think the text recognition would surprise you with how well it works and what it picks up.

That was just one suggestion however.



Can you post a bit of the script that is generated by Test Complete when recording is complete?



Also if you open the Object Spy and drag the target over the control what does it show? Does it show one control or each "tab" individually?



Additionally you can try adding a large delay like BuiltIn.Delay(45000) prior to the click to ensure that the form/page is fully loaded before the click is attempted (if the delay works then you'll have a better idea of what's happening here then can adjust as needed).


''-Praise the sun and Give Kudos.''
ratner
Occasional Contributor

RE: Force Click option (ignore object/use coordinates)?

When I use Object Spy, it shows (highlights) the whole control, not the individual tabs. I have also tried using larger delay prior to the click without any success. Here's a bit of a script:



function Test1()

{

  var mainForm;

  var navFrame;

  var panel;

  var defaultNavHeader;

  mainForm = Aliases.QEDApp.MainForm;

  mainForm.DblClick(593, 23);

  Delay(3781);

  navFrame = mainForm.toolStripContainer2.ToolStripContentPanel.dockPanel.DockWindow.DockPane.ProcessEditorForm.processEditor.navFrame;

  panel = navFrame.Panel;

  panel.ProcessControl.splitContainerMain.SplitterPanel.panelSteps.gbProcessSteps.WorkingAreaControl.wcSteps.eventPaintedPanel.ProcessStep6x1Widget.lblCorrectionType.Click(87, 2);

  Delay(3149);

  panel.StepControl.panelChildren.wcComponentStatus.eventPaintedPanel.SandboxStatusTitleTextWidget5x1.Click(159, 19);

  Delay(3693);

  defaultNavHeader = navFrame.Panel2.HelpButtonNavHeader.defaultNavHeader1;

  defaultNavHeader.Click(355, 24);

  Delay(2155);

  defaultNavHeader.Click(193, 20);

}





Once again, thank you for your help.
Ryan_Moran
Valued Contributor

RE: Force Click option (ignore object/use coordinates)?

My theory is that it is possibly failing because it is trying to click the control that the "tabs" reside on and the "tabs" are overlapping that control during runtime. You can probably see this in the log, perhaps you could post the error from the log as well? If this is the case, and you're unable to highlight the "tab" with the object spy you can see if you can browse to it with the Object Browser get the control name and manually modify the script. I do not know how to circumvent the recording of the single control vs. recognizing the tabs.

''-Praise the sun and Give Kudos.''
ratner
Occasional Contributor

RE: Force Click option (ignore object/use coordinates)?

I have to do some more testing, but there's something else is going on here. It looks like this navigation bar doesn't initialize properly until you visit a page (tab) at least once. If you don't, it fails. But I've tried it with the old stuff, which was failing before, and now it works. I'm really baffled here. Thanks for your suggestions though...
Ryan_Moran
Valued Contributor

RE: Force Click option (ignore object/use coordinates)?

You can also check to see if test complete recognizes them by Object.ClickTab or Object.ClickPage etc. Select the object with the Object Spy and then copy/paste the fullname into your script. Use the autocomplete to see a list of supported methods by typing a period after the object name Object. or by pressing control + space. If it does recognize the control as a supported type you can probably click by index Object.ClickItem(index) or by tab Object.ClickTab(tabname/index) etc.

''-Praise the sun and Give Kudos.''
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors