Micro Focus QTP (UFT) Forums
Secure QTP Code and Error Handling Scenario. - 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: Secure QTP Code and Error Handling Scenario. (/Thread-Secure-QTP-Code-and-Error-Handling-Scenario)



Secure QTP Code and Error Handling Scenario. - knarravu - 11-02-2010

Hi All,

I'm developing a new tool - QTP integrates with Mainframes and submits the Mainframe Jobs one by one which is provided as a list in Microsoft Excel.

I need your help on below 2 issues:

1. I would like to restrict in accessing QTP Script/ Code to Users, as they don't require the internal logic. Incase of other technologies, we create .EXE (or) Load Files etc, so that user is restricted from the actual Code. Is there any similar way in QTP.

2. Say, to Submit a Job in Mainframes, we may need to process 5 screens in sequence. But at times, inbetween these 5 screens, there may be some unexpected (or additional) SCREEN in-between.

So, i have coded as
If TeWindow("TeWindow").TeScreen("current_screen).TeField("field_name").Exist Then
TeWindow("TeWindow").TeScreen("current_screen).SendKey TE_ENTER

Though, i've tried to handle all unexpected CURRENT SCREEN in-between, the list become enormous, and again its found that list is in-complete, as new and new unwanted screens may come in-between.

Hence, i look forward, a simpler code, SAY ON ANY OF THE 5 SCREENS:

IF THE CURRENT SCREEN IS NOT THE EXPECTED ONE, then
BYPASS THE CURRENT SCREEN, TO GET THE NEXT SCREEN, TILL ALL EXPECTED 5 SCREENS COME.

e.g. If TeWindow("TeWindow").NOT EXPECTED TeScreen then
TeWindow("TeWindow").SendKey TE_ENTER

By this way, it can simply ignore the current screen, if not the expected one. But the above code is syntactically wrong, as these QTP properties doesn't exists (like SendKey directly on a Window itself).

Could you pls. help me how to do such a Screen Check in QTP with Mainframes ?

Thanks for your support.

Regards,
Narravula