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 01-19-2010, 08:54 AM
Aditservice Aditservice is offline
Junior Member
 
Join Date: Jan 2010
Posts: 6
Post How to send back a user defined value from a vbScript to Run Script

To send back a user defined value from a vbScript to the Run Script command use within your vbscript the following command:
Code:
wScript.StdOut.WriteLine <ValueToReturn>
e.g.:
Code:
wScript.StdOut.WriteLine "Hello World"
A working example in 20 easy steps:

Creating the vbScript
1. Create a vbScript using notepad and call it HelloWorld.vbs
2. Place the following statement within HelloWorld.vbs
Code:
wScript.StdOut.WriteLine "Hello World"
3. Save HelloWorld.vbs

Creating an example test in Testing Anywhere
4. Start Testing Anywhere client
5. Create a new test script in testing anywhere client
6. Add a variable to the script using the variable manager and give it a logical name for example ReturnedValue
7. Add the Run Script command and select the HelloWorld.vbs vbScript
8. Click in the text box next to the text Return value :
9. Press F2
10. Select the ReturnedValue variable
11. Click on Insert
12. Click on Save
13. Add a Message Box command
14. Click in the text box beneath the text "Please enter message to show to user"
15. Press F2
16. Select the ReturnedValue variable
17. Click on Insert
18. click on Save
19. Save the created test script
20. Now run the test. You should see the text Hello World appear on the screen within a message box.

A working example has been attached to this post.
Attached Files
File Type: zip HelloWorldFromVbScript.zip (767 Bytes, 8 views)
Reply With Quote
Reply

« - | Website Testing »

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 10:45 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