Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Copy actual value or use RandomString generated before
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,

I would appreciate help with copy action or re-use of RandomString in another action. I need to copy actual displayed value or use RandomString I generated before in another action.


I have a code when I generate RandomString (see below)

Action 1
Code:
Str1=RandomString(15)
Browser("PROMPT").Page("PROMPT").WebEdit("vin").Set Str1
Str2=RandomString(6)
Browser("PROMPT").Page("PROMPT").WebEdit("regNo").Set Str2
Str3=RandomString(3)
Browser("PROMPT").Page("PROMPT_2").WebEdit("model").Set Str3

Browser("PROMPT").Page("PROMPT_2").WebEdit("make").Set "Volvo"
Browser("PROMPT").Page("PROMPT_2").WebEdit("buildYear").Set "2012"
Browser("PROMPT").Page("PROMPT_2").WebEdit("engineMake").Set "Volvo"
Browser("PROMPT").Page("PROMPT_2").WebEdit("engineModel").Set "V600"
Browser("PROMPT").Page("PROMPT_2").WebEdit("engineHorsePowerRange").Set "600"
Browser("PROMPT").Page("PROMPT_2").WebList("vehicleTypeStr").Select "Truck"
Browser("PROMPT").Page("PROMPT_2").WebButton("Save").Click
Browser("PROMPT").Page("PROMPT_3").WebElement("The maintenance plan is").Check CheckPoint("The maintenance plan is not created until you select Approve._2")

Action 2

In action two I want to repeat the first script from action 1 (just use the same string I generated before)

.Set Str1 does not help at all

Any suggestions?

Thx,
Matt
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
You may want to read about environment variables. A transcript would be,

In Action 1:

Environment.Value("Str1") = RandomString(15)

In Action 2:

Msgbox Environment.Value("Str1")

Or

Learn about global variables.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Thx
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT issues with Outsystems dynamically generated Id/names jherron 2 1,364 03-02-2020, 09:33 PM
Last Post: Swishy70
  Test runned from QualityCenter generated an error "Attempted to divide by zero." robertosalemi 1 2,569 10-14-2016, 08:38 PM
Last Post: robertosalemi
  Script is not generated for windows application in UFT sreelatha 1 2,379 04-04-2016, 10:51 AM
Last Post: vinod123
  Save randomly generated string SomeIntern 1 2,362 08-27-2013, 12:36 AM
Last Post: SomeIntern
  Need Script for the below scenario which will solve my actual issue RameshKrishnan 6 4,050 07-12-2013, 03:05 PM
Last Post: ssvali

Forum Jump:


Users browsing this thread: 1 Guest(s)