0

I have a very simple script where I am trying to fill a username field in a website using "fillField" in Appium but I get this error "locator.stringify is not a function". I am not able to figure out what is the issue. Any help is appreciated. Here is the verbose output-

[1] Starting recording promises
    Emitted | suite.before ([object Object])
  test something
    Emitted | test.before ([object Object])
    Emitted | test.start ([object Object])
    Emitted | step.before (I am on page "https://xxxxxxxxx.com/#login")
    Emitted | step.after (I am on page "https://xxxxxxxxx.com/#login")
    Emitted | step.before (I wait 6)
    Emitted | step.after (I wait 6)
    Emitted | step.before (I fill field "username", "hello@world.com")
    Emitted | step.after (I fill field "username", "hello@world.com")
    Emitted | step.start (I am on page "https://xxxxxxx.com/#login")
    I am on page "https://xxxxxxxxxxx.com/#login"
    Emitted | step.passed (I am on page "https://xxxxxxx.com/#login")
    Emitted | step.finish (I am on page "https://xxxxxxxx.com/#login")
    Emitted | step.start (I wait 6)
    I wait 6
    Emitted | step.passed (I wait 6)
    Emitted | step.finish (I wait 6)
    Emitted | step.start (I fill field "username", "hello@world.com")
    I fill field "username", "hello@world.com"
    [1] Error | TypeError: locator.stringify is not a function
    Emitted | step.failed (I fill field "username", "hello@world.com")
    Emitted | step.finish (I fill field "username", "hello@world.com")
    [1] Error | TypeError: locator.stringify is not a function
    [1] Starting <teardown> session
    Emitted | test.failed ([object Object])
    Emitted | test.finish ([object Object])
    [1] <teardown> Stopping recording promises
 › <screenshotOnFail> Test failed, saving screenshot
 › Screenshot has been saved to /Users/qa-engg/Documents/codeceptJS/appium/output/test_something.failed.png
  ✖ FAILED in 9740ms

    [2] Starting recording promises
    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])

-- FAILURES:

  1) IP mobile
       test something:
     locator.stringify is not a function

2 Answers2

0

It looks like you found a bug, made in Dec, 2017. Soon, fix will be made.

As workaround, use different locators, not just string "username". CSS, Xpath, Strict locator for example.

0

@Evgeny - Thanks for your response. I was finally able to zero down the problem to the installation of webdriverio. I had both global and local installations. I uninstalled everything and just did a local install which seems to have fixed the issue.