How to get the count of all text box in a web page?

AnswerBot
2mo

Use Selenium WebDriver to find and count all text boxes on a web page.

  • Use Selenium WebDriver to locate all text boxes on the web page

  • Use findElements method with input tag and type attribute as text t...read more

Roshini Sandhya
3mo
public class Counttestbox { public static void main(String[] args) { WebDriverManagerchrome driver().setup(); WebDriver driver=new Chrome driver ngtm(). driver { goat driver }
Suganya Krishnamoorthi
1y

public class Counttestbox {

public static void main(String[] args) {

WebDriverManager.chromedriver().setup();

WebDriver driver=new ChromeDriver();

driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));

driver.get("https://testautomationpractice.blogspot.com/");

driver.manage().window().maximize();

//select specific one textboxes

//driver.findElement(By.xpath("//input[@id='monday']")).click();

//total number of textboxes

List<WebElement> textboxes=driver.findElements(By.xpath("//input[@type='text']"));

System.out.println("Total number of textboxes:"+textboxes.size());

}

}

Fahad Dhillum
2y

textbox = driver.find_elements(By,TagName , "Textarea")

counter = len(textbox)

Fahad Dhillum
2y

textbox = driver.find_elements(By,TagName , "Textarea")

counter = len(textbox)

PraveenKumar Velaiyah
2y

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.get("http://localhost/2010A15/?p=register");

java.util.List<WebElement> textboxes = driver.findElements(By.xpath("dijitReset...read more

Add answer anonymously...
Cognizant Selenium Automation Tester Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter