Intelligent Automation & Macro Software  

Go Back   Automation Anywhere, Inc. Forums > Products Zone > Testing Anywhere
Register FAQ Search Today's Posts Mark Forums Read

Testing Anywhere Post messages and questions related to Testing Anywhere here.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-04-2010, 07:18 AM
cfereday cfereday is offline
Junior Member
 
Join Date: Jun 2010
Posts: 19
Thumbs down Run Test - Passed Variables are Empty

Hello,

In my Testing Anywhere script, I am calling a Test to be ran (Run Test function) and passing variables from the Caller to the Called Script.

The Variables are null in the Called Script.

Please can you tell me why this would be?

Thanks and Regards, Claire
Reply With Quote
  #2 (permalink)  
Old 10-05-2010, 07:52 AM
cfereday cfereday is offline
Junior Member
 
Join Date: Jun 2010
Posts: 19
Default

I have managed to get around this by displaying the variables in a Message Box in both the Caller and Called script.

For some reason this ensures that the variables are not null in the called script
Reply With Quote
  #3 (permalink)  
Old 10-05-2010, 05:21 PM
forumstaff forumstaff is offline
Senior Member
 
Join Date: Oct 2010
Posts: 521
Default

Hello Claire,

Just wanted to confirm if the problem that you were facing is resolved or you would like us to help.
Reply With Quote
  #4 (permalink)  
Old 10-06-2010, 02:53 AM
Aditservice Aditservice is offline
Junior Member
 
Join Date: Jan 2010
Posts: 6
Smile Passing variables from caller to called test and vice versa

Hello Clair,

We have solved this problem by writing the data (more than 10 different parameter data) into a single separate predefined parameter file name. The called test script parses this parameter file and uses the stored data.

The easiest way to get this to work, is to store the test data into a predefined log folder name (e.g. D:\TestingAnywhere\Log\MyTest) and work from there. With this method you can even send back the test result to the caller test script by storing the test result into a separate file e.g. Result.txt and parse that file in the caller test script for further processing.

Hope this helps.

Arjan
Reply With Quote
  #5 (permalink)  
Old 10-08-2010, 04:45 PM
forumstaff forumstaff is offline
Senior Member
 
Join Date: Oct 2010
Posts: 521
Default

Hello Clair,

Adding to the above mentioned post you can also try two different processes to call the variable from one Test to another.

Process 1:
Follow below mentioned instructions to pass the variable from Test A (Caller Test) to Test B (Called Test):

Suppose we want to pass the value of variable “Temp” from Test A to Test B.
1. Create variable “Temp” in Test A and assign some value which we need to transfer to Test B.
2. Create the variable “Temp” in Test B of value type and save the Test.
3. In Test A while using Run Test command, use the option of “Pass the Variable as Argument”.
4. Press F2 button and select the variable “Temp” and save the Test A.
5. Run the Test A.
Test B variable “Temp” will contain the value of passed from Test A.

Process 2:
In case the above mentioned process does not works, you can use “Read from file variable” to pass variable from Caller Test (Test A) to Called Test (Test B).

Suppose we want to pass the value of variable “Prompt-Assignment” from Test A to variable “Temp” in Test B.
1. Create ReadVariable.txt in C:\
2. In Test A use “Log to file” command and select C:\ReadVariable.txt file and log the text as follows and save it:
Temp=$Prompt-Assignment$
3. In Test B create new variable of Type –Value, Name –Temp, Select –Read from text file, Select File - C:\ReadVariable.txt.
4. Use “Message Box” command to display the value of Temp.
5. Use “Run Test” command to call Task B in Task A
6. Run the Test A.

Please have a look at the sample Tests in Tests.zip file attached with the post.
Attached Files
File Type: zip Tests.zip (645 Bytes, 1 views)
Reply With Quote
  #6 (permalink)  
Old 10-11-2010, 02:11 AM
cfereday cfereday is offline
Junior Member
 
Join Date: Jun 2010
Posts: 19
Default

Thanks for your response.

The method that I was using to pass the variables was:

Process 1:
Follow below mentioned instructions to pass the variable from Test A (Caller Test) to Test B (Called Test):

Suppose we want to pass the value of variable “Temp” from Test A to Test B.
1. Create variable “Temp” in Test A and assign some value which we need to transfer to Test B.
2. Create the variable “Temp” in Test B of value type and save the Test.
3. In Test A while using Run Test command, use the option of “Pass the Variable as Argument”.
4. Press F2 button and select the variable “Temp” and save the Test A.
5. Run the Test A.
Test B variable “Temp” will contain the value of passed from Test A.

As this is standard TA functionality, I would expect this to work successfully. Can you investigate why this method may not always pass the variables?

As stated, I have managed to get this to work by displaying the passed variables in a message box in both the caller and called scripts. I don't know why this works, but it does!
Reply With Quote
  #7 (permalink)  
Old 12-22-2010, 06:49 PM
KMuller KMuller is online now
Member
 
Join Date: Dec 2010
Posts: 91
Default

I also have a similar problem with this.

I am passing a variable from one test to another. I am then grabbing some data from an application and comparing that to the passed variable.

I can write the values of both variables (application variable and passed variable) to Notepad and both variables are the same.

But as soon as I put in a Variable Checkpoint to match the variables the test fails.

I found that if I use a Variable Operation and set Clipboard = Passed Variable, regardless of whether I use the Clipboard variable anywhere or not, the test now passes.

Bit of a strange workaround, especially as I can see from Notepad that the variable is being passed between tests, but seems to work....
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -7. The time now is 02:33 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.0.0 ©2007, Crawlability, Inc.
Copyright © 2003-2011 Automation Anywhere, Inc. All rights reserved