Having trouble preserving the text stored within a table cell using Javascript alongside Selenium webdriver

My table consists of cells that users can edit by clicking on them, with the entered values saved in the database. However, when attempting to use the 'sendKeys' method to enter text in these cells, I encounter difficulties. After trying the 'executeScript' method and modifying the 'innerHTML' content of the cell, I am able to see the expected text being written within the cell. Unfortunately, this data is not actually being saved in the database.

WebElement w ;
fw.executeScript("arguments[0].innerHTML='55'",
                w)

I need assistance in identifying what might be the issue with this approach.

Answer №1

Since I am unable to add a comment at this time, I will provide an "answer" in the form of a question:

Are you the developer of this website? What triggers the data to be input into the table, such as tabbing out, clicking on another element, pressing a key, etc?

If the data is being saved due to a key press event, you can utilize code similar to the following:

selenium.keyPress("id=textbox", "\\119"); // by pressing "w"

For more information on ASCII key codes, visit:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using jQuery to Toggle the Height of Multiple Sections with a Single Function

I've got three different sections, each with varying heights and a simple structure like this: <section> <h2>My heading</h2> </section> What I want is for these sections to display at first, but then shrink dow ...

Utilizing pre-existing entities in ManyToMany/ManyToOne relationships through automation within JPA

When working with JPA and Hibernate, the focus is on retrieving and persisting entities. An interesting scenario arises when dealing with a User table that references a Country stored in another table. Imagine wanting to add a new user to the User table, ...

Tips for refreshing the table data following the deletion of a record within an AJAX success function

Here is the code I'm currently dealing with: While my overall code is functioning properly, I am encountering an issue with the success function of my Ajax. Specifically, I am trying to display the updated record after deleting a row without needing ...

Is Safari compatible with Selenium WebDriver?

Currently implementing Selenium WebDriver in conjunction with Java and interested in utilizing the Safari browser. Can Selenium WebDriver effectively work with Safari? ...

Trouble getting Fontawesome icons to accept color props when using react functional components with tailwindcss

Issue I'm Facing I'm currently working on a project that involves using icons extensively. Instead of manually adding a Fontawesome icon in every script, I have created a functional component that handles the rendering of icons based on given pr ...

Redux application is not functioning properly

I followed the official documentation to create a Redux app at http://redux.js.org/docs/basics/ but it's not working as expected. I have organized my code into four files: store, reducers, actions, and build. actions.js: export const ADD_TODO = &apo ...

Instead of uploading multiple files at once, allow users to upload individual files by clicking on the table row

In my dynamic table, there are 4 columns. The first 3 columns in each row have an input type='file' where users can choose a file to upload, and the 4th column has a submit button aligned with the rows. While submitting files in the first row wor ...

tips on customizing buttons within form groups

I have set up two separate form-groups: My goal is to click on each button within each group and toggle its style from grey to green, and vice versa. However, when I click on a button, all buttons within the group turn grey except for the one that was cli ...

To dismiss the pop-up, simply tap on any part of the screen

Is there a way to programmatically close a pop-up by simulating a click on the body of a webpage? I'm attempting to automate the process of closing multiple pop-ups that may appear on some pages with just one click. I've tried locating and clicki ...

Having difficulty configuring the chromedriver path on my Ubuntu system

Currently in my program, I have the following code to set the path for the Chrome driver: System.setProperty("webdriver.chrome.driver", "\usr\lib\chromedriver.exe"); However, upon running the program, an error is being thrown: The drive ...

Delete an entry from the list

I have a fully functional Ajax call and function that fills up a datalist. This datalist is utilized to choose from a limited list and add it to a UL element on the page. Once an option is added from the datalist to the actual list, I aim to eliminate that ...

Python test automation with randomized data

I have set up a browser testing framework using unittest and Selenium for automation. I am looking to create a test that can be executed multiple times, where a user generates a ticket with a random title each time. The format I am aiming for is "Test tic ...

Unable to save session cookie in browser when accessing server from different domain

I am encountering an issue with the browser not saving the session cookie sent from my server. The client web app is hosted on Vercel, while the server app is hosted on Heroku. I utilize passport for signing in, and upon successful authentication, a sessio ...

Retrieving the sibling element above using JavaScript / jQuery

Within this section of the DOM, there are various elements representing users. <div class="users-layer"> <div class="ct-user" id="ctUser1"></div> <div class="ct-user" id="ctUser7"></div> <div class="ct-user" id ...

I am a novice at C-sharp and currently in the process of mastering how to write basic instructions for programming

https://i.sstatic.net/Lmp92.jpg This is the guidance and error notification that was delivered to me. I attempted to input a sentence containing two spaces just now. ...

Ways to incorporate encoded HTML text into string literals

When attempting to insert a HTML encoded special character within a string literal, I am encountering an issue where it does not display as intended in the final document. The approach I am taking is as follows: const head = { title: `${ApplicationName} ...

I am currently studying react.js and struggling to comprehend how the deployment process for a react app functions

Will the server only serve the index.html file or is there a way for the client to run that html file as it's not a regular html file? Do I need a backend node to make it work? I'm having trouble understanding the entire process. Normally, a cli ...

Updating the value of each preceding sibling of every checked checkbox using jQuery upon form submission

After extensive research, I discovered that the most effective approach involves using a clever workaround to capture every tick and untick on a dynamic input row with multiple checkbox arrays. However, none of the solutions provided a viable method. I th ...

What could be causing my GET route to return an empty array?

I've been attempting to retrieve an event by its id, but for some reason, I'm receiving an empty array as a result in Postman. Below is the code snippet of my route: import { events } from '../../../db.json'; const handler = async (re ...

Update Jquery Dialog's Button After Making an Ajax Request

I am facing an issue with my dialog window that contains some confirmation elements following a form submission: $('#newUserDialog').dialog({ autoOpen: false, width: 600, modal: true, resizable: false, cl ...