cancel
Showing results for 
Search instead for 
Did you mean: 

Object browser not available in the given context

SOLVED
Highlighted
Occasional Contributor

Object browser not available in the given context

Hi,

 

After killing TC, my script now fails in a step that previously worked. The capture window at this point shows my object active on the screen.

 

Thanks

Fred

 

Here is the code:

Function AlarmsFilterPopUpDialogs()

'Open the browser
Browsers.Item(ProjectSuite.Variables.Browser).Run(ProjectSuite.Variables.SitePortalUrl)
Sys.Browser().BrowserWindow(0).Maximize

'Get the containers for the page
Set objMainHTML = Aliases.browser.pageSitePortal.objectMain
Set objMainFlex = objMainHTML.mainFlex

'Log into the system
Set objUserLoginPanel = objMainFlex.userLoginPanel
Set btnLogIn = objUserLoginPanel.WaitAliasChild("linkbuttonLogIn", 10000)
objUserLoginPanel.textboxUsername.click
objUserLoginPanel.textboxUsername.Keys(ProjectSuite.Variables.UserName)
objUserLoginPanel.textboxPassword.click
objUserLoginPanel.textboxPassword.Keys(ProjectSuite.Variables.Password)
btnLogIn.Click

'At this point, the object browser show "Object browser not available in this context"

'Handle the welcome panel
Set objDialog = objMainHTML.WaitChild("bulletindialogBulletin", 60000)
'Set btnClose = objMainHTML.bulletindialogBulletin.WaitChild("linkbuttonCancel", 30000)
'btnClose.Click
objDialog.linkbuttonCancel.click

'Click the Home button
set btnHome = objMainFlex.WaitAliasChild("linkbuttonHome",60000)
objMainHTML.listbuttonAlarms.Click

'Bring up the alarms canvas
set btnHome = objMainFlex.canvasHome.canvasInfo.WaitAliasChild("buttonAlarmFilterList", 60000)
btnHome.Click

'Wait for the alarm panel to display
set objAlarmTable = objMainFlex.canvasHome.canvasInfo.WaitAliasChild("panelAlarm",60000)
objMainFlex.canvasHome.canvasInfo.buttonAlarmscanvas.ClickButton


End Function

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Object browser not available in the given context

While code is running, Object Browser cannot be viewed.  This is part of the TestComplete environment.  So, even a sleep or wait or whatever is still running code.  A breakpoint should allow you to view the object browser, likewise a halt to the script. 

 

So, we need to go back to your error itself.  You say the script halts after attempting the login step.  What error messages do you get in the TestComplete error log at that point? We need to start the investigation there.  


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
3 REPLIES 3
Occasional Contributor

Re: Object browser not available in the given context

In debug mode, placed a break point at the btnLogIn.click, step to execute the click, and kill the script. Checking the object browser tree, I see wait or delay produces the message '...unavailabe.

 

I changed the code to use a long sleep instead of waiting for the object and the script click worked. What is going on?

Community Hero

Re: Object browser not available in the given context

While code is running, Object Browser cannot be viewed.  This is part of the TestComplete environment.  So, even a sleep or wait or whatever is still running code.  A breakpoint should allow you to view the object browser, likewise a halt to the script. 

 

So, we need to go back to your error itself.  You say the script halts after attempting the login step.  What error messages do you get in the TestComplete error log at that point? We need to start the investigation there.  


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Occasional Contributor

Re: Object browser not available in the given context

Problem was due to parent node was not mapping reliably. Thanks for the help.

New Here?
Join us and watch the welcome video:
Join the September Hub-bub to show off, learn and win