Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the title attribute of a input element? - webdriver

How to get the attribute of Title in the input element

<input type="image" title="Previous Page">
<input type="image" title="First Page">
<input type="image" title="Next Page">
<input type="image" title="Last Page">
like image 639
Nick Kahn Avatar asked Feb 15 '13 19:02

Nick Kahn


1 Answers

What have you tried? Typically something like the following should work:

WebElement element = driver.findElement(By.tagName("input"));
String title = element.getAttribute("title");
like image 162
JimEvans Avatar answered Sep 27 '22 15:09

JimEvans



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!