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
setValue() command does not work and throws error in Edge #3324
Comments
Can confirm issue. Same configuration (browserstack, wdio v5). |
Can anyone provide wdio and edgedriver logs? |
WDIO logs on debug log level settings here, unfortunately it seems BrowserStack doesn't allow you access to the Edgedriver logs unlike chrome though. |
I have the same issue using the selenium-standalone. Does anyone have a workaround to send value to the input until this issue will be resolved? |
This is unfortunate. Please reach out to their customer support as this error comes from Browserstack. WebdriverIO calls commands based on the definition of the WebDriver protocol. This wouldn't be the first time Browserstack deviates from this. |
@christian-bromann So did the WebDriver protocol change and you followed this change in v5? |
Without any logs this is impossible to say. |
Can't argue with that :) The error message I see in the BrowserStack logs: So for starters, just like OP, this seems to happen only in Edge (17 to be precise - haven't tested other versions however). Chrome 68 and FF 61 work fine. Safari fails completely to begin with. Anyway, the local console logs:
This is when I call
And again, in both cases it works fine in Chrome and FF. |
If you take a look into the WebDriver protocol you will see that the send keys to element command takes a payload with a text property that is a string. I ran this scenario on Sauce Labs and it seems that it is an Edgedriver issue, getting: java.lang.NullPointerException
at org.openqa.selenium.remote.server.handler.SendKeys.setJsonParameters(SendKeys.java:41)
at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:99)
at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:79)
at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:202)
at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:164)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537) This should be reported in the Edgedriver project. |
Yep, you're absolutely right. I'll submit an issue to those folks tomorrow and report back in this thread once I've got news. |
I found, that now with webdriver.io v5, Edge 17134,
That's as per https://w3c.github.io/webdriver/#dfn-element-send-keys But shouldn't that be as JWP? https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol#sessionsessionidelementidvalue e.g. with payload?
I tried with postman to send as |
The driver is behaving inconsistent here. It would be hard to make a workaround for edge for this command. @fkleuver did you raise an issue in the Edgedriver project? |
Hi @fkleuver I'm still facing the same issue, any update regarding that ? |
any updates on this issue? Still seeing the same behviour for Edge17 |
For me, I can able to enter the text using setValue() command in iOS, but the entered text is not visible in the text field. POST element/5032/value Command Request Body {"value":["A","d","d"," ","t","w","o"," ","w","i","t","h"," ","t","h","r","e","e"," ","i","s"," ","e","q","u","a","l"," ","t","o"],"text":"Add two with three is equal to"} {"status":0, "value":null, "sessionId":"c7870791-0c55-438f-9acc-b5e99037832d"} |
Apologies for not following up folks. When I was going to file an issue 3 months ago I ran into a wall with creating a repro for browserstack. We use the paid online version, and I just haven't had time to change everything up to make it work locally. If anyone else is willing to submit an issue with repro to the selenium repo that would be much appreciated, otherwise I will probably revisit in a month or 2 when more urgent backlog items in our project are finished. |
Is there any update? still experiencing the issue... |
I've just opened an issue ad developer.microsoft.com: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/22429136/ |
If you send the jsonwp protocol (elementSendKeys) directly for edge, it will work. sample code in typescript, you may need to override the existing typing. |
in my tests I am currently using
It would be really nice if I didn`t have to rewrite test code for specific Browsers, is there no other workaround? |
you can use a custom command like setInputValue() and then replace your element.setValue with setInputValue, that is workaround I can come up with. |
so why not adding the distinction here https://github.com/webdriverio/webdriverio/blob/master/packages/webdriverio/src/commands/element/addValue.js ? |
proposed solution leads to So why not change to JWP as mentioned above?
|
you will also need to define the right typing for elementSendKeys, (currently it is not right) in separate webdriver.d.ts file
|
you should add true flag in the command if you want to directly use with the element.
|
Thanks ruiquanwu by changing the typings I can actually set a Value in Edge on my local machine. whats your suggestions, should we create a PR in the WebDriver Repository? |
you can define a separate webdriver.d.ts file in your root directory with the above info, Yes, a PR would be better but I don't have the time to read the contribution documents. |
Sorry, newbie question here -- @ruiquanwu @stefancplace -- can you describe the root directory into which that webdriver.d.ts needs to go? Is it the same directory that wdio.conf.js lives in? I'm not clear on where to put it. Thanks. |
@YmerejRedienhcs I think in the project root directory will work. You may need to check type script typing definition for more details. |
Hi, this is still an issue for our team, has anyone been able to get Webdriver.io is an automated test lib. In Chrome and Safari I'm able to use either setValue or addValue using xpaths to fill in a text input and submit a form during automated tests. However in Edge/FireFox I cannot, these commands don't work. Looking around I found a work-around involving browser.execute workaround
How it's used:
Have any of you run into this issue before when using Webdriver to automate tests on FireFox or Edge? |
Yes, I'm getting error with setValue() function in Edge browser after wdio version 5 upgrade . The same syntax works in Chrome and IE perfectly. |
This is still an issue, does anyone have an update from the ticket that was opened at Microsoft? I see that @fkleuver opened a ticket a couple of months ago, but the link provided doesn't work |
I have same issue with Safari with same configuration. SetValue() not working. Please let me know any workaround or solution |
Edge WebdriverIO Issue
Environment (please complete the following information):
Config of WebdriverIO
Base Config
Edge Specific inherited config
Describe the bug
In Edge 16 on Browserstack, WebdriverIO throws errors and is unable to send keys with the .setValue() command. The value never gets set and the only stack trace shown in the console is
JSON format error: parameters object must contain pair with name "keysToSend"
this same exact code executes in the latest chrome no problem.To Reproduce
Steps to reproduce the behavior:
Make a barebones WDIO Test Runner app with BrowserStack services and specify edge and call the setValue() command on any field on any site to see this issue.
Expected behavior
setValue() command should clear input field and send keys like it does on Chrome and Firefox but for Edge.
Log
If applicable, add logs to help explain your problem.
https://gist.github.com/DanLambe/3e8857fd6b9aec5496eeff7fab098b6b
Additional context
This only started happening when I updated to the latest WDIO v5 project, not sure it this is a BrowserStack related issue or just implementation change that broke.
The text was updated successfully, but these errors were encountered: