How to Resolve Issue With Size() Function in Selenium for ChromeDriver

0
20
Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

Issue Details:
In selenium execution out of ten runs six run it gives
correct result in Firefox and Internet Explorer.
But the same failed in Chrome. Always gives wrong
count when element.Size() function is triggered.

System.out.println(driver.findElements())
(By.xpath("//*[@class='test-box']")).size());

How to Solve:

1. First let us check if chrome is rendering the xpath correctly. Check the xpath.

2. Secondly,let us check if application is taking longer time to load in chrome. Use some wait time.

Don't miss out!
Subscribe To Newsletter

Receive top technical news, lesson ideas, travel tips and more!

Invalid email address
Give it a try. You can unsubscribe at any time.

Spread the love
  • 1
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
    1
    Share

LEAVE A REPLY

Please enter your comment!
Please enter your name here