Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getElementRect does not work #3234

Closed
TuHuynhVan opened this issue Jan 3, 2019 · 1 comment
Closed

getElementRect does not work #3234

TuHuynhVan opened this issue Jan 3, 2019 · 1 comment

Comments

@TuHuynhVan
Copy link
Member

TuHuynhVan commented Jan 3, 2019

Environment:

  • WebdriverIO version: 5.2.0
  • Mode: WDIO Testrunner
  • IRunning sync mode
  • Node.js version: 8.11.2
  • NPM version: 6.4.1
  • Browser name and version: Chrome Version 71.0.3578.98 (Official Build) (64-bit)
  • Platform name and version: MacOS Hig Serria
  • Additional wdio packages used (if applicable):
"@wdio/cli": "^5.2.0",
"@wdio/local-runner": "^5.2.0",
"@wdio/mocha-framework": "^5.0.3",
"@wdio/sync": "^5.2.0"

Config of WebdriverIO

exports.config = {
    runner: 'local',
    host:'localhost',
    port: 9515,
    path: '/',
    specs: [
        './test/specs/test.js'
    ],
    maxInstances: 10,
    capabilities: [{
        maxInstances: 5,
        browserName: 'chrome'
    }],
    logLevel: 'trace',
    deprecationWarnings: true,
    framework: 'mocha',
    mochaOpts: {
        ui: 'bdd',
        timeout: 60000,
        compilers: ['js:babel-register']
    }
}

Describe the bug

  • The test got failed
  • There is no tracing for related error bug I could see it stopped at the getElementRect

To Reproduce
Steps to reproduce the behavior:

describe('Explore WebdriverIO v5', () => {

  it('getElementRect should work', () => {
    browser.url('http://the-internet.herokuapp.com/drag_and_drop')
    $('#column-a').waitForEnabled(30000);
    let column_a = $('#column-a')
    let column_b = $('#column-b')

    const sourceRect = browser.getElementRect(column_a.elementId)
    console.log(sourceRect);
  })
})

Expected behavior
Should see element rect, the test should not failed

Log

Stdout:
2019-01-03T15:41:44.896Z INFO wdio-cli:Launcher: Run onPrepare hook
2019-01-03T15:41:44.899Z INFO wdio-local-runner: Start worker 0-0 with arg:
[0-0] 2019-01-03T15:41:45.049Z DEBUG wdio-config: wdio-sync found, running tests synchronous
[0-0] 2019-01-03T15:41:45.225Z INFO wdio-local-runner: Run worker command: run
[0-0] 2019-01-03T15:41:45.230Z DEBUG wdio-local-runner:utils: init remote session
[0-0] 2019-01-03T15:41:45.258Z INFO webdriver: [POST] http://127.0.0.1:9515/session
[0-0] 2019-01-03T15:41:45.258Z INFO webdriver: DATA { capabilities: { alwaysMatch: { browserName: 'chrome' }, firstMatch: [ {} ] },
  desiredCapabilities: { browserName: 'chrome' } }
[0-0] 2019-01-03T15:41:46.917Z INFO webdriver: COMMAND navigateTo("http://the-internet.herokuapp.com/drag_and_drop")
[0-0] 2019-01-03T15:41:46.918Z INFO webdriver: [POST] http://127.0.0.1:9515/session/cd2e095434a0eef538e8f2eb73574140/url
[0-0] 2019-01-03T15:41:46.918Z INFO webdriver: DATA { url: 'http://the-internet.herokuapp.com/drag_and_drop' }
[0-0] 2019-01-03T15:41:49.409Z INFO webdriver: COMMAND findElement("css selector", "#column-a")
[0-0] 2019-01-03T15:41:49.410Z INFO webdriver: [POST] http://127.0.0.1:9515/session/cd2e095434a0eef538e8f2eb73574140/element
[0-0] 2019-01-03T15:41:49.410Z INFO webdriver: DATA { using: 'css selector', value: '#column-a' }
[0-0] 2019-01-03T15:41:49.423Z INFO webdriver: RESULT { ELEMENT: '0.9968053404204311-1' }
[0-0] 2019-01-03T15:41:49.443Z INFO webdriver: COMMAND isElementEnabled("0.9968053404204311-1")
[0-0] 2019-01-03T15:41:49.443Z INFO webdriver: [GET] http://127.0.0.1:9515/session/cd2e095434a0eef538e8f2eb73574140/element/0.9968053404204311-1/enabled
[0-0] 2019-01-03T15:41:49.453Z INFO webdriver: RESULT true
[0-0] 2019-01-03T15:41:49.453Z INFO webdriver: COMMAND findElement("css selector", "#column-a")
[0-0] 2019-01-03T15:41:49.453Z INFO webdriver: [POST] http://127.0.0.1:9515/session/cd2e095434a0eef538e8f2eb73574140/element
[0-0] 2019-01-03T15:41:49.453Z INFO webdriver: DATA { using: 'css selector', value: '#column-a' }
[0-0] 2019-01-03T15:41:49.461Z INFO webdriver: RESULT { ELEMENT: '0.9968053404204311-1' }
[0-0] 2019-01-03T15:41:49.461Z INFO webdriver: COMMAND findElement("css selector", "#column-b")
[0-0] 2019-01-03T15:41:49.462Z INFO webdriver: [POST] http://127.0.0.1:9515/session/cd2e095434a0eef538e8f2eb73574140/element
[0-0] 2019-01-03T15:41:49.462Z INFO webdriver: DATA { using: 'css selector', value: '#column-b' }
[0-0] 2019-01-03T15:41:49.473Z INFO webdriver: RESULT { ELEMENT: '0.9968053404204311-2' }
[0-0] 2019-01-03T15:41:49.486Z INFO webdriver: COMMAND deleteSession()
[0-0] 2019-01-03T15:41:49.486Z INFO webdriver: [DELETE] http://127.0.0.1:9515/session/cd2e095434a0eef538e8f2eb73574140
2019-01-03T15:41:49.773Z DEBUG wdio-local-runner: Runner 0-0 finished with exit code 1

Test Suites:     0 passed, 1 failed, 1 total (100% completed)
Time:            🕒  5.01s

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@TuHuynhVan TuHuynhVan pinned this issue Jan 3, 2019
@TuHuynhVan TuHuynhVan unpinned this issue Jan 3, 2019
@christian-bromann
Copy link
Member

This command is not supported in Chrome as it isn't fully W3C WebDriver compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants