-1

I asked some questions about the scLocators, but I still don't manage to get something working with selenium. So there is an idea : "How can I say to smartGwt : Attribute an ID in HTML".

I tried ensureDebugId("myId") but I don't know why, in my webapp I can't even find this ID. I tried setId("myId") but it's the same, I can't see it in the HTML code generated. I'm totally lost in this project. Can someone help me ? :/

=> Using : maven, selenium web driver (htmlunit), gwt, smartgwt.

=> For : Unit testing client side of a web app.

Any help is Appreciated.

Sandip Armal Patil
  • 6,241
  • 21
  • 93
  • 160
Depado
  • 4,811
  • 3
  • 41
  • 63
  • I'm a bit confused there, what do you mean by "the HTML code generated" ? Isn't GWT/smartgwt generating javascript? – Eric C. Apr 23 '12 at 14:17
  • Yes it is, but can't I generate an HTML ID with it ? Is there no way ? If everyone except me can test his code with selenium, there must be a way to assign an ID to be used with selenium, no ? :/ – Depado Apr 23 '12 at 14:22
  • Probably, can't help you with this, I don't know anything about selenium. All I know is that you will never find the IDs in HTML. The javascript generated by GWT is unreadable so you'll have to find another way. Good luck and sorry for not being able to help ! – Eric C. Apr 23 '12 at 15:30

1 Answers1

2

This approach is a dead end, it will not work.

Go back to the Automated Testing overview in SmartGWT's JavaDoc, and the Selenium user-guide.html in the SDK (in the "selenium" folder).

If you're having trouble with Selenium:

  1. consider getting a 3.1d build from smartclient.com/builds since we've added yet more documentation since the 3.0 release

  2. ask questions about the Selenium approach, because again the approach you're trying now won't work

Charles Kendrick
  • 2,059
  • 13
  • 14
  • That's quite the problem, I tried almost everything about selenium. I don't really know how to use the scLocators with Selenium. And without scLocators, it's just impossible to get some stable automated tests since smartGWT always change IDs. – Depado Apr 24 '12 at 07:55
  • Next thing to try is reading the docs (see above) which explain scLocators in depth and tell you exactly what to do. – Charles Kendrick Apr 24 '12 at 22:52
  • As I explained on my other thread about scLocator, the only problem I got now is to set the user-extensions.js properly because I just found a temporary solution. And you were right, setting html id is a dead end. In fact I have no problem with Selenium itself, it's more about the maven configuration (I explained it in details on the other thread), so I searched some fancy solutions. Though I'd like to thank you for trying to help me. That's nice to get some help sometimes =) – Depado Apr 25 '12 at 08:59