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.
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
Post a Comment