Micro Focus QTP (UFT) Forums
Is it possible to set focus to a particular cell in the datatable? - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: Is it possible to set focus to a particular cell in the datatable? (/Thread-Is-it-possible-to-set-focus-to-a-particular-cell-in-the-datatable)



Is it possible to set focus to a particular cell in the datatable? - mailashy78 - 11-17-2009

Hi,
Pls let me know as how to set focus to a particular cell in the data table.do we have any method to do so?

Thanks
Ashok


RE: Is it possible to set focus to a particular cell in the datatable? - venkatbatchu - 11-17-2009

Hi,
Below is the test case i have proceed.

1.Focus means (Ex: webedit object)
2.First find the particular cell consists of (Ex: A webedit name of "p_dev_release_found")
3. Then identify the number of edit fields available in that particular webtable (Here i have consider the object as webedit that is the reason i have calculated the webedit counut)
4.Write the for loop wherever this webedit title is matches in the webtable then focus the field i.e webedit field

By considering the above thing i generated a script...

Please look it may help you

Code:
Set odesc=Description.Create( )
    oDesc("micclass").Value = "WebEdit"
    oDesc("name").Value = "p_dev_release_found"
Set editcollection=Browser("xxxxxxxxxxxxxxxx").Page("xxxxxxxxxxxxxxxx").Frame("main").WebTable("Category").ChildObjects
Numberofedits=editcollection.count
msgbox Numberofedits
For i=0 to Numberofedits-1
    If editcollection(i).GetROProperty("Name")="p_dev_release_found" Then
        Browser("xxxxxxxxxxxxxxxx").Page("xxxxxxxxxxxxxxxx").Frame("main").WebEdit("name:=p_dev_release_found").Click
    End If
Next


Please let me know if i am wrong...

Thanks,
Venkat.Batchu


RE: Is it possible to set focus to a particular cell in the datatable? - sreekanth chilam - 11-17-2009

@Venkat : Could you please look into the Question posted.
"Pls let me know as how to set focus to a particular cell in the data table.do we have any method to do so?"

Are you sure that your above way/solution would solve the mailashy78 Question ?


RE: Is it possible to set focus to a particular cell in the datatable? - venkatbatchu - 11-18-2009

Hi Sreekanth,
i have tried with the above example and observed that corresponding field has been focused so we will not have any problem but we have a easiest solution is

Code:
Set objedit=Browser("xxxxxxxxxxxxxxxx").Page("xxxxxxxxxxxxxxxx").Frame("main").WebTable("Category").Childitem(row,column,'Property",Index)  (Here property in the sense WebEdit)
objedit.click


Thanks,
Venkat.Batchu

Hey guys,
mailashy78 asked how to focus the particular cell in datatable not in application..

I misunderstood the concept.

sorry guys....


RE: Is it possible to set focus to a particular cell in the datatable? - v_selvam - 11-18-2009

We have only the setCurrentRow(index) method. It will select all cells in the index specified.