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

Latest Night-watch versions (2.0.7 and 2.0.8) are not setting the value if its a dropdown As it was setting the value in Nightwatch 1.7.8 #3079

Closed
s-kugan opened this issue Mar 1, 2022 · 1 comment · Fixed by #3087
Assignees

Comments

@s-kugan
Copy link

s-kugan commented Mar 1, 2022

Describe the bug

I am using nigh-watch version 1.7.8. I've a test that selects a value in dropdown using setValue command. which works fine without any issue. Recently I've updated my test to night-watch 2.0.7. after that It is not selecting the value from the drop-down box.

This is how element is defined in the page object and this element has option tag with the value.

dropDownState: {
      selector: "#province",
      abortOnFailure: false,
      suppressNotFoundErrors: true,
    },
This is how the option is defined the DOM
<option value="AK">Alaska</option>
 
 <option value="AK">Alaska</option>
This is the error I am getting. 
Error while running .setElementValue() protocol action: invalid element state
  (Session info: chrome=98.0.4758.102)
  (Driver info: chromedriver=98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758@{#1151}),platform=Windows NT 10.0.19042 x86_64)

  TimeoutError: An error occurred while running .setValue() command on <Element [name=@dropDownState]>: invalid element state
   (Session info: chrome=98.0.4758.102)
   (Driver info: chromedriver=98.0.4758.102 (273bf7ac8c909cde36982d27f66f3c70846a3718-refs/branch-heads/4758@{#1151}),platform=Windows NT 
10.0.19042 x86_64)
 {"error":{"name":"InvalidElementStateError","remoteStacktrace":""},"status":-1,"value":null}

Verbose output

debug.log

<!-- Include the verbose output, if possible (run nightwatch with `--verbose` argument) -->

Your Environment

Executable Version
nightwatch --version 2.0.8
npm --version 6.12.1
node --version 12.13.1
Browser driver Version
chromedriver 98.0.4758.102
selenium-server 3.141
OS Version
Windows 10 1607
@beatfactor
Copy link
Member

We'll look into it. You can use sendKeys() instead of setValue() in the meantime.

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

Successfully merging a pull request may close this issue.

3 participants