Forum Discussion
AlexKaras
12 years agoCommunity Hero
Hi Sean,
> I haven't checked the value of localCourseID. [...] How do I get this value?
Here you go:
-- Put the cursor on the 'localCourseID = setCourseID["Execute"]();' line of code in the code editor;
-- Select Debug|Toggle Breakpoint main menu command and check that the red circle appeared in the gutter;
-- Run the test code until it stops on this line;
-- Execute the Debug|Step Over main menu command;
-- Double click on the 'localCourseID' variable so it is selected;
-- Execute the Debug|Evaluate main menu command and check the value assigned to the localCourseID variable in the subsequent dialog window.
> Can I assign the local value with something like Project.Variables.t2350_CourseID.local_value = localCourseID;
Actually, it is not possible to assign the default value to the project and project suite variables from the test code. Default value can be assigned to the variable from the TestComplete IDE only, whereas all assignments done from the test code operate with variable's local value, so
Project.Variables.t2350_CourseID = localCourseID;
should work perfectly.
> I haven't checked the value of localCourseID. [...] How do I get this value?
Here you go:
-- Put the cursor on the 'localCourseID = setCourseID["Execute"]();' line of code in the code editor;
-- Select Debug|Toggle Breakpoint main menu command and check that the red circle appeared in the gutter;
-- Run the test code until it stops on this line;
-- Execute the Debug|Step Over main menu command;
-- Double click on the 'localCourseID' variable so it is selected;
-- Execute the Debug|Evaluate main menu command and check the value assigned to the localCourseID variable in the subsequent dialog window.
> Can I assign the local value with something like Project.Variables.t2350_CourseID.local_value = localCourseID;
Actually, it is not possible to assign the default value to the project and project suite variables from the test code. Default value can be assigned to the variable from the TestComplete IDE only, whereas all assignments done from the test code operate with variable's local value, so
Project.Variables.t2350_CourseID = localCourseID;
should work perfectly.