Condition for 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: Condition for Checkpoints (/Thread-Condition-for-Checkpoints) |
Condition for Checkpoints - Sudhamshu - 10-06-2009 Hi, I have written a script to check all the reports in all the applications of my Product. Code: Browser("Conrep-Ex-Employees").Page("Conrep-Ex-Employees").Frame("fr1").WebElement("SCODE:").Click If on the screen "Quick Links" is there then it has to show the msg as "Pass" otherwise it has to show as "Fail" How can I execute this? Thanks in advance RE: Condition for Checkpoints - Saket - 10-06-2009 You can use 'Exist' to check whether your link is there or not on the screen try this Code: if Browser("Conrep-Ex-Employees").Page("Conrep-Ex-Employees").Frame("frPage").Link("Quick Links »").Exist then RE: Condition for Checkpoints - basanth27 - 10-06-2009 Code: a = Browser("Conrep-Ex-Employees").Page("Conrep-Ex-Employees").Frame("frPage").Link("Quick Links »").Check (CheckPoint("Quick Links »_7")) Sorry, Please edit If a<>1 to If a<>0 RE: Condition for Checkpoints - Saket - 10-06-2009 Ah!! Sorry Sudhamshu, I just ignored the checkpoint you used,Please go with Basanth's reply. May be there could be some specific reson for using checkpoint, but in my opinion we should always opt for the simple solutions RE: Condition for Checkpoints - Sudhamshu - 10-07-2009 Hi Guys thanks for your reply. I have modified my code and mostly it is working now. As my code is like this Code: Browser("Conrep-C2C Consultants").Page("Conrep-C2C Consultants").Frame("fr1").WebEdit("txtPageCode").Set DataTable("Scode", dtGlobalSheet) Actually it has the four conditions. 1. Report should show if Quick Links are there in the screen. 2. Should show the Technical error if it is there in the screen. 3. Should show Target Report is not available if this frame is there in the screen. 4. Should show Please enter a valid file scode... if this frame is there in the screen. And one more small help please. Actually it should show only the reports which are fine (First Case) and it should through error msgs for all other scenarios in the final results. To be specific, to the addition of my logic, how can I get the final result where I can check that which reports are not fine? Thanks in advance guys. RE: Condition for Checkpoints - Saket - 10-07-2009 if i am getting your question right, you dont want the messages to pop up, you want the corresponding result to the final qtp result. to do this you should use 'Reporter.ReportEvent' e.g Code: If Browser("Conrep-C2C Consultants").Page("Conrep-C2C Consultants").Frame("frPage").Link("Quick Links »").Exist then Note :- always put your codes in proper tags to make it more readable and follow one query per thread. RE: Condition for Checkpoints - Sudhamshu - 10-08-2009 Thks guys it worked out. |