Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save randomly generated string
#1
Solved: 11 Years, 3 Months, 4 Weeks 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: 11 Years, 3 Months, 4 Weeks 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,414 03-02-2020, 09:33 PM
Last Post: Swishy70
  Test runned from QualityCenter generated an error "Attempted to divide by zero." robertosalemi 1 2,592 10-14-2016, 08:38 PM
Last Post: robertosalemi
  Script is not generated for windows application in UFT sreelatha 1 2,406 04-04-2016, 10:51 AM
Last Post: vinod123
  Replace a string in a word document with another string rekha.naik 8 15,583 11-14-2013, 12:58 PM
Last Post: pranikgarg
  QTP does not recognise elements randomly Pkapoor 2 2,681 07-05-2013, 11:27 AM
Last Post: Pkapoor

Forum Jump:


Users browsing this thread: 1 Guest(s)