I using comment entry using VBA + Excel. Error occurring in this loop is pretty expected so i put On error Resume Next. if error occurs, the whole row will be colored in red.
But i found problem with code.. if error occurs, not only the row with error but also the next row without automatically are colored in red.
bot.Wait 1000
lastRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
For X = 2 To lastRow
bot.Wait 1000
bot.FindElementById("headerForm:awbSearchText", 3000).SendKeys Sheet1.Cells(X, 1)
bot.Wait 1000
bot.FindElementById("headerForm:searchBtnHidden", 3000).Click
'Update Activity
bot.Wait 2500
Dim eleAct As SelectElement
Set eleAct = bot.FindElementById("headerForm:menuItems").AsSelect
eleAct.SelectByText "Update Activity"
bot.FindElementById("headerForm:goButton", 3000).Click
'Comment update & save
bot.Wait 2500
Dim eleAct2 As SelectElement
Set eleAct2 = bot.FindElementById("tabview:tabform:updateActivitySubView:updateActivityPanel:updateActivity:updateTypeCode", 3000).AsSelect
eleAct2.SelectByText "Other"
bot.Wait 2500
bot.FindElementByXPath("//textarea[@name='tabview:tabform:updateActivitySubView:updateActivityPanel:updateActivity:j_id_id84pc14']", 3000).SendKeys Sheet1.Cells(X, 2)
bot.Wait 3000
bot.FindElementById("tabview:tabform:updateActivitySubView:updateActivityPanel:updateActivity:save", 3000).Click
bot.Wait 2000
bot.FindElementByXPath("//*[@id='tabview:j_id_id62:0:tabName']").Click
If Err.Number > 0 Then
Sheet1.Cells(X, 1).EntireRow.Font.Color = vbRed
End If
bot.Wait 1500
Next