My attempt to input the number 1 into the MasterPack boxes in this table is met with an error indicating that it is not interactable. https://i.sstatic.net/J79p6.png
I encountered the "element not interactable" error while using the following code:
driver.find_element_by_xpath('//*[@id="asnPick_order_0_itemInfo_TABLE"]/div[1]/div/div/div/table/tbody/tr[1]/td[8]')
.send_keys("1")
The table's HTML shows that I am targeting the MasterPack cell, which is blank and lacks any attributes. The other cells' text is not attribute-based but simply nested within the tags.
<tr><td class="">0001</td>
<td class="">1022-0221-00</td>
... (remaining HTML content)
Although clicking on the MasterPack box seems successful, sending keys triggers the interactability issue. Is there a way to edit the numbers in untagged cells like these without encountering errors?
Additional investigation led me to uncover a temporary workaround:
driver.find_element_by_xpath('//*[@id="asnPick_order_0_itemInfo_TABLE"]/div[1]/div/div/div/table/tbody/tr[1]/td[8]').click()
element = WebDriverWait(driver, 10).until(
EC.element_to_be_clickable((By.XPATH, "//table[@class='htCore']//tbody/tr//td[contains(@class, 'highlight')]")))
driver.execute_script('arguments[0].innerHTML = "1"', element)
While this successfully inputs the number one, it disappears upon saving the page. It appears that only the visual aspect of the form is being altered, resulting in a transient change. Any suggestions on how to make this change permanent or securely modify/send keys to the HTML? Thank you.
Here is the HTML snippet after adding the number 1:
<td class="current highlight">1</td>