简体   繁体   中英

UFT - AUT is a web application and UFT is not recogning the webtable rowcount at runtime after deleting rows

The rowcount remains constant, which means the Do Loop is never exited.

Does anyone have any suggestions on how to resolve this?

Do
    a = Browser(browser).Page(page).WebTable("webtable").RowCount
    noOfRows = a - 1
    Browser(browser).Page(page).Link("Delete").Click
Loop While noOfRows > 0

you can check with for loop as follows

Dim iCount 
sRow = Browser(browser).Page(page).WebTable("webtable").RowCount
for iCount = 0 To sRow-1
        Browser(browser).Page(page).Link("Delete").Click
Next

It will first find no of rows on page and For loop is use to delete them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM