-
I'm not able to write the script for login page
I have created datatable in xls sheet (username, password), however I'm not able to write the script for login page. I didnt able to understand how do I fetch the username and password value to login. I am beginner can any one help me out.......Look forward to your reply guys...
Question asked by visiotor Anurag
-
Contributing Member
Re: I'm not able to write the script for login page
Hey Anurag,
First let me know whether u r using external datasheet or QTP inbuild datasheet.
If you are using inbuild datasheet,u can fetch the values from the data sheet and pass it to the appropriate fields.see the example below
Test Case for Yahoo Login :
Enter the UserName
Enter the Password
Click on the Submit button
Syntax for fetching value from DataTable
Variable1 = DataTable("","")
Variable2 = DataTable("")
Example :
Let me say ur Action Name be "Login".
Your field name will be "UserName" and "Password"
v_strUserName = DataTable("UserName","Login")
v_strPwd = DataTable("Password","Login")
Browser().Page().WebEdit().Set v_strUserName
Browser().Page().WebEdit().Set v_strPwd
Browser().Page().WebButton().Click
To run more than one iteration, go to Keyword view,Right click the appropriate action name,select Action Call Properties option,from their select your own option. Another alternative way is like.... you can use For..Next looping statement to retrive more than one row from the data table.
Hope u got some idea now!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules