December 2, 2021

Selenium Interview Questions on Textbox Part -2

Selenium Interview Questions on Textbox

1. How to get text in textbox?
2. How to get attributes like size, placeholder of text box?
We have to use getAttribute command to get attrubte values of textbox.
driver.findElement(locator).getAttribute("value"); -- for text in textbox 
driver.findElement(locator).getAttribute("attributeName"); -- For any attribute





17 comments: