Micro Focus QTP (UFT) Forums
Registration in a Web browser - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Registration in a Web browser (/Thread-Registration-in-a-Web-browser)



Registration in a Web browser - Ann Hagglund - 04-04-2011

Hi, I need help. I'm testing a web application. I have registered a candidate (the user name is generated by QTP: QTP Candidate NO (random number between 0-1000), and created a lot of information and a lot of activities and in the end submitted the registration.

The last Activity will be to log in to the system with same QTP Candidate NO that was created in Activity 1. How can I tell the system to use that number?

Please come back if you want to have clarifications




RE: Registration in a Web browser - supputuri - 04-05-2011

Hi Ann,

you can store the candidate (with random number) and then use the same for login again.
Code:
strCandidate = "supputuri"
  RanNumber = RandomNumber(0,1000)
  'Now appending the random number to the candidate.
  LoginCandidate = strCandidate & RanNumber
  msgbox LoginCandidate
  ' now we have the candidate infor in the "LoginCandidate" variable and can use the same. (we can do it with out using strCandidate too)

Please let me know if you need any more info.


RE: Registration in a Web browser - Ann Hagglund - 04-28-2011

Hi again,
I have now succeeded to create the LoginCandidate variable but when I will use it again I don't get the same result when I use it in another activity. Instead for the content of "LoginCandidate" I get an empty login box or "LoginCandidate" as username.

My script for logging in:
Code:
Browser("Njord Web Portal - Candidate").Page("Njord Web Portal - Login").WebEdit("username").Set LoginCandidate & "@adecco.com"

My variable to create the variable in my ifrst activity:
Code:
strCandidate ="QTP.Candidate"                                CandidateNO=randomNumber(0,10000)LoginCandidate=strCandidate & CandidateNO

The script in the first activity:
Code:
Browser("Njord Web Portal - Login").Page("Njord Web Portal - Candidate").WebEdit("ADAPT__EMAIL$Home$EMAIL_ADD").Set LoginCandidate


Do you have any trick to even get it in my last activity?

I really appreciate your help!

Best regards,
Ann Hagglund, a real beginner
Adecco, Sweden