I got that working with a small change in the main:
def main()
# Open google index page, and send a right click to the logo image
#~ br = Watir::IE.new()
#~ br.goto('http://www.tsa.gov/travelers/airtravel/prohibited/
permitted-prohibited-items.shtm')
#just because I kept running it over and over without closing the
browser...
br = Watir::IE.attach(:url, 'http://www.tsa.gov/travelers/airtravel/
prohibited/permitted-prohibited-items.shtm')
br.bring_to_front
br.link(:text, 'Click here').focus
br.link(:text, 'Click here').right_click
# Then, bring up the properties menu (works with IE6, at least)
br.send_keys("R")
#the number of 'downs' changed from IE6 to IE8, so I used the r which
opens the properties. This shows there is some versatility in it.
#~ br.send_keys("{DOWN}{DOWN}{DOWN}{DOWN}{ENTER}")
br.send_keys("R")
Dave
On Nov 21, 3:26 pm, Dave McNulla <[email protected]> wrote:
> LittlePaws
>
> If you stop execution at that command, what happens?
>
> As for the right click, I've never used that but I did find
> this:http://wiki.openqa.org/display/WTR/Right+Click+an+Element
> There are also some topics in this forum (put "right click" in the
> text box above and click "Search this group" button)
>
> Good luck,
>
> Dave
>
> On Nov 21, 7:22 am, LittlePaws <[email protected]> wrote:
>
>
>
>
>
>
>
> > I was able to open and browse the web in the main window.
> > Then, by clicking a link to popup window and find the link that I
> > wanted to click.
> > That particular link in the child window is directed to open an xls
> > file in a new popup.
>
> > When I excute
> > ie2.link(:text, "click this link to file").click
>
> > It clicks on it, but it moves on too quickly so it looks like either
> > it doesn't allow the next popup to start or it closes the popup
> > instantly before moving on to the next lines of code (in loop).
> > However, if I click on the link with my mouse, it opens just fine. I
> > can't understand why it behaves differently than clicking the mouse
> > manually. Any ideas?
>
> > Another workaround, I was hoping to get, is whether there is a way to
> > execute right-clicking and selecting the right-click menu using Watir.
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]