2014-11-04 98 views
0

如果(aqString [「ToUpper」](strCellValue)== aqString [「ToUpper」](StrVal))給出錯誤'object requred' )線。TestComplete給出錯誤Microsoft JScript運行時錯誤:預計對象

function tableClick(){ 

    ObjTable = mGetObject(sGlobalPageURL,"ObjectType,Name","Table,Table*list_product_group_table*") 
    intRows = ObjTable.RowCount 
    strCellValue = "TAA - Test Automation Account" 

    for (i = 1; i < intRows; i++) { 
    StrVal = ObjTable.Cell(i,0).innerText 
    If (aqString["ToUpper"](strCellValue) == aqString["ToUpper"](StrVal)) 
    { 
     ObjTable.Cell(i,3).click() 
     break; 
    } 
    } 
} 
+0

FYI:有這種比較短的代碼:'如果(aqString [ 「比較」(strCellValue,StrVal,真)== 0)' – Helen 2014-11-05 08:08:17

回答

1

JScript語言不具備如果關鍵字(第一我大寫)。使用小寫字母關鍵字:

if (aqString["ToUpper"](strCellValue) == aqString["ToUpper"](StrVal)) 
相關問題