sebv/node-wd-sync

I can't load my Selenium tests after a wd-sync upgrade to the latest version

GeorgiG opened this issue · 3 comments

Hello,

I can't load my Selenium tests since I upgraded my wd-sync to the latest version.

Here is a sample of the code:

wdSync = require 'wd-sync'
should = require 'should'

browser = null
wrap = wdSync.wrap
  with: -> browser
  pre: -> @timeout 45000

website = (name, body) ->
  describe name, ->
    before (done) ->
      {browser} = wdSync.remote "192.168.56.102", 4444

      browser.findImage = (name) ->
        @setWaitTimeout 3000
        image = @elementByCssIfExists name
        image

      browser.findBanner = (id) ->
        @setWaitTimeout 20000
        console.log "finding banner #{id}"
        banner = @elementByCssIfExists id
        should.exist(banner)


        banner

      done()

    body()

page = (name, fn) ->
  it name, wrap ->
    @init
      browserName: "ie"
    try fn.apply(@)
    finally @quit()


website "Test website", ->
  if true

    page "Go to Google", ->
      @get "http://google.com"
      queryField = @elementByName 'q'
      @type queryField, "Philips"
      @type queryField, "\n"
      @findBanner '#kelkoo-widget'

The test starts and navigates to the Google URL but then nothing happens - it's unable to locate the "q" text field.
I've tried to downgrade wd-sync to previous versions but I still can't complete any of my tests.

Could you please check this?

Thank you for your attention!

Best Regards,

Georgi

Any ideas?

Try one or the other, type/sendKeys is a fn of element

queryField.type("Philips")
queryField.sendKeys("\n")

That's it! :) Thank you very much! :)