|
|
Another tab in the
Selenium Options window is Format, As mentioned
earlier, Selenium IDE can
generate code in variety of
languages, this page gives
you an option of specifying
what kind of formatting you
would like in the generated
code. For example, what
should be the header, how it
should be indented etc.
Lets start some action now,
In the options, select
format and specify HTML as
your language choice for
your automation. Notice
that, when you select HTML
as your choice of
language,
additional tab appears on
the Selenium IDE called Table.
|
There are three columns
under this Table - Command,
Target and Value.
This Table is the crux of
how Selenium works. For any element present on
the browser, Selenium maps
its action in command,
target and value.
For example, if you want to
type user name in the user name text box
Selenium would translate it
as
command=type ,
Target=username text box and
value=your username
For
commands related to asserts,
value can be
used to compare the value.
For example
command=assertText
,Target=Label and
Value=somethingtocompare.
In this
case Selenium will compare
value of the target with the
specified value in
subsequent execution.
Selenium gives you enough
functionality in terms of
identifying Target. You can
locate or identify target
using DOM, ID, Name, XPath
etc. This helps you in
making a robust automation
framework. You might find it
useful to try Firefox
extensions like DOM
Inspector or XPath Viewer to
get information about the
XPath or DOM information of
the GUI element under test.
This
information should be
sufficient for you to
explore Selenium IDE and get
started with the tool. Lets
summarize all the steps
involved -
-
Make sure you have
installed Selenium IDE in
Firefox.
-
Open Firefox and
application you want to test
-
Launch Selenium IDE
using tools-Selenium IDE
-
By
default, you should be
in the recording mode,
but confirm it by
observing the Red
button.
-
Select HTML Format.
-
Record some actions and
make sure that these are
coming on
Selenium IDE.
-
During recording if you
right click on any element
it will show all
the selenium commands
available.
-
You can also edit
existing command, by
selecting it and editing on
the boxes available.
-
You can also
insert/delete commands by
choosing appropriate option
after right clicking.
-
Choose appropriate run
option - i.e walk, run or
test runner and
review your results.
Hope this article was
helpful for you in next
article we will discuss
how Selenium IDE can be used
with Selenium Remote Control to write scripts in
different languages. As
always, your
feedback about this
article are welcome.
<<< Introduction To Selenium IDE Selenium Remote Control
>>>
|