element not interactable exception in selenium web driver using xpath option

Viewed 23

In the below code I cannot click the send button in the WhatsApp attachment window, First Two Works are happening Perfectly but the last work not done it return the error: Failed to send message to 95******3Message: element not interactable (Session info: chrome=95.0.4638.69) here I attached the images for reference kindly help me to get it out.

code

try:
    url = 'https://web.whatsapp.com/send?phone=+91' + number  
    driver.get(url)
    #time for loding
    sleep(5)

    #adding media
    
    attachment_box = driver.find_element_by_xpath('//div[@title = "Attach"]')
    
    attachment_box.click()
    image_box = driver.find_element_by_xpath('//input[@accept="image/*,video/mp4,video/3gpp,video/quicktime"]')
    
    image_box.send_keys(filepath)
    sleep(2)
    
    
    
    send_button = driver.find_element_by_xpath('//span[@data-icon="send"]')
    send_button.click()
    

error message

Failed to send message to 95******3Message: element not interactable (Session info: chrome=95.0.4638.69)

Xpath

span data-test-id="send" data-icon="send" class ==$0

0 Answers
Related