How to enter a value in a particular text field

80 views
Skip to first unread message

Sunil

unread,
Dec 20, 2011, 12:28:43 PM12/20/11
to windowtester-pro
Hi,
I have a form editor which has 5 text fileds (ex: name, phone, city,
state, country) and I need to enter some value into it. When I record
using windows tester i get something like below and works fine.
....
ui.enterText("sunil");
ui.keyClick(WT.TAB);
ui.enterText("00723");
ui.keyClick(WT.TAB);
ui.enterText("bangalore");
ui.keyClick(WT.TAB);
ui.enterText("Karnataka");
ui.keyClick(WT.TAB);
ui.enterText("India");
....

Assume that I just want to enter the value for City? How do i do that?
How will I identify text field with its name?

One way is to just tab the first 2 inputs fields without entering any
data and then enter the value in city field. Howver i feel this is not
a proper way. I believe there should be a way in windows tester to
accomplish this which i'm not able to figure out.

Your support is highly appreciated.

Cheers, Sunil

Keerti Parthasarathy

unread,
Dec 20, 2011, 1:46:40 PM12/20/11
to windowte...@googlegroups.com
Sunil,

You can make use of a LabeledLocator or LabeledTextLocator - a locator that looks for a widget right next to the specified label, or if these don't work, you can always name the text fields and use the NamedWidgetLocator.

Take a look at the documentation 


--
Keerti

M

unread,
Dec 20, 2011, 2:06:04 PM12/20/11
to windowtester-pro
Hi Sunil,

Depending on how you have created the Label, you should be able to use
some form of locator to click on the widget. Then you can enter text.

For example, if you have a text field preceded by a label:
_____________
City : |_____________|

You could use a LabeledTextLocator:

ui.click(new LabeledTextLocator("City : "));
ui.enterText("My City Name");

If you have multiple labels with "City : ", then you will have to
reference the parent of the LabeledText in your LabeledTextLocator
constructor.

Sunil

unread,
Dec 22, 2011, 2:19:17 AM12/22/11
to windowtester-pro
Thanks for the Support Keerti and M.
LabeledTextLocator worked like a charm.

Cheers, Sunil

Venkata Prasad Reddy

unread,
Dec 16, 2015, 6:32:06 AM12/16/15
to windowtester-pro, sunil...@gmail.com
Hi,

I am able to Record and Play ContactManagerRPC Application which is provided by Window Tester Pro Team, but I dont know the steps for Recording and Playing my own Java Swing Application.

Please tell me, Steps for Recording and Playing Application (Not provided by Window Tester Pro Team).

Thanks in advance.

Martin Moore

unread,
Dec 16, 2015, 7:04:04 AM12/16/15
to windowtester-pro, sunil...@gmail.com
Certainly the best way to get a reply is to post to every thread you see. I think you missed one though, which is why nobody is replying to you.

Kind regards
Big John

--
You received this message because you are subscribed to the Google Groups "windowtester-pro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to windowtester-p...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fred G

unread,
Dec 16, 2015, 7:55:32 AM12/16/15
to windowtester-pro, sunil...@gmail.com, martin....@gmail.com
Thanks John. You just made my day. :)

Regards,

Fred
Reply all
Reply to author
Forward
0 new messages