Reformat the list of examples

This commit is contained in:
markm 2010-12-20 17:46:42 +09:00
parent 4805ede871
commit 16557200bf

@ -7,9 +7,9 @@ Once you have installed pywinauto - how do you get going?
Sit back and have a look at a little movie Sit back and have a look at a little movie
------------------------------------------- -------------------------------------------
Jeff Winkler has created a nice screencast of using pywinauto, you Jeff Winkler has created a nice screencast of using pywinauto, you
can see it at : can see it at :
http://showmedo.com/videos/video?name=UsingpyWinAutoToControlAWindowsApplication&fromSeriesID=7 http://showmedo.com/videos/video?name=UsingpyWinAutoToControlAWindowsApplication&fromSeriesID=7
@ -17,31 +17,24 @@ Look at the examples
-------------------- --------------------
The following examples are included: The following examples are included:
**Note**: Examples are language dependent - they will only work on the **Note**: Examples are language dependent - they will only work on the
language of product that they were programmed for. All examples have language of product that they were programmed for. All examples have
been programmed for English Software except where highlighted. been programmed for English Software except where highlighted.
``mspaint.py`` Control MSPaint - ``mspaint.py`` Control MSPaint
``notepad_fast.py`` Use fast timing settings to control Notepad - ``notepad_fast.py`` Use fast timing settings to control Notepad
``notepad_slow.py`` Use slow timing settings to control Notepad - ``notepad_slow.py`` Use slow timing settings to control Notepad
``notepad_item.py`` Use item rather then attribute access to control Notepad. - ``notepad_item.py`` Use item rather then attribute access to control Notepad.
- ``MiscExamples.py`` Show some exceptions and how to get control identifiers.
``MiscExamples.py`` Show some exceptions and how to get control identifiers. - ``SaveFromInternetExplorer.py`` Save a Web Page from Internet Explorer -
- ``SaveFromFirefox.py`` Save a Web Page from Firefox.
``SaveFromInternetExplorer.py`` Save a Web Page from Internet Explorer - ``get_winrar_info.py`` Example of how to do multilingual automation.
``SaveFromFirefox.py`` Save a Web Page from Firefox. This is not an ideal example (works on French, Czech and German WinRar)
- ``ForteAgentSample.py`` Example of dealing with a complex application that
``get_winrar_info.py`` Example of how to do multilingual automation. is quite dynamic and gives different dialogs often when starting.
This is not an ideal example (works on French, Czech and German WinRar) - ``windowmediaplayer.py`` Just another example - deals with check boxes in a
ListView.
``ForteAgentSample.py`` Example of dealing with a complex application that - ``test_sakura.py``, ``test_sakura2.py`` Two examples of automating a Japanase product.
is quite dynamic and gives different dialogs often when starting.
``windowmediaplayer.py`` Just another example - deals with check boxes in a
ListView.
``test_sakura.py`` Two examples of automating a Japanase product.
``test_sakura2.py``
Automate notepad at the command line Automate notepad at the command line
------------------------------------- -------------------------------------
@ -84,37 +77,36 @@ Please find below a sample run ::
(10) >>> app.Notepad.No.Click() (10) >>> app.Notepad.No.Click()
>>> >>>
1. Import the pywinauto.application module (usually the only module you need 1. Import the pywinauto.application module (usually the only module you need
to import directly) to import directly)
2. Create an Application instance. All access to the application is done 2. Create an Application instance. All access to the application is done
through this object. through this object.
3. We have created an Application instance in step 2 but we did not supply 3. We have created an Application instance in step 2 but we did not supply
any information on the Windows application it referred to. By using the any information on the Windows application it referred to. By using the
Start_() method we execute that application and connect it to the Start_() method we execute that application and connect it to the
Application instance app. Application instance app.
4. Draw a green rectangle around the Notepad dialog - so that we know we have 4. Draw a green rectangle around the Notepad dialog - so that we know we have
the correct window. the correct window.
5. Select the Replace item from the Edit Menu on the Notepad Dialog of the 5. Select the Replace item from the Edit Menu on the Notepad Dialog of the
application that app is connected to. application that app is connected to.
This action will make the Replace dialog appear. This action will make the Replace dialog appear.
6. Print the identifiers for the controls on the Replace dialog, for 6. Print the identifiers for the controls on the Replace dialog, for
example the 1st edit control on the Replace dialog can be referred to by example the 1st edit control on the Replace dialog can be referred to by
any of the following identifiers:: any of the following identifiers::
app.Replace.Edit app.Replace.Edit
app.Replace.Edit0 app.Replace.Edit0
app.Replace.Edit1 app.Replace.Edit1
app.FindwhatEdit app.FindwhatEdit
The last is the one that gives the user reading the script aftewards the The last is the one that gives the user reading the script aftewards the
best idea of what the script does. best idea of what the script does.
7. Close the Replace dialog. (In a script file it is safer to use CloseClick() 7. Close the Replace dialog. (In a script file it is safer to use CloseClick()
rather than Click() because CloseClick() waits a little longer to give windows rather than Click() because CloseClick() waits a little longer to give windows
time to close the dialog.) time to close the dialog.)
8. Let's type some text into the Notepad text area. Without the ``with_spaces`` 8. Let's type some text into the Notepad text area. Without the ``with_spaces``
argument spaces would not be typed. Please see documentation for SendKeys argument spaces would not be typed. Please see documentation for SendKeys
for this method as it is a thin wrapper around SendKeys. for this method as it is a thin wrapper around SendKeys.
9. Ask to exit Notepad 9. Ask to exit Notepad
10. We will be asked if we want to save - Click on the "No" button. 10. We will be asked if we want to save - Click on the "No" button.