0

i want to get the value in value="" which is 448CA236139FF2A5D7C40CE327779F49 and put it in variable to use it in other class

<input type="hidden" name="Idsession" value="448CA236139FF2A5D7C40CE327779F49" xpath="1" style="">

i tried

WebElement ids = driver.findElement(By.name("Idsession"));
String cookie=ids.getAttribute("innerText");

didn't worked

M J
  • 174
  • 1
  • 12

1 Answers1

1

Try String cookie = driver.findElement(By.name("Idsession")).getAttribute("value");.

You're trying to retrieve the attribute "value", "innerText" has no relevance in that case.

jes
  • 26
  • 4