Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
script for login feature
#1
Solved: 11 Years, 4 Months ago
can you help me
i have a script
Code:
Browser("Browser").Page("ABC").WebEdit("user_login").Set DataTable("user", dtGlobalSheet)
strMail = Browser("Browser").Page("ABC").WebEdit("user_login").ToString
Browser("Browser").Page("ABC").WebEdit("password").SetSecure "3c32f2445bbc7481db3492b1d1556ceb7fdf9e03ca7be253143d"
If strMail = "dqv@yahoo.com" Then
    Browser("Browser").Page("ABC").WebButton("Login").Click
else
    reporter.ReportEvent micFail, "Failed Report","Failed Email"
End If

when i input "dqv@yahoo.com" (this acc i registered) into datatable. the report always display Failed Email case without run Login case. i don't know why
Reply
#2
Solved: 11 Years, 4 Months ago
I am not able to understand what exactly you are trying to do here, You are passing the username through datatable again taking it to a variable , are you trying to verify if it has been set or not? what is the logic, would you like to elaborate it?

put a msgbox there to see what comes in strMail?
ToString is not a correct method to get the value from webedit, it will returns the string representation of webedit, something like 'txtusername edit box', that's why you are getting always fail result. Use GetROProperty("Value")

Reply
#3
Solved: 11 Years, 4 Months ago
For this script, if you are trying to compare
Code:
If strMail = "dqv@yahoo.com" Then
Browser("Browser").Page("ABC").WebButton("Login").Click
else
reporter.ReportEvent micFail, "Failed Report","Failed Email"
End If
The script should be
If strcomp (strMail,"xxxxxx") = 0 Then
Browser("Browser").Page("ABC").WebButton("Login").Click
else
reporter.ReportEvent micFail, "Failed Report","Failed Email"
End If
Reply
#4
Solved: 11 Years, 4 Months ago
my script has run correctly
i added into script:
Code:
Browser("Browser").Page("ABC").WebEdit("user_login").SetTOProperty "value", DataTable("user", dtGlobalSheet)
strMail = Browser("Browser").Page("ABC").WebEdit("user_login").GetTOProperty("value")
everyone, thanks
with this script, i want to catch the case user input data do not accord with requirement of the test case
Ex: for the test case, you must input a registered email, but you input a email has not yet been registered
Reply
#5
Solved: 11 Years, 4 Months ago
You obviously got to compare with existing email address using strcomp function ... where are you storing the registered email addresses?

If they are stored in DB, connect to DB and run the for loop till eof, use strcomp condition in between the for loop ....
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  IE Tester feature not recognized by UFT12.01 saraiado 2 2,759 12-23-2014, 09:41 AM
Last Post: vinod123
Exclamation Login & logout in Siebel and clicking pop-up button yuetling926 7 11,366 07-09-2014, 10:43 PM
Last Post: hhamilton
  Unable to Click on Login Button Paurav 1 3,288 07-03-2014, 05:27 AM
Last Post: supputuri
  for help.Run a test to login,and then it didn't jump to another page maosilu 0 2,686 11-01-2013, 01:27 PM
Last Post: maosilu
  Best method to test Login validation defcon3 2 3,622 05-29-2012, 04:02 PM
Last Post: defcon3

Forum Jump:


Users browsing this thread: 1 Guest(s)