Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

Count Total Number of Hyperlink, Video, Paragraph in Automation Script:-

package basicexample;

import java.util.List;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;

public class GetAllHyperLink {

public static void main(String[] args) {
System.setProperty("", "c://chromedriver.exe");
WebDriver driver = new ChromeDriver();
List<WebElement> ele  = driver.findElements(By.tagName("video"));
System.out.print("Number of hyperlink is "+ele.size());
for(WebElement o:ele)
List<WebElement> ele1  = driver.findElements(By.tagName("a"));
System.out.print("Number of hyperlink is "+ele1.size());
for(WebElement o:ele1)
List<WebElement> ele2  = driver.findElements(By.tagName("p"));
System.out.print("Number of paragraph is "+ele2.size());
for(WebElement o:ele2)


Post a Comment

POST Answer of Questions and ASK to Doubt

Previous Post Next Post