i'm using selenium 2.46.0 and python 3.4 I want to put the string "Hello, world!" into the textfield for creating new letter. Am i doing this the right way? I try to switch the frame and find the right element to put the text into it. My code:
from selenium import webdriver
browser = webdriver.Firefox()
browser.get('https://mail.ru/')
browser.find_element_by_name('Login').clear()
browser.find_element_by_name('Login').send_keys('selenium90')
browser.find_element_by_name('Password').clear()
browser.find_element_by_name('Password').send_keys('pythonrocks')
browser.find_element_by_id('mailbox__auth__button').click()
browser.find_element_by_css_selector('a.b-toolbar__btn').click()
browser.find_element_by_css_selector('textarea.js-input:nth-child(5)').send_keys('07ufo@mail.ru')
browser.switch_to_frame(browser.find_element_by_id('compose_462_composeEditor_ifr'))
browser.find_element_by_class_name('mceContentBody').send_keys('Hello, world!')
selenium.common.exceptions.NoSuchElement Exception: Message: Unable to locate element: {"method":"id","selector":"compose_462_composeEditor_ifr"}
I tried:
iframe = browser.find_elements_by_tag_name('iframe')[frameindex]
browser.switch_to_frame(iframe)
browser.find_element_by_css_selector('body.tinymce').send_keys('hoo')
But it did not help
i added a screenshot of tree: