How to check the link is enabled in Webdriver using java? -


i have searched forums before posting issue here. have found answers not able success answers in that. issue

how check link enabled in webdriver using java. please find attached screen shots same.

enter image description here

enter image description here

i have written code this:

webelement textlink = driver.findelement(by.id(or.getproperty("lnkview_id"))); if (textlink.isenabled())    system.out.println("view link: enabled"); else    system.out.println("view link: disabled"); 

please me out issue. appreciated.

try following:

string isdisabled = textlink.getattribute("disabled"); if (isdisabled==null || !isdisabled.equals("disabled")){    system.out.println("view link: enabled"); }else{    system.out.println("view link: disabled"); } 

it looks attribute "disabled" toggle whether enabled or not, can check using getattribute();


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -