Click on button not taking input from text field?
See original GitHub issueIām entering information into a text field then trying to click a button to enter the information, using
const result = await Runtime.evaluate({
expression: 'new Promise((resolve) => {document.getElementById("name-field").value = "name"})',
awaitPromise: true
});
result = await Runtime.evaluate({
expression: 'new Promise((resolve) => {document.getElementsByClassName("submitButton")[0].click()})',
awaitPromise: true
});
And after I click the button the input fields either havenāt loaded or are wiped outā¦? (I know this works in the UI Iām pointing it out). So my thought was that I needed to do something to wait until the input is done, but I thought thatās what the ānew Promiseā¦awaitPromiseā was doing?
If I print a screenshot before I click the button the input is there, and if I print a screenshot after I click it itās no longer there (the form entry fails because itās empty).
Also, neither āresultā yields an error.
Component | Version |
---|---|
Operating system | Ubuntu 18.04.3 LTS |
Node.js | 12.12.0 |
Chrome/Chromium/⦠| 78.0.3904.108 |
chrome-remote-interface | 0.28.0 |
Is Chrome running in a container? NO
P.S. Thank you for this wonderful tool! Itās been awesome to work with š
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
Enable the input text field on clicking of a button - Stack Overflow
The issue is with the disabled property that you have added to your input tags, alreadySetVal1 and alreadySetVal2 .
Read more >HTMLElement.focus() - Web APIs | MDN
Select the button to set focus on the text field. Focus on a button. This example demonstrates how you can set the focus...
Read more >How to put a responsive clear button inside HTML input text field
The responsive button inside an input field will clear the text area on the click event. In this article, we will discuss how...
Read more >How to Get an Input Value on Button Click in React
We set an onChange event handler on the input field to make this handler get called whenever the input value changes. In the...
Read more >How To Trigger Button Click on Enter - W3Schools
Get the input field var input = document.getElementById("myInput"); // Execute a function when the user presses a key on the keyboard input.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
YESSSSS!! That works!! OwO Thank you!! š
I was missing the āawaitā on the focus š¤¦āā Sorry about that. Thanks again!!