0

I am currently automating several procedures on a webpage using selenium type library in excel. Currently i am facing the following issue: my code finds a table is supposed to click on each row , do some other things,come back to the page in the table and proceed with the next row. The issue is that after coming back from the first interaction it displays a Stale element reference error. I tried to extend the application wait time, do a retry loop until element is interactable, refreshing the page -all of those did not work. Can someone with exp. help. Here is the snippet of code that errors out


Dim table, tRow As WebElement

 Set table = driver.FindElementByXPath("/html/body/div[2]/div[2]/div[2]/div[2]/div/div/div[2]/div[1]/table/tbody")


 
 
 Set tRow = driver.FindElementByTag("tr")
 
For Each tRow In table.FindElementsByTag("tr")


            tRow.Click  ''''HERE I GET THE STALE ELEMENT REFERENCE ERROR
            driver.FindElementByCss("#tabs > li:nth-child(9) > a").Click
            Application.Wait Now + TimeValue(pause1)
            driver.FindElementByCss("#breadcrumbs > ul > li:nth-child(1) > a").Click
            Application.Wait Now + TimeValue(pause1)
     
 
            Next tRow
Application.Wait Now + TimeValue(pause1)

0 Answers0