How to get some link values from disabled text fields | Selenium Forum
M
Posted on 08/12/2015
My html code is below -
<input id="txtPortalLogin" class="form-control input-sm" type="text" disabled="disabled" placeholder="No Link" value=""/>

I want to print the link text values which is displayed in screenshot , attached with this post.
i tried gettext() method which did not work because html - text for link is not present i guess.
Do i need to use javascript executor but here i don't know how to use.

[attachment=0:9tgvg5i4]disabled field.png[/attachment:9tgvg5i4]

M
Replied on 08/12/2015

I tried with javascript executor but it also did not help to grab the link. Please help.

String value = (String)((JavascriptExecutor) driver).executeScript("document.getElementById('txtPortalLogin').value");
System.out.println(value);

It's printing null


M
Replied on 09/12/2015

[quote:1nbx6ggq] placeholder="No Link" [/quote:1nbx6ggq]

i'm not sure if this is the right do able if placeholder is showing "no link".