QTP not selecting appropriate webelement from the webtable..Need Solution - 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: QTP not selecting appropriate webelement from the webtable..Need Solution (/Thread-QTP-not-selecting-appropriate-webelement-from-the-webtable-Need-Solution) Pages:
1
2
|
QTP not selecting appropriate webelement from the webtable..Need Solution - satishkumarm - 04-25-2011 Code: Browser("browsername").Page("Inpatient").Frame("Admission Requests").WebElement("innertext:=AR1100000113", "html tag:=SPAN", "html id:=AppointGrid_Datagrid_ROWS_DATA_1_3").Click I have recorded the script for selecting the weblement(using click method) from the webtable and for performing next operation on the selected line But while running the script it is selecting different webelement(first statement) and performing next operation for first statment in the webtable(i.e., not selecting the appropriate webelement) I tried to find the solution but got invain Please help me out ASAP Please refer the attachments for easy understanding RE: QTP not selecting appropriate webelement from the webtable..Need Solution - Saket - 04-25-2011 use webtable methods instead accessing webelements directly. try below steps to achive this - 1. get the row where your required text is there in the table using GetRowWithCellText nRow =B().P().F().WebTable().GetRowWithCellText("AR1100000113") 2. set an object to the webelement of the row and required column Set oElem = B().P().F().WebTable().childitem(nRow,4,"WebElement",0) 3. Click on webelement oElem.Click RE: QTP not selecting appropriate webelement from the webtable..Need Solution - satishkumarm - 04-25-2011 Hi Saket, May i know the reason for using '4' in childitem(nRow,4, "WebElement",0) i ran the script which you gave but its giving error as statment contains one or more invalid function arguements..please help me out Thanks in advance Sorry Now there is no error appeared to me but at the sametime no action takes place..I have used your code as below.. Code: Set AdmissionRequests = Browser("browsername").Page("Inpatient").Frame("Admission Requests") O/P values: r=4 c=1 RE: QTP not selecting appropriate webelement from the webtable..Need Solution - Saket - 04-26-2011 '4' in childitem statement is the column number where you wbelement is in the row. you have used it as 'c' later, but it will contain the number of columns in the specified row by using your statement as 'WebTable("Requested Admission Date").ColumnCount(nrow)' use the column number where webelement is present there. RE: QTP not selecting appropriate webelement from the webtable..Need Solution - satishkumarm - 04-26-2011 Hi Saket, Actually webtable has 9 rows and 1 column as is is displayed in object spy(attached here) and if i pass number directly in childitem(eg: column number as 4) then it is giving run time error when i run the below script Code: Set AdmissionRequests = Browser("BN").Page("Inpatient").Frame("Admission Requests") Error: ---------------------------------------------------------------- The statement contains one or more invalid function arguments. Line (173): "oElem.Click". ---------------------------------------------------------------- Webtable is not having equally distributed rows and columns...this is the problem i guess.. Please help me out with any other solution Please refer the attachments... Thanks, satish RE: QTP not selecting appropriate webelement from the webtable..Need Solution - satishkumarm - 04-27-2011 Guyz, Please help me ASAP which is highly appreciated..waiting for ur reply Thanks, Satish RE: QTP not selecting appropriate webelement from the webtable..Need Solution - Saket - 04-27-2011 what do you mean by "not equally distributed", are you able to get the column number for Requisition Number? there could be one more way - you just need to select the required row and proceed, right? see if this can be done by clicking the webelement at first column. if so dont bother to retrive the column number just try with 1. let me know if that works. RE: QTP not selecting appropriate webelement from the webtable..Need Solution - satishkumarm - 04-28-2011 Code: Set AdmissionRequests = Browser("BN").Page("Inpatient").Frame("Admission Requests") I tried with first column even then its not meeting as expected(no weblement is clicked) what i mean to say is in fronend of the application table is showing with some n number of columns and m number of rows but in the object spy only one column and some 9 rows is displayed in the properties RE: QTP not selecting appropriate webelement from the webtable..Need Solution - vIns - 04-28-2011 Hi... Can u plz try this and see if the expected cell is getting highlighted properly? Code: Set AdmissionRequests = Browser("BN").Page("Inpatient").Frame("Admission Requests") RE: QTP not selecting appropriate webelement from the webtable..Need Solution - satishkumarm - 04-28-2011 when i use the above script then it is highlighting entire table.. I have modified the script as below and tried again but still not selecting appropriately Code: Set AdmissionRequests = Browser("BN").Page("Inpatient").Frame("Admission Requests") |