0

Has anyone used robotframework to test ngx-datatable? Since it isn't set up like a regular table, the selenium libraries Get Table Cell function doesn't work. Does anyone have an example of a work-around?

iamcootis
  • 2,203
  • 3
  • 18
  • 22

1 Answers1

0

I've come up with a script that works for the time being.

 *** Variables ***
${Table} =  css=div[class^="datatable-row-center"]

 *** Keywords ***
Get Value From Grid
    #{RowNumber} 0 is the header
    #{ColNumber} 0 is first column
    [Arguments]  ${RowNumber}  ${ColNumber}
    Sleep  3s
    @{Table_Rows}=  Get Webelements  ${History_Table}
    ${Text}=  Get Text  @{Table_Rows}[${RowNumber}]
    @{words} =  Split String  ${Text}  \n
    Log to Console  @{words}[${ColNumber}]
    [Return]   @{words}[${ColNumber}]

This works as long as the class on the table rows remains 'datatable-row-center'

iamcootis
  • 2,203
  • 3
  • 18
  • 22