0

I would like to enter a value in JavaScript with the following input field. But I can not find it on the page.Link: https://ebildirge.sgk.gov.tr/WPEB/amp/loginldap

<input type="text" name="isyeri_guvenlik" id="isyeri_guvenlik" maxlength="4" autocomplete="off" style="width:50">

IJavaScriptExecutor js = (IJavaScriptExecutor)driveri;
js.ExecuteScript(string.Format("document.getElementById('isyeri_guvenlik').value='{0}';", page.GetText()));
Aliz
  • 59
  • 1
  • 7

2 Answers2

0

Have you try another solution?

js.ExecuteScript(string.Format("document.getElementById('isyeri_guvenlik').setAttribute('value', '{0}')", page.GetText()));

or something like this

var text = driveri.FindElement(By.Id('isyeri_guvenlik'));
driver.ExecuteScript("arguments[0].setAttribute('value', '" + page.GetText() +"')", text);
derodevil
  • 811
  • 1
  • 11
  • 37
0

You can refer below link for solution. The solution is similar: Selenium: Can I set any of the attribute value of a WebElement in Selenium?

If you are trying to enter captcha value in the field then it will not work because captcha value is dynamic and its an image ---

shruti
  • 33
  • 1
  • 6