| || |
Window close options when window name changes
I've written a script that works with MS Excel to process some data. After processing it saves the resultant file with a unique filename. The script is then supposed to close this Excel window with the new filename, and process another Excel file, where it subsequently creates a NEW filename.
How can I create a script that closes the Excel file each time, even though each one has a unique filename?? It will process through about 70 files.
I understand I can use wildcards in the Object Map for the Title, but not for the Object Name on the General tab. Does this mean I have to create an Object Map separately for each filename that will be created?? Thanks in advance for any help.
Re: Window close options when window name changes
Here's an example that may help:
Assume that you're working with Notepad. The default text for the Notepad window is "Untitled - Notepad" when Notepad is started. Therefore the resulting QARun object map entry for that window is going to be named "Untitled - Notepad MainWindow" when you learn against it. This name is automatically created by taking the window's Title and Type.
Going into the Object Map entry, you'll see that Title is significant and that the Title of this window is "Untitled - Notepad". Going back to Notepad, save the document with your name... After saving you'll note that the Title changes. For my name, that means the title now is "Jim - Notepad". So... that means that the previous object map entry whose TItle Significant Field is: "Untitled - Notepad" isn't going to replay anymore.
Now go back into the Object Map and change the information in the Title/4GL field to: * - Notepad MainWindow
Now that object map entry will handle any Notepad document: Jim - Notepad, Bill - Notepad, Untitled - Notepad, etc.
However, note that when you learn, you still learn with the auto-created attach name:
Attach "Untitled - Notepad MainWindow"
... but remember that's just the _name_ of the object map entry. Within it, it is wildcarded to accept all data that precedes " - Notepad".
Once you get used to dealing with this, you can eliminate the confusion between the object map name and its data by manually create an object map entry, wildcarding it, and naming it something more generic, like "Notepad MainWindow". Note that setting the Object Map creation characteristics from Auto-Create to Prompt will give you the opportunity to name each entry yourself as you learn them.
QACenter Software Developer