samccone / drool

Automated memory leak detection and analysis
1.48k stars 53 forks source link

Cannot read property 'executeScript' of undefined #10

Closed linus-amg closed 9 years ago

linus-amg commented 9 years ago

i guess im doing something wrong with the webdriver

TypeError: Cannot read property 'executeScript' of undefined
  at getCounts (/Users/lgubenis/projects/paper/node_modules/drool/lib/index.js:14:9)
  at Object.flow (/Users/lgubenis/projects/paper/node_modules/drool/lib/index.js:39:3)
  at Object.<anonymous> (/Users/lgubenis/projects/paper/test/index.coffee:7:7)
  at Object.<anonymous> (/Users/lgubenis/projects/paper/test/index.coffee:1:1)
  at Module._compile (module.js:460:26)
linus-amg commented 9 years ago
drool = require('drool')
assert = require('assert')

driver = drool.start
  chromeOptions: 'no-sandbox'

drool.flow
  repeatCount: 100
  setup: ->
    driver.get('http://localhost:3000')
  action: ->

    # click on add page
    # adds page
    driver.findElement(
      drool.webdriver.By.css('#drool-add-page')
    ).click()

    # click on page
    # opens menu for page
    driver.findElement(
      drool.webdriver.By.css('.page')
    ).click()

    # click on delete
    driver.findElement(
      drool.webdriver.By.css('.drool-delete-page')
    ).click()
  assert: (after, initial) ->
    assert.equal(inital.nodes, after.nodes, 'node count should match')

driver.quit()
samccone commented 9 years ago

Easy fix :+1:

- drool.flow
+ drool.flow({
  repeatCount: 100
  setup: ->
    driver.get('http://localhost:3000')
  action: ->

    # click on add page
    # adds page
    driver.findElement(
      drool.webdriver.By.css('#drool-add-page')
    ).click()

    # click on page
    # opens menu for page
    driver.findElement(
      drool.webdriver.By.css('.page')
    ).click()

    # click on delete
    driver.findElement(
      drool.webdriver.By.css('.drool-delete-page')
    ).click()
  asset: (after, initial) ->
    assert.equal(inital.nodes, after.nodes, 'node count should match')
+ }, driver)
linus-amg commented 9 years ago

whoops, kthxbye :+1:

samccone commented 9 years ago

no problem @elgubenis :+1:

I agree that the error is super confusing :question:

Let me know if you have any other questions

linus-amg commented 9 years ago

yeah, i've got more questions, do you want them here or in another issue (i think its unrelated to this issue)

samccone commented 9 years ago

another issue is fine :)