isEnabled not working

885 views
Skip to first unread message

Nitin Purswani

unread,
Mar 31, 2010, 4:22:09 PM3/31/10
to webdriver
Hi,
I have one link disabled .i am getting element object by command

WebElement elem1=driver.findElement(By.linkText("link1");

if(elem1.isEnabled()) {
click it
}
else
{
don't click it
}

but instruction pointer never goes to isEnabled function if my link is
disabled .It throws an error Unable to locate element .

Can anyone please help me that how i can use isEnabled Function()


Thanks
Nitin

Simon Stewart

unread,
Mar 31, 2010, 7:10:34 PM3/31/10
to webd...@googlegroups.com
Hi Nitin,

We can't really dig into this until we know which browser and version
you're using, on which OS, using which version of webdriver/selenium,
as well as telling us what you're trying to do. The individual drivers
do things their own way, so it's possible someone may spend a
significant amount of time tracking down the issue in the wrong driver
:)

Any chance you could let us know some more information?

Regards,

Simon

> --
> You received this message because you are subscribed to the Google Groups "webdriver" group.
> To post to this group, send email to webd...@googlegroups.com.
> To unsubscribe from this group, send email to webdriver+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
>
>

Nitin Purswani

unread,
Apr 1, 2010, 1:24:31 PM4/1/10
to webdriver
Hi My enviornment is

OS:Linux (Suse11.2-kernel 2.6.31)
Browser:Firefox 3.5.8
Build:selenium-server-2.0.1.jar

Use case:
I have one link on my browser which can be disabled /enabled.Before
clicking that link i want to know is that link enabled or not .What
can be best possible way to achieve this through WebDriver.

Please let me know if you want any other information .
Thanks
Nitin

On Apr 1, 4:10 am, Simon Stewart <simon.m.stew...@gmail.com> wrote:
> Hi Nitin,
>
> We can't really dig into this until we know which browser and version
> you're using, on which OS, using which version of webdriver/selenium,
> as well as telling us what you're trying to do. The individual drivers
> do things their own way, so it's possible someone may spend a
> significant amount of time tracking down the issue in the wrong driver
> :)
>
> Any chance you could let us know some more information?
>
> Regards,
>
> Simon
>

Simon Stewart

unread,
Apr 5, 2010, 3:59:59 PM4/5/10
to webd...@googlegroups.com
The code you've got there should work. The problem is that the element
isn't being found by link text. Have you tried "By.partialLinkText"?

Regards,

Simon

Brijendra Singh

unread,
Oct 31, 2016, 8:30:02 PM10/31/16
to webdriver
Hello Simon,

I am having the same issue.as link is disable but isEnabled() returns true.
i have tried with id,linktext,xpath but nothing got worked out.
Window7,IE driver-2.53.1,IE11,Webdriver 2.53.1

Please provide the solution.

Regards,
Brijendra Singh

Brijendra Singh

unread,
Oct 31, 2016, 8:30:08 PM10/31/16
to webdriver
Hello Simon,

Even i am facing the same issue where isEnabled() returns true even after link is disabled in state.
i have validated enable/disable successfully for buttons and labels but issue is coming only for links.

IE driver 2.53.1 32 bit
windows 7
IE11.

Please provide me the alternate solution.

Regards,
Brijendra Singh

sandee...@highq.com

unread,
Apr 12, 2017, 2:40:04 AM4/12/17
to webdriver
Hi Nitin,

can u please provide the snapshot of link page,

where you are facing the issue of disabled/enabled.

Thank you.

SuperKevy

unread,
Apr 12, 2017, 6:16:12 PM4/12/17
to webdriver
Wow. picking up a thread from 2010.  Kind of dated.   
If you are talking about links as <a href="myurl">Text</a> I believe you'll find the that element does not support the disabled attribute
As indicated in the stackoverflow getAttribute can be used .
Reply all
Reply to author
Forward
0 new messages