How to write code to get focuse the application which is open from server

vithi vithi99 at hotmail.com
Mon Jan 15 13:53:26 EST 2007


Dennis,
I am sorry that was a typing error. I try like that
app.Print.OK.Click() but it was not working. The printer window was not
IdentifiedIs their any method I can use to achive the same goal. How
the window title was used as class name?. Could you please help me to
solve this problem.
thanks
this is the error meassage

Traceback (most recent call last):
  File "C:\Python24\test1.py", line 10, in -toplevel-
    app.Print.Ok.CloseClick()
  File "c:\python24\pywinauto\pywinauto\application.py", line 237, in
__getattr__
    ctrls = _resolve_control(
  File "c:\python24\pywinauto\pywinauto\application.py", line 854, in
_resolve_control
    ctrl = _get_ctrl(criteria)
  File "c:\python24\pywinauto\pywinauto\application.py", line 622, in
_get_ctrl
    dialog = controls.WrapHandle(
  File "c:\python24\pywinauto\pywinauto\findwindows.py", line 62, in
find_window
    windows = find_windows(**kwargs)
  File "c:\python24\pywinauto\pywinauto\findwindows.py", line 177, in
find_windows
    windows = findbestmatch.find_best_control_matches(
  File "c:\python24\pywinauto\pywinauto\findbestmatch.py", line 483, in
find_best_control_matches
    raise MatchError(items = name_control_map.keys(), tofind =
search_text)
MatchError: Could not find 'Print' in '['', u'Transparent Windows
Client0', u'Transparent Windows Client2', u'Transparent Windows
Client1', u'Print - \\\\Remote', u'Transparent Windows Client', u'Print
- \\\\RemoteTransparent Windows Client']'

This is the code
import sys
import time
import application
app = application.Application()
qi=app.window_(title_re = ".*ArcView.*")
time.sleep(2)
qi.TypeKeys("%FP")
time.sleep(2)

app.Print.Ok.CloseClick()


Dennis Lee Bieber wrote:
> On 14 Jan 2007 21:11:35 -0800, "vithi" <vithi99 at hotmail.com> declaimed
> the following in comp.lang.python:
>
> >
> > my code goes like that
>
> 	"goes like"?  Don't type similarities from memory -- cut&paste the
> actual code (or, preferably, a stripped down version that you've
> actually run) that shows the behavior in question.
>
> > app=application.Application()
> > qi = app.window_(title_re = ".*arcMap.*")
> > qi.TypeKeys("%FP")
> > app,Print.OK.Click()
> >
> 	And what is that last line supposed to be doing. "app,anything" is
> two separate objects: an application object, and something called Print
> with an attribute called OK which itself has a method called Click
>
> 	I suspect, at a minimum, that last line is supposed to be
> 
> app.Print.OK.Click()
>    ^	period, not




More information about the Python-list mailing list