![]() |
|
Script - 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: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Script (/Thread-Script--4731) |
Script - Ann Hagglund - 04-20-2011 Hi, I want the system to click on a link "Apply", but if that link doesn't exist I want the system to click on a link "Close". The "test" is applying for a job and if the "test" has already applied for just that job, the button "Apply" doesn't exist. I have written following Code: If[/i]but I receive Syntax error. Why? I'm greatful all tips I can get. Ann Hagglund RE: Script - manabh - 04-20-2011 Hi, write it as Code: If Browser("Njord Web Portal - Job_2").Page("Njord WebPortal - Job").Link("Apply").Exists ThenRE: Script - manishbhalshankar - 04-20-2011 Hi, The If condition in Else can be omited. RE: Script - Ann Hagglund - 04-20-2011 Hi again, Thank you for your quick answer but unfortunately I receive an error message in accordance to my attachment: RE: Script - Jay - 04-20-2011 this error is related to page object which is not found in the object repository . once this object found then use : Code: B().P().Webedit().Type DateRE: Script - UFTEnthusiast - 04-28-2011 Hi Ann, Use if condition to click on the link. Code: If Browser().Page().Link().Exists(5) ThenNote: Add Objects to OR Before you run above script. Thanks, RE: Script - Ann Hagglund - 04-28-2011 [/quote]Hi again, I have now stated that the object is in Object repository but now I receive the following error message: See attachment. Hi again, I received an error message regarding that the object doesn't support...., see below. Another question, I am a real beginner, what do you mean with "Add Objects to OR Before you run above script". Sorry to bother you again! Thank you for your help!!! Ann Hagglund Adecco Sweden Hi again, I know what OR means. Sorry for that. The object is already in Object Respository, I have checked that. Best regards, Ann
RE: Script - manabh - 04-28-2011 Hi, Sorry.... It's link().Exist instead of link.Exists
RE: Script - Ann Hagglund - 04-28-2011 Hi again! I'm so happy, it works now. Thank you for all your help! ![]() RE: Script - UFTEnthusiast - 04-28-2011 Hi there! You're welcome . this helps in resolving your issue. Have a great day! Thank you !!! UFTEnthusiast |