Having trouble cleaning tinymce textarea with selenium

In selenium, I want to enter text in the tinymce text area, but I had problems clearing the text field before pasting the text.

A clear function that usually works well to remove existing texts in the "normal" dosn't seems to work for the tinymce text area

+4
source share
1 answer

If you show your current attempts, they can be fixed. Have you checked the source code of the page to make sure that you are in the correct frame and select the correct element?

Generally speaking, you can clear the textbox / textarea / whatnot function from seleniums clear (), for example:

1. driver.find_element_by_id("id of textbox").clear()

or 2. driver.find_element_by_css_selector("#...").clear()

etc etc

, , .

, , , , , -, iframe, iframe.

:

driver.switch_to_frame("frame name") #switch to the iframe

#do what you want to do inside the iframe. for example: 
driver.find_element_by_id("textbox id").clear() #clear the textbox
#write something to the textbox

driver.switch_to_default_content() #switch back from the iframe when you're done
+7

All Articles