【发布时间】:2012-12-11 19:44:47
【问题描述】:
我想测试一封电子邮件的正文。
它使用 3 个 i 帧深度的 FCK 编辑器。
<...name="fancybox-frame"...>
<iframe>
<iframe>
<body>H E R E I S W H A T I W A N T T O A C C E S S</body>
</iframe>
</iframe>
</[fancybox-frame]>
除了模棱两可的乐趣,我如何多次使用帧内。
如果我用这个...
within_frame('fancybox-frame') do
fill_in('frm_subject', :with => eventname + ' email')
within_frame('iframe[id="frm_message___Frame"]') do
within_frame('iframe') do
fill_in('body', :with => 'Event email for ' + now.to_s)
end
end
结束
我明白了……
switchFrame execution failed;
INVALID_EXPRESSION_ERR: DOM XPath Exception 51 (Selenium::WebDriver::Erro
r::WebDriverError)
./features/step_definitions/RCST08_steps.rb:96:in `block (2 levels) in <to
p (required)>'
./features/step_definitions/RCST08_steps.rb:94:in `/^select a message to s
end\.$/'
features\RCST08.feature:26:in `And select a message to send.'
有什么想法吗?
【问题讨论】:
-
你有嵌套 2 度深的 iframe id 吗?如果是,则切换到它,然后执行您的操作
标签: html ruby selenium cucumber capybara