Micro Focus QTP (UFT) Forums
Need help with checkpoints - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Need help with checkpoints (/Thread-Need-help-with-checkpoints)



Need help with checkpoints - lalabhaiya - 10-15-2009

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.


RE: Need help with checkpoints - Ankur - 10-15-2009

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]>")



RE: Need help with checkpoints - lalabhaiya - 10-16-2009

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.


RE: Need help with checkpoints - Ankur - 10-16-2009

Then may be you can look into overriding the method using RegisterUserFunc and have your own functionality.