Selection in text field not captured in recording

WindowTester allows you to easily create and run unit tests for every GUI they build. It can also be used to generate system level tests.

Moderators: gnebling, Eric Clayberg, Dan Rubel, keertip, Phil Quitslund

Selection in text field not captured in recording

Postby jluebker » Mon Jul 06, 2009 7:17 am

Hello,

I am attempting to create a test where I replace some default text in a text field. I recorded the actions and then ran the created test. The selection of the text was not recorded. Is there any plans to add this and what is the recommended work around? In this instance the default text was "1" and I want to change it to be "2". Instead of "2" I wound up with "12" when the test was ran due to a click that resulted in the cursor being placed after the 1 and the 1 not being selected. A snippet of the test is below.

<...>
ui.click(new CTabItemLocator("Breakpoints"));
ui.contextClick(new TreeItemLocator("demo.c, line: 480", new ViewLocator("org.eclipse.debug.ui.BreakpointView")), "Breakpoint Properties...");
ui.wait(new ShellShowingCondition("Properties for demo.c:480"));
ui.click(new ButtonLocator("Hit Count:"));
ui.click(new XYLocator(new LabeledTextLocator(
"A breakpoint is hit when it is reached and the condition (if enabled) is true. The hit count is the number of times the breakpoint is hit before execution will halt."),15, 9));
ui.enterText("2");

Joe
jluebker
 
Posts: 15
Joined: Thu Jul 02, 2009 11:17 am

Re: Selection in text field not captured in recording

Postby gnebling » Mon Jul 06, 2009 8:45 am

Use a double-click to select the text being replaced.

ui.click(2, new XYLocator(new LabeledTextLocator(
"A breakpoint is hit when it is reached and the condition (if enabled) is true. The hit count is the number of times the breakpoint is hit before execution will halt."),15, 9));
ui.enterText("2");
gnebling
Moderator
 
Posts: 243
Joined: Tue Aug 22, 2006 7:49 am

Re: Selection in text field not captured in recording

Postby jluebker » Mon Jul 06, 2009 9:29 am

Thanks for the quick response.

I also found that adding the selection of all of the text by sending a CTRL + a key click in the generate test worked.
ui.keyClick(SWT.CTRL, 'a');
jluebker
 
Posts: 15
Joined: Thu Jul 02, 2009 11:17 am

Re: Selection in text field not captured in recording

Postby Phil Quitslund » Mon Jul 06, 2009 12:49 pm

Thanks for the follow up. We're actively working on improving the recorder to pick up such keystrokes and will keep you posted with any improvements.
--
Phil Quitslund
Software Engineer
Google, Inc.
Phil Quitslund
Moderator
 
Posts: 491
Joined: Fri Apr 28, 2006 6:26 am


Return to Window Tester

Who is online

Users browsing this forum: No registered users and 1 guest