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

AnswerBot
1y

To get the count of all text boxes in a web page, we can use Selenium's findElements() method with the input type 'text'.

  • Use Selenium's findElements() method to find all elements with the input type '...read more

Roshini Sandhya
1mo
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 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
Get AmbitionBox app

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