question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

isClickable() returns false even if webdriver can click on it

See original GitHub issue

Environment (please complete the following information):

  • WebdriverIO version: 5.16.6
  • Mode: [Standalone mode or WDIO Testrunner] WDIO
  • If WDIO Testrunner, running sync/async: [e.g. sync/async] sync
  • Node.js version: 10.16.0
  • NPM version: 6.9.0
  • Browser name and version: Chrome 78
  • Platform name and version: mac 10.13

Describe the bug isClickable() method returns false even if webdriver can click on it

To Reproduce Steps to reproduce the behavior: SauceLab session: https://app.saucelabs.com/tests/f1ba7fd84f754a68b7064982bd926f8f

it('Verify save recap header navigation -feature save-recap', () => {
    // preparing a state
    browser.url('https://cooking.nytimes.com');
    browser.setCookies({
      name: 'NYT-S',
      value: '1wgudaaCk1pEnpqRO8JdfCRc6g2K2eEyqD1ygWQZvgFkqeKfL5Rg.vnJ8Rub.mpPw/alTpzrtSHSEKCTZP5x4liKozoREjQA0Se2hZqDu7n/Berrf3ZQA4MXU.nZCvmPL4',
      domain: '.nytimes.com',
      path: '/',
    });

    browser.refresh();

    let el = $('a.nytc---saverecap---recipeName');

    el.scrollIntoView();
    console.log(el.isDisplayed());  // true
    console.log(el.isDisplayedInViewport()); // true
    console.log(el.isEnabled()); // true
    console.log(el.isClickable()); // false
    el.waitForClickable();
  });

Expected behavior Should return true as element clearly clickable and webdriver can click on it

Log

[0-0] RUNNING in chrome - /test/features/save-recap/save-recap.js
[0-0] true
[0-0] true
[0-0] true
[0-0] false
[0-0] ******* TEST 'Verify save recap header navigation -feature save-recap' FAILED *******
[0-0] Error in "save-recap functionality Verify save recap header navigation -feature save-recap"
element ("a.nytc---saverecap---recipeName") still not clickable after 10000ms
[0-0] FAILED in chrome - /test/features/save-recap/save-recap.js
[slack-reporter] Slack Webhook URL is not configured, notifications will not be sent to slack.

 "dot" Reporter:
F

 "spec" Reporter:
------------------------------------------------------------------
[chrome  mac os x #0-0] Spec: /Users/208821/Projects/np-cooking/api/test/e2e/test/features/save-recap/save-recap.js
[chrome  mac os x #0-0] Running: chrome on mac os x
[chrome  mac os x #0-0]
[chrome  mac os x #0-0] save-recap functionality
[chrome  mac os x #0-0]    ✖ Verify save recap header navigation -feature save-recap
[chrome  mac os x #0-0]
[chrome  mac os x #0-0] 1 failing (28.7s)
[chrome  mac os x #0-0]
[chrome  mac os x #0-0] 1) save-recap functionality Verify save recap header navigation -feature save-recap
[chrome  mac os x #0-0] element ("a.nytc---saverecap---recipeName") still not clickable after 10000ms
[chrome  mac os x #0-0] Error: element ("a.nytc---saverecap---recipeName") still not clickable after 10000ms
[chrome  mac os x #0-0]     at Context.<anonymous> (/Users/208821/Projects/np-cooking/api/test/e2e/test/features/save-recap/save-recap.js:94:8)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
mgrybykcommented, Nov 18, 2020

@YashMonetate there is a standard approach on how to disable an input, if you are not following it (or using such UI framework) you have to implement your custom way to check if an element is enabled. There are tons of ways to disable an element from end user point of view however, there is only one way to do it according to the specification.

1reaction
YashMonetatecommented, Nov 18, 2020

Hi @mgrybyk, this still seems an issue. When i am calling isClickable() or isEnabled(), it returns true even my element is disabled. Please see below SS

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to judge that the element is clickable or not? - Selenium
For your understanding, element_to_be_clickable == You can click it. You can click a greyed out item. It probably won't do anything, but that's ......
Read more >
isClickable - WebdriverIO
isClickable. Return true if the selected DOM-element: exists; is visible; is within viewport (if not try scroll to it); its center is not...
Read more >
Check that the element is clickable or not in Selenium ...
To verify, if the element can be clicked, we shall use the elementToBeClickable condition. A timeout exception is thrown if the criteria for ......
Read more >
How to determine whether element is clickable or not? [closed]
You can click text. It just (usually) doesn't DO anything. Everything that exists CAN be clicked -- you can move your pointer over...
Read more >
What Is ExpectedConditions In Selenium (With Examples)
It returns false if the titles do not match. ... Wait for 5 seconds until the requisite element is clickable (i.e. it can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found