Forum Discussion
That just shows what variable you are selecting... the next screen from there should show what you're setting the value of the variable TO.... that's the important part that's missing... because if you have a string variable that oyu're trying to assign an object to, that won't work.
Hope this will help to resolve the issue.
- tristaanogre6 years agoEsteemed Contributor
OK, everything seems to be in order there... next question, when you put a break point on that line, does the object property that you're looking for actually have a value?
Also, this may be a timing issue. You click the "Yes" button just before this. If there is some sort of delay, like the web page needs to process or something, it could be that the value assignment is being made BEFORE the property actually populates with a value. As a debug trial, put a "Delay" call just before the Set Variable to wait something like 5 seconds to see if that resolves the problem. - tristaanogre6 years agoEsteemed Contributor
Just out of curiousity, how are you determining whether or not the value is stored in the variable? Are you referencing the variable somewhere else and it's coming up blank?
Also... did you try debugging and making sure that the property you're referencing in the "Set Variable" statement actually contains the desired value? - tristaanogre6 years agoEsteemed Contributor
So, I'm assuming you know it doesn't work because the next step doesn't have any information.
Then.... we're back to making sure the property actually has the desired value. Can you give a screenshot from Object Spy showing the property and the desired value?
- tristaanogre6 years agoEsteemed Contributor
Try this... put a breakpoint on the Set Variable value.... run the test to the breakpoint... then step over... while still in debug, do a "watch" to look at the value of the variable... did it get set?
This is all debugging, all working with the code, all trying to see what the behavior is and determining, once you have observed the behavior, what is necessary to correct it. GENERALLY speaking, the code is correct... you click the button, you assign the value, then you try to consume it. So, we need to figure out WHY the set variable value is not actually getting a value.So...
1) Are you getting errors?2) What is the ACTUAL observed behavior when the test runs?
You're asking me to diagnose static code via screenshots when the problem is most likely an issue during runtime. I can only suggest. You'll need to do the work. Perhaps the delay you put in wasn't long enough. Again... you need to OBSERVE the behavior... you click the "Yes" button... is there a time period between clicking the button and when the work order number field is populated (a question I asked and you didn't answer)? THAT, right there, could be the ENTIRE problem... but we don't know that yet. Take the time, do the work, diagnose what's going on.
- tristaanogre6 years agoEsteemed Contributor
Put a break point in your test script JUST after the Set Variable command. (https://support.smartbear.com/testcomplete/docs/testing-with/debugging/breakpoints/using.html)
Then, run the test.
When the test stops, evaluate the contents of the project variable. (https://support.smartbear.com/testcomplete/docs/testing-with/debugging/general-info/evaluating-expressions.html)
That's the first step... making sure the value is getting set. And, to be honest, I'm confused... because I asked you a while back how you knew that the value wasn't being set and you said because it wasn't getting populated in the next step... so... not ENTIRELY sure what is going on. If you don't even know if the value is getting set, how do you know there's a problem?
As for using it... when you want to use the contents of the variable, when you select an operation, when indicating the parameters, you can set the mode to "Variable" and then select the variable. That will then input the value of the variable into whatever operation you've selected. (https://support.smartbear.com/testcomplete/docs/testing-with/debugging/general-info/evaluating-expressions.html)
- saranoor6 years agoFrequent Contributor
Added a delay after Yes but the value is not stored in the variable.
- saranoor6 years agoFrequent Contributor
I need that global variable value to be used to select the Work Order ID in the next steps in same keyword test.
- saranoor6 years agoFrequent Contributor
Value does not get stored
- tristaanogre6 years agoEsteemed Contributor
Yes, we've established that... you're trying to capture the value of a particular property of an object and it's not getting stored. What I would like to do is debug that... using Object Spy in TestComplete, can you view the object and it's properties and make sure that, yes, in fact, the property contains the desired value? Not the variable, but the ACTUAL object property in your application under test.
- saranoor6 years agoFrequent Contributor
Attaching the screenshots.
In Capture 7 screenshot I do not know what to use? What Method or property to use?
Related Content
- 2 years agovericomms
Recent Discussions
- 7 hours agojstaehlin
- 24 hours agoAivanitskiy