Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with checkpoints
#1
Solved: 10 Years, 8 Months, 2 Weeks ago
Hi all,

I have a question here. I have written a code that parses the script lines in qtp and i create my test assets that way. What I need to do now is to parse the validation lines as well. The problem here is that validations can be written in a lot of ways. To start with, I picked up the one easiest to put as it requires no coding effort, CheckPoint.



Now, my script line looks like this -



Code:
Browser("homepage").Page("User Login").WebEdit("sid").Set "blah blah"



And when i add a validation to check the value in the text box, it comes as -



Code:
Browser("homepage").Page("User Login").WebEdit("sid").Check CheckPoint("sid")



Now, I don't have information here bout the CheckPoint, i.e. what validation is being done here and what value it is being validated, etc. My question is, is there any way I can reflect this in the script line only, containing information which is required for validation, namely - value being validated and which validation is being done?



(Something LIKE this)



Code:
Browser("homepage").Page("User Login").WebEdit("sid").Check CheckPoint("sid", "validate text", "blah blah")



Is there a workaround to get these values from some other place as well? Thanks in advance.
Reply
#2
Solved: 10 Years, 8 Months, 2 Weeks ago
One is by getting the return value from Checkpoint. This will return True/False. Since you know what you are checking, you can use Reporter statements to pass results

Code:
bName = Browser("homepage").Page("User Login").WebEdit("sid").Check (CheckPoint("sid"))

Second is by using GetROProperty which will fetch the actual values for you.

Code:
sName = Browser("homepage").Page("User Login").WebEdit("sid").GetROProperty("<[i]property name[/i]>")
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#3
Solved: 10 Years, 8 Months, 2 Weeks ago
Hi Ankur,

Thanks for you reply. I get what you are saying, but what will happen is that my script lines will be huge and there will be many validations in the script lines. Yes, I can assign them to variables and check the values, but is there a way to show in the script lines only what validation is being done? Like

Code:
bName = Browser("homepage").Page("User Login").WebEdit("sid").Check (CheckPoint("sid"))

would also contain that it is 'text validation' that is being done? Why I need such a thing is because I need to parse all the existing qtp scripts to store in my repository and they have just used checkpoints. I know using ROProperty would have been easier to parse but it has not been used in the script and so I need to stick with supporting the existing scripts first. I know this is asking too much, but is there some way to do this? Thanks a lot.
Reply
#4
Solved: 10 Years, 8 Months, 2 Weeks ago
Then may be you can look into overriding the method using RegisterUserFunc and have your own functionality.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Fixing broken Checkpoints mv8167 2 2,716 02-02-2012, 10:00 PM
Last Post: mv8167
  Changing existing checkpoints janriis 1 3,072 12-13-2009, 12:55 PM
Last Post: basanth27
  Adding checkpoints anbarasu 2 2,865 10-23-2009, 05:18 PM
Last Post: anbarasu
  Condition for Checkpoints Sudhamshu 6 4,209 10-08-2009, 07:17 PM
Last Post: Sudhamshu
  Difference between checkpoints and outputvalues satyadon 1 4,182 10-21-2008, 11:02 PM
Last Post: satyadon

Forum Jump:


Users browsing this thread: 1 Guest(s)