History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WET-248
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Unassigned
Reporter: Alister Scott
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
WET

Can't get File Download Dialog to work with WET GEM 0.9.1.394

Created: 02/Oct/06 02:09 AM   Updated: 12/Jul/07 07:47 AM
Component/s: WET DOM Interface
Affects Version/s: 0.9.8 Final
Fix Version/s: 1.2

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: XP SP2


 Description  « Hide
I can't get WET to control a file dialog:

DEBUG: evaluating Browser("title:=/^View Note:.*/").Link("href:=/.*FileDownload.*/")
DEBUG: evaluating Browser("title:=/^View Note:.*/").Dialog("title:=File Download").Button("text:=Cancel")

The WET script freezes as though it can't find the dialog "File Download" to click the Cancel button.

For example, to reproduce on the web:

ie = Browser.new()
ie.goto("http://www.mozilla.com/firefox/")
ie = Browser("title:=/Firefox.*/")
ie.Link("text:=/.*Download Firefox.*/", "index:=1").click
ie.Dialog("title:=/File Download.*/").Button("text:=Cancel").click

 All   Comments   Work Log   Change History      Sort Order:
Raghu Venkataramana - 02/Oct/06 02:37 AM
The file dialog has often given problems. It works like a charm in certain cases, whereas doesn't work in other cases. When you hit the File Download, there are two dialogs that typically show up:

1) File Download dialog prompting the user to select whether to download, save or cancel
2) File Download dialog with information about the dialog itself.

It looks like there is a race condition here and depending on which dialog wins the race, test fails or passes.

Alister Scott - 24/May/07 01:04 AM
I am using GEM9.1.404 and this problem only occurs when I use the object repository to describe the elements.
For example,
This code works fine:

Repository("SC0031_ViewNote").check_exists()
ie = Browser("title:=/^View Note:.*/")
ie.Link("href:=/.*FileDownload.*/").click_without_blocking
dia = ie.Dialog("title:=/.*/")
but = dia.Button("index:=3")
but.click()

But this doesn't!!!!!

Repository("SC0031_File_Link").click_without_blocking
Repository("SC0031_FileDownload_Cancel_Button").click

Where the objects are described using XML as:

<Object Name="SC0031_ViewNote" Type="Browser">
    <Def Type="ParentObject">
      <Description>
        <title>/^View Note:.*/</title>
      </Description>
    </Def>
    <Object Name="SC0031_File_Link" Type="Link">
      <Def Type="ChildObject">
        <Description>
          <href>/.*FileDownload.*/</href>
        </Description>
      </Def>
    </Object>
    <Object Name="SC0031_FileDownload_Dialog" Type="Dialog">
      <Def Type="ChildObject">
        <Description>
          <title>/.*/</title>
        </Description>
      </Def>
      <Object Name="SC0031_FileDownload_Save_Button" Type="Button">
        <Def Type="ChildObject">
          <Description>
            <text>&amp;Save</text>
          </Description>
        </Def>
      </Object>
      <Object Name="SC0031_FileDownload_Cancel_Button" Type="Button">
        <Def Type="ChildObject">
          <Description>
            <index>3</index>
          </Description>
        </Def>
      </Object>
    </Object>

Raghu Venkataramana - 12/Jul/07 07:47 AM
Shruthi has investigated this issue and finds that WatirNativeObject layer of WET needs some changes. It is high risk to do this before 1.0 final.