tags:

views:

17

answers:

1

Hi All,

I am trying to automate installation of an application using Pywinauto.During the installation the last window shows some warning or error messages in few cases and later the system begins to restart.My objective is to capture the the Warning messages which is possible by

app.top_window_()._ctrl_identifiers() np.Notepad.Edit.TypeKeys(a,with_spaces=True, with_tabs=True, with_newlines=True)

This is returning a list which contains all the messages of the screen. Second line is where i am trying to print the list object in the notepad.But its throwing some exceptions

Traceback (most recent call last): File "", line 1, in np.Notepad.Edit.TypeKeys(a,with_spaces=True, with_tabs=True, with_newlines=True) File "C:\Python26\pywinauto\controls\HwndWrapper.py", line 950, in TypeKeys turn_off_numlock) File "C:\Python26\pywinauto\SendKeysCtypes.py", line 629, in SendKeys keys = parse_keys(keys, with_spaces, with_tabs, with_newlines) File "C:\Python26\pywinauto\SendKeysCtypes.py", line 538, in parse_keys c = string[index] KeyError: 0

Could anyone let me know how to do this or if there is other way in which this can be handled with an example.

Thanks a lot in advance. Swetha

A: 

Reformatting::

code

app.top_window_()._ctrl_identifiers()  # did you mean print_control_identifiers() ?
np.Notepad.Edit.TypeKeys(a,with_spaces=True, with_tabs=True, with_newlines=True)

Traceback

Traceback (most recent call last): 
File "", line 1, in 
    np.Notepad.Edit.TypeKeys(a,with_spaces=True, with_tabs=True, with_newlines=True) 
File "C:\Python26\pywinauto\controls\HwndWrapper.py", line 950, in TypeKeys 
    turn_off_numlock) 
File "C:\Python26\pywinauto\SendKeysCtypes.py", line 629, in SendKeys 
    keys = parse_keys(keys, with_spaces, with_tabs, with_newlines) 
File "C:\Python26\pywinauto\SendKeysCtypes.py", line 538, in parse_keys 
    c = string[index] KeyError: 0

You don't explain what a contains on the 2nd line, but it would appear you are passing a dictionary and not a string. SendKeys() expects a string.

Hope that helps

markm