Search code examples
vb.netqtphp-uft

Wrong number of arguments or invalid property assignment in uft


Thanks in Advance :) I can get the row count but not the column count using columncount method in uft 12.2. It simples throws an error at AccNoCol=AccNoTB.ColumnCountWrong number of arguments or invalid property assignment: 'AccNoTB.ColumnCount'. I know the column count is 8 here however they are dynamic & there is a risk to hard code the column count in script. Could you plz point out the correct? Thanks again

Set AccNoTB=browser("title:=.*").page("title:=.*").webtable("column names:=;Account No;Account Name;Billing City;Website;Phone;Assigned To;Action","cols:=8")

AccNoRow=AccNoTB.RowCount

AccNoCol=AccNoTB.ColumnCount

AccTBvalue=AccNoTB.GetCellData(AccNoRow,AccNoCol)

MsgBox AccTBvalue`

Solution

  • The column count of each row in the WebTable can differ therefore ColumnCount requires a parameter to specify to UFT which row's column count you're interested in.

    A row can have
    <table border=1>
      <tr><td>One</td></tr>
      <tr><td>or</td><td>two</td></tr>
      <tr><td>or</td><td>even</td><td>more</td></tr>
    </table>
    Columns