getAttribute("value") returns null

Viewed 123
<input id="containerNumber" type="text" class="ant-input" value="WB52154">

When I use getAttribute to extract the value from the above I get null back.

String value = driver.findElement(by.id("containerNumber")).getAttribute("value");
1 Answers

Please update your driver, if possible make sure to use the latest version this might require you to also update your browser.

This worked for me after a long time of struggle.

Related