From: Brilly T. <bri...@ut...> - 2003-10-06 08:38:45
|
Hey Steven, To simulate user typing in a JTextComponent, you can just entry the information into the text field if you are using the recorder. Marathon only check the text on the component when it got a focus lost and see if there is any change. If there is, it'll record it. Keystroke is used to input special keys into the textfield. I use it for keystroke "enter" to trigger the default action of a form submission. You can also use keystroke to simulate entries with control keys like ctrl+C. The follow script is a demo that I ran marathon with the default demo application (can be run on command by: ant demo) from sampleappfixture import * def test(): window('Sample Dialog') #this modify the field select('textField', 'testing testing 123') click('Press Me') #this send a special key to the textfield component click('textField') keystroke('Enter') close() Cheers, Brilly s guy wrote: >I would like to simulate a user typing in a >JTextComponent. I tried the following script with the >demo that comes with marathon. > >------------------------------------------- > >from sampleappfixture import * > >def test(): > window('Sample Dialog') > select('textField', '') > keystroke('A') > assertText('textField', 'a') > close() > >------------------------------------------- > >Should this work? From the documentation, I would >expect keystroke() to forward keyEvents to the >textfield. Is there something I'm missing? > >thanks, >steven > >__________________________________ >Do you Yahoo!? >The New Yahoo! Shopping - with improved product search >http://shopping.yahoo.com > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Marathonman-devel mailing list >Mar...@li... >https://lists.sourceforge.net/lists/listinfo/marathonman-devel > > |