Ask a Question

Very Simple Variable Assignment

SOLVED
MarkSchofer
Frequent Contributor

Very Simple Variable Assignment

MarkSchofer_0-1622747569661.png

This seems so straight forward especially when being done programmatically
In a keyword test
I read a value from a spread sheet -works fine
Create a project (tried script) variable 
The value appears as a last operation result. (176060)

Logs last operation result (176060)
Set Variable value = last operation result
The value does not say in the variable.   

1 ACCEPTED SOLUTION

Accepted Solutions
Marsha_R
Community Hero

Re: Very Simple Variable Assignment

That's the way it's supposed to work.  You have to assign LastResult to your variable immediately after it's created.

https://support.smartbear.com/testcomplete/docs/keyword-testing/basic/result.html


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

View solution in original post

4 REPLIES 4
MarkSchofer
Frequent Contributor

Re: Very Simple Variable Assignment

I switched around the order of operations. Programmatically it doesn't make sense. But it does seem to work.



Have a great day

Marsha_R
Community Hero

Re: Very Simple Variable Assignment

That's the way it's supposed to work.  You have to assign LastResult to your variable immediately after it's created.

https://support.smartbear.com/testcomplete/docs/keyword-testing/basic/result.html


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame

View solution in original post

MarkSchofer
Frequent Contributor

Re: Very Simple Variable Assignment

It is essentially what I did -yes there is a log step in there (I do that during development).   
Thanks for the response. It is now working

Marsha_R
Community Hero

Re: Very Simple Variable Assignment

(I leave the log steps in even after development.  If I haven't looked at a test in months, it will seem rather foreign and it's nice to have the extra information in there.)


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: