I am trying to send a message as input to chatbot to check the response but when I am trying to send a message to a chatbot, I need to click on the input box where one can enter a message. But it is showing 'element not found error' (In the code I am throwing NoSuchElement exception) I think this is happening because of the driver not being able to switch control from the base webpage to the chatbot after we click on the chatbot.
Following is the snippet:
driver.find_element_by_xpath('/html/body/div/div').click()
time.sleep(2)
try:
driver.find_element_by_xpath('/html/body/div/div[3]/div[1]/div[1]/textarea').click().send_keys('hi')except NoSuchElementException:print('Input element not found')