In selenium I want to enter some text into the tinymce text area, but I'm having trouble clearing the textarea before putting in my text.
The clear function that usually work well to remove preexisting texts in a "normal" input area dosn't seem to work for a tinymce textarea
If you show your current attempts it would be possible to fix them. Have you inspected the page's source code to make sure you're in the right frame and selecting the right element?
Generally speaking you can clear a textbox/textarea/whatnot by seleniums clear() function, like this:
1. driver.find_element_by_id("id of textbox").clear()
or 2. driver.find_element_by_css_selector("#...").clear()
If this does not work the error message generated will normally be a useful indicator at what's wrong.
If you however are sure you're really selecting the right element of the page, you might be doing the common mistake of trying to select something lying inside an iframe, without first having switched to this iframe.
This is done by:
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!Donate Us With