Registration To Forum Is 100% Free
Special 67% Discount on all courses Enroll Today
Home › Forum › IT Industry › Technical Discussion › Quality Testing / Project Management › How would you count the number of elements on a page in selenium testing?
Log in with your username and password
Registration at Smart Mentors is completely free and takes only a few seconds. By registering you’ll gain:
Register Now, or check out the Site Tour and find out everything Smart Mentors has to offer.
This thread contains 1 reply, has 2 voices, and was last updated by Urvish 2 years, 5 months ago.
How would you count the number of elements on a page in selenium testing?
We first need to get the node element where the items are listed. For example, in the HTML code below:
<ul id=”Example”> <li >Example title 1 <li >Example title 2 . . <li >Example title 10 </ ul>The root element can be located usingList<WebElement> movies = driver.findElements(By.cssSelector(ul#Example li));int numberOfExample = Example.size(); //we can use the .size() to get the number of <li > elements
<ul id=”Example”> <li >Example title 1 <li >Example title 2 . . <li >Example title 10 </ ul>
The root element can be located using
List<WebElement> movies = driver.findElements(By.cssSelector(ul#Example li));
int numberOfExample = Example.size(); //we can use the .size() to get the number of <li > elements
You must be logged in to reply to this thread.Please login or register. Registration is 100% free.
Our experts listen to you patiently and suggest you the right course after conducting a personality profile test. Register your interest below to schedule personality profile test for you.
Training Mode*Classroom TrainingVirtual Training
Interested in Course*optgroup-C/C++ ProgrammingC ProgrammingC++ Programmingendoptgroupoptgroup-Web Programming (PHP)PHP with MySQL for BeginnersAdvanced PHP with MySQL – Beyond the BasicsMVC Framework for PHP ApplicationsContent Management System for PHP ApplicationsEcommerce Platforms for PHP Applicationsendoptgroupoptgroup-Website DesigningWebsite Designing for BeginnersAdvanced Website Designing – Beyond the Basicsendoptgroupoptgroup-UI/UX DevelopmentUI Development for BeginnersUI Development – Beyond the Basicsendoptgroupoptgroup-Graphics DesigningGraphics Designing for BeginnersAdvanced Graphics Designing : Beyond the Basicsendoptgroupoptgroup-Digital Marketing / SEODigital Marketing & SEO for BeginnersDigital Marketing & SEO – Beyond the BasicsSocial Media Marketing (SMM)Pay Per Click (PPC)endoptgroupoptgroup-Android DevelopmentAndroid Development Course For BeginnersAndroid Development Course – Beyond the Basicsendoptgroupoptgroup-Quality Testing / Project ManagementWeb Testing Course for BeginnersAdvanced Web Testing Course – Beyond the Basicsendoptgroupoptgroup-Industrial / Internship TrainingInternship Training For AndroidInternship training for Quality Testing / Project ManagementInternship training for Digital Marketing / SEOInternship training for Graphics DesigningInternship training for UI / UX DevelopmentInternship training for Web DesigningInternship training for PHPendoptgroup