What
is Selenium RC?
Selenium
RC (Remote Control) is an automation test tool that allows to create
automation scripts for web based testing in any programming language
such as JAVA, C#, PHP, Ruby, Python etc.
Selenium
RC injects javascript to execute the test and is really ease to work
with all browsers and platforms and also good supported for ajax
applications as well.
Selenium
RC have two parts:
Selenium RC (Remote Control) is an automation test tool that allows to create automation scripts for web based testing in any programming language such as JAVA, C#, PHP, Ruby, Python etc.
Selenium RC injects javascript to execute the test and is really ease to work with all browsers and platforms and also good supported for ajax applications as well.
Selenium RC have two parts:
-
Selenium
server - Launches the browser and execute the test cases.
-
Selenium
remote control - Provides an application programming interface with
lots of libraries to support different programming languages
-
Selenium
server - Launches the browser and execute the test cases.
Selenium
remote control - Provides an application programming interface with
lots of libraries to support different programming languages
Architecture:
With
different programming language and object oriented support gives you
the ability to create more complex test cases that are not possible
through Selenium IDE. You can executes these test cases as many time
as required by using frameworks available in Java i.e. TestNG or
JUnit. Also helpful while handling expected exceptions.
How to configure Selenium RC?
Pre
Requisite:
-
-
-
Start
Selenium RC standalone server:
Open
command prompt and go to the directory where the Selenium RC jar file
was kept and then write:
java -jar
selenium-server-standalone-2.20.0
Create
a new class file and copy paste the recorded script code. Now run it
as a Java application.
Basic
Selenium RC methods:
-
selenium.start() -
Takes you to the location where selenium server is and runs the
server.
-
selenium.open() -
Takes you to the provied URL/Website address.
-
selenium.getTitle() -
Get the title of the current browser window.
-
selenium.windowFocus() -
Get the focus on the current window.
-
selenium.windowMaximize() -
Maximizes the current window.
-
selenium.close() -
Close the current browser window.
Method
Detail:
Open command prompt and go to the directory where the Selenium RC jar file was kept and then write:
java -jar selenium-server-standalone-2.20.0
selenium.start() -
Takes you to the location where selenium server is and runs the
server.
selenium.open() -
Takes you to the provied URL/Website address.
selenium.getTitle() -
Get the title of the current browser window.
selenium.windowFocus() -
Get the focus on the current window.
selenium.windowMaximize() -
Maximizes the current window.
selenium.close() -
Close the current browser window.
start
public void start()
-
Description
copied from interface:
-
Launches
the browser with a new Selenium session
stop
public void stop()
-
Description
copied from interface:
-
Ends
the test session, killing the browser
click
public void click(java.lang.String locator)
-
Description
copied from interface:
-
Clicks
on a link, button, checkbox or radio button. If the click action
causes a new page to load (like a link usually does), call
waitForPageToLoad.
doubleClick
public void doubleClick(java.lang.String locator)
-
Description
copied from interface:
-
Double
clicks on a link, button, checkbox or radio button. If the double
click action causes a new page to load (like a link usually does),
call waitForPageToLoad.
clickAt
public void clickAt(java.lang.String locator,
java.lang.String coordString)
-
Description
copied from interface:
-
Clicks
on a link, button, checkbox or radio button. If the click action
causes a new page to load (like a link usually does), call
waitForPageToLoad.
doubleClickAt
public void doubleClickAt(java.lang.String locator,
java.lang.String coordString)
-
Description
copied from interface:
-
Doubleclicks
on a link, button, checkbox or radio button. If the action causes a
new page to load (like a link usually does), call waitForPageToLoad.
-
fireEvent
public void fireEvent(java.lang.String locator,
java.lang.String eventName)
-
Description
copied from interface:
-
Explicitly
simulate an event, to trigger the corresponding "onevent"
handler.
keyPress
public void keyPress(java.lang.String locator,
java.lang.String keySequence)
-
Description
copied from interface:
-
Simulates
a user pressing and releasing a key.
-
shiftKeyDown
public void shiftKeyDown()
-
Description
copied from interface:
-
Press
the shift key and hold it down until doShiftUp() is called or a new
page is loaded.
-
shiftKeyUp
public void shiftKeyUp()
-
Description
copied from interface: Release
the shift key.
-
metaKeyDown
public void metaKeyDown()
-
Description
copied from interface:
Selenium -
Press
the meta key and hold it down until doMetaUp() is called or a new
page is loaded.
-
-
Selenium
No comments:
Post a Comment