We are using SmartGWT 2.5 with Firefox and Selenium IDE. We have the scLocator tag setup for the dynamic form(s) and that works fine. When we click a form item (outside of the actual textField) we get the proper scLocator click item in the Selenium log however if we click on a textField, type data, then lose focus, we just get a Type command with a target of id=isc_BX were BX is some random var. We have tried setting names on the TextItem and locateBy(“title”) however nothing changes the fact that the textItem’s id is random.
Is there anything we are missing? This makes testing input validation nearly impossible since the TextItem IDs are being randomly generated and no scLocator is being generated for them.
So long as you set a name for the field, you get a predictable stable locator. If you think this is not the case, try to put together a standalone test case that we could run to see the bad locator - this will mostly likely reveal some other problem with your setup.
The below code does not give a scLocator tag. When I type text in the textField and tab out of it, all I see in Selenium is
“type | id=isc_7 | valueITyped”
This is with Firefox 5. I will try a newer version.
public void onModuleLoad() {
final DynamicForm form = new DynamicForm();
final TextItem textItem = new TextItem();
textItem.setTitle("Name");
textItem.setName("doesnt_work");
form.setFields(textItem);
VLayout vlayout = new VLayout();
vlayout.addMember(form);
RootPanel.get().add(vlayout);
}
Don’t use RootPanel.add(), use draw() (see QuickStart Guide).
Your locator suggests that the extensions are just not loaded. This may be something simple like a misplaced file.
Draw makes no difference.
Firefox 7 makes no difference.
If the extensions are not loaded why do I get proper locators for all other fields?
Maybe I should have stated we are trialing SmartGWTEE 2.5.
The only other quick guess we have here is that you might have a mismatch between your Selenium extensions files and your SmartGWT runtime. There’s a slim chance you’re hitting an already-fixed bug, although the code you’ve shown is too simple to trip any known ones.
We would suggest grabbing the latest 2.5.x nightly from smartclient.com/builds and making sure you use the Selenium extensions files found in that package.
Thank you for the advice.
I downloaded the latest nightly for 2.5.x and 3.0. Both selenium extension files match with my current selenium files.
Upgraded the smartgwt/ee jars to 2.5.x and 3.0, no dice.
This happens on our test systems as well when running off our build server.
I will spend some more time with it tomorrow.
Hmm, at this point your report boils down to telling us that what everyone does every day doesn’t work 
You might try re-installing Selenium itself as well. And be sure to run a GWT compile and clear browser caches.
Ok well I suppose it can be chalked up to user error or poor UI design with Selenium.
Every other operation that involves a unique widget in Selenium displays scLocator as the ‘target’. However modifying the textField displays the command as a ‘type’ and therefore displays the useless ID Tag as the ‘target’. To see the name tag one must manually change the command type from the drop down menu.
While the name is available, I still do not understand why the textField is not receiving its own scLocator tag. This exact same behavior can be seen when using the SmartGWTEE Showcase. I was under the impression a locator was made up of the xpath and attributes of a widget and should be available to all widgets.
This is all with Selenium IDE 1.4.1, and yes I reinstalled, recompiled, and cleared my cache.
Thanks for your help today, calling it a day though 