I am really stuck now. I have an iframe in which there is a < p> tag where I want to send some text, but I am just not able to do it.
HTML:
<iframe id="edit-field-verdict-0-value_ifr" frameborder="0" src="javascript:""" style="width: 100%; height: 100px;">
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head xmlns="http://www.w3.org/1999/xhtml">
<body id="tinymce" class="mceContentBody " spellcheck="false" dir="ltr">
<p>
<br mce_bogus="1">
</p>
</body>
</html>
</iframe>
The code that i have tried is :
@browser.elements(:xpath => '//*[@id="tinymce"]').p.send_keys [:control, 'a']
The error that I am getting is:
undefined method `elements' for #<String:0x24ba570> (NoMethodError)
I also tried
$browser.frame(:id,'edit-field-verdict-0-value_ifr').html.body(:id,'tinymce').p.send_keys [:control, 'a']
But as the body is not recognized by Watir, I tried elements_by_xpath as well. It didn't work.
How can I make this thing work?