Forum Discussion

nimishbhuta's avatar
nimishbhuta
Frequent Contributor
7 years ago
Solved

How to select the a check box in table cell value?

Hello, 

 

I need to select a checkbox which is under  the table cell value. The thing is we need to select the checkbox which is there in the first column based on the text in the second column.

 

For example :- 

In a table there are 2 columns in the table :

 

Col 1                    Col2

 

Checkobject 1      Test1

Checkobject 2      Test2

 

I need to search for the text "Test1" and based on the text found I need to select the checkobject1 

 

Regards,

 

Nimish

 

 

  • Thanks for your reply. I tried it but  it dis not work,but I made some changes and it worked. First I created an array of property name and values. For property names and values, I have put the double in it.   

     

    PropArray = Array("ObjectType", "contentText")
    ValuesArray = Array("Cell", "XJDE0001")

     

     Set target =yourtable.arrTab(0).Find(PropArray,ValuesArray,10)

    rowIndex=target.RowIndex             (it did not worked with parent)

    yourtable.Cell(rowIndex,colIndex.Click() 

     

    Regards,

     

    Nimish

2 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    You can use the following algorithm, based on assumption, that parent elements (Cell) for Checkobject1 and Test1 have the same RowIndex property.

     

    Say, you need to click on Checkobject1 :

     

    1) Find Cell, which contains the text "Test1"

    target = Aliases.yourTable.Find( ['ObjectType', 'contentText'], ['TextNode', 'Test1'], 10 )

    2) Get the value of the RowIndex property of the target

    rowIndex = target.Parent.RowIndex

    3) Click on the Checkobject1

    Aliases.yourTable.Find( ['ObjectType', 'RowIndex'], ['Cell', rowIndex], 10 ).Click()

     

    P.S. Use properties and values, that are relevant for your application. It can be Label instead of TextNode or something else.

    • nimishbhuta's avatar
      nimishbhuta
      Frequent Contributor

      Thanks for your reply. I tried it but  it dis not work,but I made some changes and it worked. First I created an array of property name and values. For property names and values, I have put the double in it.   

       

      PropArray = Array("ObjectType", "contentText")
      ValuesArray = Array("Cell", "XJDE0001")

       

       Set target =yourtable.arrTab(0).Find(PropArray,ValuesArray,10)

      rowIndex=target.RowIndex             (it did not worked with parent)

      yourtable.Cell(rowIndex,colIndex.Click() 

       

      Regards,

       

      Nimish