findElements(), Handling StaleElementReferenceException and tagName() (Selenium 4 - Session 15)

  Рет қаралды 4,036

QAFox

QAFox

Күн бұрын

Пікірлер: 5
@azadsiddiquie2392
@azadsiddiquie2392 Жыл бұрын
using for each i did not get StaleElementReferenceException. But using for loop i am not able to do the operation , only one link got clicked and got NoSuchElementException
@sigmasingh849
@sigmasingh849 2 жыл бұрын
I did not get Stale Element Reference Exception in the first method, it worked for me with the first way you explained! ..Why did it happen?
@QAFox
@QAFox 2 жыл бұрын
Can you share your code here?
@sigmasingh849
@sigmasingh849 2 жыл бұрын
@@QAFox public class StaleElementReferenceExep { public static void main(String[] args) throws InterruptedException { WebDriverManager.chromedriver().setup(); WebDriver driver = new ChromeDriver(); driver.manage().window().maximize(); driver.get("omayo.blogspot.com/"); driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); List links = driver.findElements(By.xpath("//div[@id='LinkList1']//a")); for(WebElement e:links) { e.click(); Thread.sleep(5000); driver.navigate().back(); } driver.close(); } This code worked for me but for you it gave an Stale Element Reference Exception
@azadsiddiquie2392
@azadsiddiquie2392 Жыл бұрын
​@@QAFoxyes for me also it worked
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 121 МЛН
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 36 МЛН
What is SRE | Tasks and Responsibilities of an SRE | SRE vs DevOps
24:25
TechWorld with Nana
Рет қаралды 334 М.
getText()  and  getAttribute() | Selenium WebDriver
2:54
senior QA
Рет қаралды 1,3 М.
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24