How to select a particular check box from a list - 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: How to select a particular check box from a list (/Thread-How-to-select-a-particular-check-box-from-a-list) |
How to select a particular check box from a list - umer830 - 01-19-2010 Another Problem I need to select a particular check box as shown in screenshort based on the adajacent document link. Once checkbox selected I can perform a ragen of features available in application, To identify any of the document link I can use code below and it works /////////////////////////////////// Code: If Browser("projectCentre QTP:TEST-AT:").Page("projectCentre QTP:TEST-AT:").Frame("RegRegRegFrame").Exist Then But next I need is once the link is identified say 'DEC 3' I have to slect the adajacent check box which cannot be identified based on webtable row neither it can be recorded as it will differ based on web link you want to select. Q1:Can you guys suggest a wayout to select a particular checkbox Q2:You can see the image of my object repository and object spy, The difference I am trying to under stand is in Object spy it shows checkbox as a child of webtable where as in object repository it doesn't. If I can have it as child of webtable in OR I can easily identify target checkbox based on rownumber and some looping code Waiting for any kind of help RE: How to select a particular check box from a list - sreekanth chilam - 01-19-2010 Hi Umer, Follow the below steps. Step1: Add the required 'WebTable' Object into Obj.Repo Step2: Retrieve the row count of the webtable. Step3: Loop thru all the rows & retrieve required cell's data using 'GetCellData' method & Validate the current link text with expected link text. Step4 : If the required link text is found in 'i'th row, then use 'ChildItem' Method & select the correspoding CheckBox present in the same row & Exit out of the Loop. Refer the below example code: Code: Expected_Link="DEC 3" RE: How to select a particular check box from a list - umer830 - 01-21-2010 Thanx sreekanth. It worked RE: How to select a particular check box from a list - ranjanisudarmani - 10-18-2012 Hi Umer, Browser("projectCentre QTP:TEST-AT:").Page("projectCentre QTP:TEST-AT:").Frame("RegRegRegFrame").WebTable("...").ChildItem(i,1,"WebCheckBox",0).Set "ON" The above code is not working for me . i am always facing an error "Object Required" Thanks Ranjani.S RE: How to select a particular check box from a list - agarwl.anurag - 10-18-2012 Hi, Did u add webtable element in your object repository? RE: How to select a particular check box from a list - ranjanisudarmani - 10-19-2012 Yes i have added web table in OR. since i am facing the problem RE: How to select a particular check box from a list - vjjohnson04 - 10-23-2012 I execute the code in this way and get an error Error Message: Wrong number of arguments or invalid property assignment: 'oPage.WebTable(...).ChildObjects' Line (93): "oPage.WebTable(Result_Grd).ChildObjects(i,3)(oChkBox).set "ON"" code: Code: Set oPage = Browser("micClass:=Browser").Page("micClass:=Page") |