How to migrate from Selenium IDE to WebDriver?

4,213 views
Skip to first unread message

p00ka

unread,
Feb 20, 2012, 11:57:53 AM2/20/12
to Selenium Users
I have a Selenium IDE test suite and want to migrate to Selenium 2.
Most of the stuff I've found online talks about how to migrate from
Selenium RC, which isn't very helpful. What I'm looking for is a
straight forward document on how to move my test IDE test suites from
the IDE to WebDriver.

I assume that I'll want to use JAVA and have created an Eclipse
project that include the JRE (JavaSE-1.7) and the selenium-server-
standalone-2.19.0.jar.

Please note that I'm not a JAVA programmer but am a pretty quick study
- the first thing I would want to do is be able to successfully move
my test suite (or optionally, a very simple test suite) into the
project and have it run.

Can someone point me in the right direction?

Afzal Hussain Shaik

unread,
Feb 20, 2012, 12:46:24 PM2/20/12
to seleniu...@googlegroups.com
Use export option in the file menu to convert it into webdriver code


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.




--
Thanks & Regards,
Afzal Hussain Shaik


p00ka

unread,
Feb 20, 2012, 2:09:36 PM2/20/12
to Selenium Users
Thanks for the response!

Using the file export you mention works fine for one test case (in
this case called 'Initialize'), even though there are two errors when
bringing the exported file into Eclipse:

The declared package "com.example.tests" does not match the expected
package ""
and
The public type Initialize must be defined in its own file

If I use the 'quick fix' for each of these errors, then the script
will run.

However, exporting the test suite and all its test cases, then
importing them into the project results in many other errors (not the
same ones as when importing a single script) that must be addressed
before the project can be compiled. And there are a LOT of test cases
involved here.

This is why I'm asking for a more detailed discussion on how to
migrate from Selenium IDE to Selenium 2 so I don't end up trying to
find the solution through experimentation or reading an entire Java
book to find the specific solution (yes - I understand that Java is a
complex language - but when trying to learn about a while loop, it
isn't always necessary to read about if-then-else). By-the-way, I
*am* willing to read a book, but I'd like to know which one will yield
the solution...

I'm pretty sure I'm not the only person trying (or has tried) to
migrate from the IDE - so is there a document out there that goes into
detail on how migrate from the IDE to Selenium 2? A tutorial? A
detailed message thread? Something that will lead me to a successful
transition?

Thanks!

Jeff Clarity QA

unread,
Feb 20, 2012, 4:09:34 PM2/20/12
to Selenium Users
I actually went from IDE to RC to Webdriver because of business need.
The export function exports your IDE test scripts into the language
you specify. I am using Ruby bindings which are a little different
than java but the same concept drives them all. You have to identify
your elements in the programming language you want to use in this case
java. Example in IDE the script was basically written in HTML. If
you click on the source tab this can be seen. Below is a sample of
the code to produce 1 row in your IDE script which is merely an HTML
table. So basically this command is going to command (type) into a
field target named (id=login) the value (john doe)
<tr>
<td>type</td>
<td>id=login</td>
<td>john doe</td>
</tr>

the same command in ruby would be

element = driver.find_element(:id, 'login')
element.send_keys "john doe"

This is how you basically interact with all your page objects. I
would start off by familiarizing myself with my scripts in HTML
(Selenese) and then figure out the equivalent command s in webdriver
for the language you want. http://selenium.googlecode.com/svn/trunk/docs/api/java/index.html
Hope this helps.

p00ka

unread,
Feb 22, 2012, 11:09:34 AM2/22/12
to Selenium Users
Thanks for the input. I'm familiar with the HTTP structure and
Selenium commands there - not a problem (none of my scripts are record-
n-play). The problematic lines of code have been rem'd out to be
addressed at a later time and I've already been looking at the
differences in commands.

The issue is that I haven't found the magic migration path from
Selenium IDE to Selenium2. Bringing each exported script into the
Java project results in of Java errors so (of course) the test won't
compile (I'm addressing each of them individually - very time
consuming). As I originally mentioned, I'm not a Java developer so
trouble shooting the errors is a long, painful process which I was
hoping to make a little easier.

It just seemed to me that if the ability to export scripts exists in
the IDE, then there should be a straight forward way to bring them
into a Java project, compile, and run. I'm looking for that straight
forward process.

I've been doing quite a bit of reading, experimenting, and asking lots
of questions. So far, I haven't found anybody who has actually tried
to do what I'm trying to do - which is a puzzle to me - though I'm
sure he/she is out there somewhere.

*** The basic question remains: What are the steps needed to export a
test suite (and all its test cases) from Selenium IDE to Selenium2
(WebDriver)? ***

If there are no 'steps' then what information/knowledge is required to
make the transition (please don't say something like 'learn Java' -
I'm doing that and such a response won't be very helpful because its
too high level).

Thank you all for your consideration of my problem! I look forward to
additional comments.

Jeff Clarity QA

unread,
Feb 22, 2012, 11:49:25 AM2/22/12
to Selenium Users
Good luck on that P00ka. Finding a seamless magic way to convert
scripts, database ,code or anything without error. I have a little
programming experience and from what I have found in the past is that
those great sounding converters and wizards do not always work. Even
in some big corporate name professional products like SQL Server. The
basic functionality is usually there to some extent but then some bugs
need to be worked out developers. I always look at open source tools
such as Selenium as works in progress that may not have all the kinks
worked out themselves, so everything may not work as designed in the
beginning. They may even need your help in fixing it once you figure
it out. Try looking at a couple of the few Selenium books that are
out there. Selenium Simplified by Alan Richardson and/or Selenium 1.0
Testing Tools by David Burns. As 80% of both books did not apply to
my situation because they were written for javascript a few lines of
code here or there made some light come on for me. You are headed in
the right direction learning java and this may be the only way to
convert every thing then debug or convert small bits and pieces then
add to it. I have been searching for that magic cookbook myself and
all I can find is examples here and there by different people. Again
good luck and let me know if you find something magical.

Fanindra Bapat

unread,
Jul 17, 2012, 4:57:19 AM7/17/12
to seleniu...@googlegroups.com
Thanks ALL. I also had similar question in mind and got the answer. Thanks all again. 

RCR

unread,
Oct 23, 2013, 7:04:51 PM10/23/13
to seleniu...@googlegroups.com, ro...@byteoftheweb.com
Did you try selenese4j-maven-plugin ?
Reply all
Reply to author
Forward
0 new messages