Re: [Pywinauto-users] RE: What's the user experience with pywinauto? (LONG)
Status: Alpha
Brought to you by:
mcmahon_m
From: <gil...@ea...> - 2006-02-14 16:45:33
|
Hello all. I hope you don't grow too weary of my ignorance here, but I just haven't quite gotten my mind around things yet. I tried the following: 1) from pywinauto.application import Application 2) app = Application().start_(r"C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.google.com") 3) wndw = app.window_(title_re = r"http://www.google.com") 4) wndw.MenuSelect("File->New->Window") 5) app.SaveWebPage.Edit1.TypeKeys("YourFileName.html") 6) app.SaveWebPage.Save.Click() which generated the following error: raise MatchError(items = text_item_map.keys(), tofind = search_text) pywinauto.findbestmatch.MatchError: Could not find 'File' in '[]' If I change line 3 to: wndw = app.window_(title_re = r"C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.google.com") I receive the following error message: raise WindowNotFoundError() pywinauto.findwindows.WindowNotFoundError The web page comes up beautifully, just can't seem to grab the menu yet. I think I need to keep 'title_re' in line 3(?), otherwise I receive the following error: TypeError: window_() takes exactly 1 argument (2 given) I have tried a few other combinations, but no luck yet. I appreciate your help very much and hope you're not getting too frustrated!!! Once things click, they click, but I think I just need another re-direct. Thank you and Best Regards, gil_c > [Original Message] > From: Mark Mc Mahon <mar...@gm...> > To: <gil...@ea...> > Cc: <pyw...@li...> > Date: 2/12/2006 11:04:19 AM > Subject: Re: [Pywinauto-users] RE: What's the user experience with pywinauto? (LONG) > > Hi gil_c, > > > On 2/12/06, gil...@ea... <gil...@ea...> wrote: > > Thank you Mark, > > > > Your question about Python versions joggled my memory. I have two things > > working against me...I'm self-taught and I'm a newbie...I am using Python > > 2.4.2, but I still have 2.3.4 (I have a prototype app using MaxDB--which > > doesn't yet have 2.4.2 adapter). I just installed 2.4.2, so I still > > sometimes forget to run things with the newer version for the newer > > directory. I re-ran the install in 2.4.2 WITH 2.4.2 and it byte compiled > > just fine!!! > > > > Sorry to cause alarm!!! I'm excited to try your application out. > > Glad you got it working - though I should look at removing the > requirement on Python 2.4 (I hadn' t checked it previuosly - but I am > using some decorators - so that at least causes it) > > > > > Incidently, I am trying to automate my logons to the web and then invoke > > 'SaveAs: Web Page, complete' to save specific pages I pull up to a local > > drive, automagically. Does pywinauto support the invocation of dialog > > menus in this way? Regardless, this is important work and I'm sure I will > > derive much use from pywinauto, but I was just curious. > > I think that pywinauto should work fine for that, for example you > could have something like: > app = Application().connect_(title_re = ".*Microsoft Internet Explorer") > ie_wnd = app.window_(title_re = ".*Microsoft Internet Explorer") > ie_wnd.MenuSelect("File->Save As") > app.SaveWebPage.Edit1.TypeKeys("YourFileName.html") #1 > app.SaveWebPage.Save.Click() > > #1 - not sure if edit1 will actually get the right field, the next > release of pywinauto should allow you to type > app.SaveWebPage.FilenameEdit.TypeKeys("blah blah") > rather than > app.SaveWebPage.Edit1.Typekeys("blah blah") > > > > > Thank you and best regards, > > > > gil_c > > > > Thank you, > Mark > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmdªk&kid3432&bid#0486&dat1642 > _______________________________________________ > Pywinauto-users mailing list > Pyw...@li... > https://lists.sourceforge.net/lists/listinfo/pywinauto-users |