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
-------------------------------------------
Jeff Winkler has created a nice screencast of using pywinauto, you
can see it at :
Jeff Winkler has created a nice screencast of using pywinauto, you
can see it at :
http://showmedo.com/videos/video?name=UsingpyWinAutoToControlAWindowsApplication&fromSeriesID=7
@ -17,31 +17,24 @@ Look at the examples
--------------------
The following examples are included:
**Note**: Examples are language dependent - they will only work on the
language of product that they were programmed for. All examples have
**Note**: Examples are language dependent - they will only work on the
language of product that they were programmed for. All examples have
been programmed for English Software except where highlighted.
``mspaint.py`` Control MSPaint
``notepad_fast.py`` Use fast 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.
``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.
``get_winrar_info.py`` Example of how to do multilingual automation.
This is not an ideal example (works on French, Czech and German WinRar)
``ForteAgentSample.py`` Example of dealing with a complex application that
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``
- ``mspaint.py`` Control MSPaint
- ``notepad_fast.py`` Use fast 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.
- ``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.
- ``get_winrar_info.py`` Example of how to do multilingual automation.
This is not an ideal example (works on French, Czech and German WinRar)
- ``ForteAgentSample.py`` Example of dealing with a complex application that
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``, ``test_sakura2.py`` Two examples of automating a Japanase product.
Automate notepad at the command line
-------------------------------------
@ -84,37 +77,36 @@ Please find below a sample run ::
(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)
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.
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
Start_() method we execute that application and connect it to the
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
Start_() method we execute that application and connect it to the
Application instance app.
4. Draw a green rectangle around the Notepad dialog - so that we know we have
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.
This action will make the Replace dialog appear.
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
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
any of the following identifiers::
app.Replace.Edit
app.Replace.Edit0
app.Replace.Edit1
app.FindwhatEdit
The last is the one that gives the user reading the script aftewards the
best idea of what the script does.
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
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
for this method as it is a thin wrapper around SendKeys.
9. Ask to exit Notepad
10. We will be asked if we want to save - Click on the "No" button.