Forum Discussion

newtotc's avatar
newtotc
Occasional Contributor
12 years ago

what is returned into the Project.Variables.objcontext??

''''function to set project.variables.objcontext

Public Function projvarobjctxt


  if Project.Variables.BrowserName = "IE" then

    set Context1 = sys.process("iexplore").Page("*")

    'To validate loading of login page 

      set Context1 = Sys.Browser("iexplore").Page("*")

  else

      if (Project.Variables.BrowserName= "firefox") then

        set Context1 = sys.process("firefox").Page("*")

      else

        set Context1 = Sys.Browser("iexplore").Page("*")

        log.Message ("Unknown Browser specified. Page loaded in Internet Explorer")

      end if

  end If

    Project.Variables.objContext = Context1


end function



I want to know what is returned into the variable Project.Variables.objcontext ??

Is it a url or the page object or what...



thanks for your help



thanks



2 Replies

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi,


    As far as I can see from your code, the objcontext project variable contains the reference to the Page object.


    If you need to ensure that the specified variable contains this object during the test execution, you can follow the steps below:

    1. Set a breakpoint on the last line of your code.

    2. When the script stops on this line, highlight the Project.Variables.objContext object in your code and click the Call the Evaluation Dialog button on the Debug toolbar.

    3. TestComplete will show the Evaluate dialog.

    4. Click Inspect in this dialog to explore the properties of the returned object.


    I hope it helps :)