Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save randomly generated string
#1
Solved: 10 Years, 8 Months, 1 Week ago
Hello again,

I had a quick question, I wanted to know if there is a way I can save a randomly generated string or call that value again later in a test. I use the value to set a last name field, then I need that value so I can search for that last name later in the my test. Any help would be greatly appreciated.

Regards,
Erik
Reply
#2
Solved: 10 Years, 8 Months, 1 Week ago
Figured it out from link below.
Code:
Environment.Value("DocName")= GetRandom(8)
Browser("PROMPT").Page("PROMPT").WebEdit("tp_last_name").Set Environment.Value("DocName")

new action
Code:
Browser("PROMPT").Page("PROMPT").WebEdit("keywordsearch").Set Environment.Value("DocName")

https://www.learnqtp.com/all-about-envir...es-in-qtp/
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT issues with Outsystems dynamically generated Id/names jherron 2 1,125 03-02-2020, 09:33 PM
Last Post: Swishy70
  Test runned from QualityCenter generated an error "Attempted to divide by zero." robertosalemi 1 2,367 10-14-2016, 08:38 PM
Last Post: robertosalemi
  Script is not generated for windows application in UFT sreelatha 1 2,162 04-04-2016, 10:51 AM
Last Post: vinod123
  Replace a string in a word document with another string rekha.naik 8 15,026 11-14-2013, 12:58 PM
Last Post: pranikgarg
  QTP does not recognise elements randomly Pkapoor 2 2,495 07-05-2013, 11:27 AM
Last Post: Pkapoor

Forum Jump:


Users browsing this thread: 1 Guest(s)