1

Unable to interact with quantity selector on the product page but its never working on the checkout page.

Used the code below which shows me if the element is being detected and its always showing false.

  print("Element is visible? " + str(quantity_checkout.is_displayed()))

This is the error that I am receiving:

selenium.common.exceptions.ElementNotInteractableException: Message: element not 
 interactable (Session info: chrome=88.0.4324.150)

Below is my entire code

print(web_link)

PATH = "C:\Program Files (x86)\chromedriver.exe"
driver = webdriver.Chrome(PATH)

driver.get(web_link)

# Facebook Share button working
# submit_button = driver.find_element_by_xpath('//a[@title="Share on Facebook"]')

# print("Element is visible? " + str(quantity.is_displayed()))

# Change Quantity
quantity = driver.find_element_by_xpath('//input[@id="quantity"]')
quantity.clear()
time.sleep(1)
quantity.send_keys('5')
time.sleep(1)

# Add to cart
add_to_cart = driver.find_element_by_xpath('//button[@data-label="Add to Cart"]')
add_to_cart.click()
time.sleep(5)

quantity_checkout = driver.find_element_by_xpath('//input[@id="updates_10389617349"]')
print("Element is visible? " + str(quantity_checkout.is_displayed()))
quantity_checkout.clear()
time.sleep(1)
quantity_checkout.send_keys('10')
time.sleep(3)

checkout = driver.find_element_by_xpath('//button[@class="action_button add_to_cart bold_clone"]')
checkout.click()
time.sleep(2)
driver.find_element_by_xpath('//a[@id="bold-modal__btn-close"]').click()
time.sleep(4)

driver.quit()
Atul KS
  • 908
  • 11
  • 21
Amr
  • 11
  • 2
  • Maybe the element takes time to load. Have you tried explicit wait? For further help, you can give the link – Rohalt Feb 17 '21 at 21:17
  • Yea I tried setting the timer even for a whole minute, but the code I posted is timing that I am looking for. Plus its not this website I have tried multiple its seems to be a thing with shopify checkout pages – Amr Feb 17 '21 at 21:21
  • and the weblibk address – PDHide Feb 17 '21 at 21:25
  • Strongly advise you to go through the similar questions on SO. https://stackoverflow.com/questions/44119081/how-do-you-fix-the-element-not-interactable-exception https://stackoverflow.com/questions/56119289/element-not-interactable-selenium https://stackoverflow.com/questions/56194094/how-to-fix-this-issue-element-not-interactable-selenium-python https://stackoverflow.com/questions/43868009/how-to-resolve-elementnotinteractableexception-element-is-not-visible-in-seleni – Atul KS Feb 17 '21 at 21:54

0 Answers0