[Wtr-general] Unable to select the button from button-menu
Charley Baker
charley.baker at gmail.com
Fri Mar 23 11:41:10 EDT 2007
It looks like a frame access error. There's a workaround in the latest code
in svn. Follow the instructions for Installing a gem from source on the FAQ
page and try it again.
http://wiki.openqa.org/display/WTR/FAQ#FAQ-devgem
-Charley
On 3/23/07, Mathew Jacob <mathewjk at yahoo-inc.com> wrote:
>
> Hi,
>
>
>
> I installed latest gem and run the script. But I am getting following
> error in Run-time.
>
>
>
>
>
> *** WARNING *** Windows users should check the "Run process in terminal"
> check box in the Debugger Preferences
>
> to see STDOUT and STDERR output in real time.
>
>
>
> c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1830:in
> `method_missing': document (WIN32OLERuntimeError)
>
> OLE error code:80070005 in <Unknown>
>
> Access is denied.
>
>
>
> HRESULT error code:0x80020009
>
> Exception occurred. from c:/ruby/lib/ruby/gems/1.8/gems/watir-
> 1.5.1.1158/./watir.rb:1830:in `wait'
>
> from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:1829:in
> `wait'
>
> from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./watir.rb:2577:in
> `click'
>
> from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1158/./MongoFnDef.rb:39:in
> `login'
>
> from C:/watir/MongoMain.rb:23
>
>
>
>
>
> Thanks in advance,
>
>
>
> Mathew
>
>
>
>
>
> *From:* wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org]
> *On Behalf Of *Angrez Singh
> *Sent:* Friday, March 23, 2007 11:06 AM
> *To:* wtr-general at rubyforge.org
> *Subject:* Re: [Wtr-general] Unable to select the button from button-menu
>
>
>
> Hi Mathew,
>
> Just looked at the Yahoo mail app (not the beta one) and had a look at the
> HTML. The options that you are trying to select like "Mark as Read", "Mark
> as Unread" are in <li> tags. So you need to access them using xpath and then
> fire click event. Following code works for me for marking first message in
> inbox are read.
> require 'watir'
>
> include Watir
>
> ie = IE.new
> ie.goto("http://mail.yahoo.com")
> ie.maximize()
> ie.text_field(:name, "login").set(username)
> ie.text_field(:name, "passwd").set(password)
> ie.button(:value, "Sign In").click()
> ie.button(:id, "checkmailbutton").click()
> # select first message.
> ie.radio(:id, "folderviewmsg0checkbox").set()
> # click on mark button so as options can be displayed
> ie.button(:value, "Mark").click()
> # select <li> element that has text "Mark as Read"
> element = ie.element_by_xpath("//li[contains(.,'Mark as Read')]")
> # Print properties of the element just to make sure you selected correct
> element.
> puts element.value
> puts element.tagName
> puts element.innerHTML
> # fire click event.
> element.click()
>
> Let me know if this works.
>
> Regards,
> Angrez
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20070323/7af4486d/attachment.html
More information about the Wtr-general
mailing list