Before running selenium script suite from command prompt, you must be aware about How to create and run test in selenium IDE. You can read more articles about selenium IDE different commands with examples from my past posts.
Selenium has its own TestRunner and we need to use it for running selenium IDE software test case from command line. Let me describe all process step by step.
Step 1: Open selenium IDE software testing tool from your Firefox toolbar. (Click here to see how to download and install selenium IDE).
Step 2: Download latest selenium server standalone jar file from (http://docs.seleniumhq.org/download/) and save it at folder path "D:\SeleniumTest". We are using "selenium-server-standalone-2.33.0.jar" in this example. You can use latest version but do not forget to update the same in batch file.
Step 2: Create bellow given software test case in your selenium IDE.
New Test | ||
Command | Target | Value |
open | https://www.google.com | |
type | id=gbqfq | List of Selenium Commands With Examples part - 1 |
click | id=gbqfb | |
pause | 5000 | |
captureEntirePageScreenshot | D:\\SeleniumTest\\Seleniumtest.png |
Step 3: Save above software test case at folder path "D:\SeleniumTest" with name "SeleniumTestcase.html".
Step 4: Save above software test Suite at folder path "D:\SeleniumTest" with name "SeleniumSuite.html".
Step 5: Create batch(.bat) file with exactly same as bellow given command line syntax and save it at folder path "D:\SeleniumTest" with name "Seleniumtext.bat".
-----------------------------------------------------java -jar D:\SeleniumTest\selenium-server-standalone-2.33.0.jar -htmlSuite "*firefox" "http://www.google.com" "D:\SeleniumTest\SeleniumSuite.HTML" "D:\SeleniumTest\seleniumtestresult.html"
D:\SeleniumTest\seleniumtestresult.html
------------------------------------------------------
(Note1 : Here, we are using version 2.33.0 of selenium server standalone jar file for our example. If you are using any other version (example : selenium-server-standalone-2.34.0.jar) then you have to update above command line syntax accordingly(Example : D:\SeleniumTest\selenium-server-standalone-2.34.0.jar). Use files and folders names exactly as described above otherwise your script will not run. ).
(Note2 : Use selenium server standalone jar file version according to your browser version. For latest version of browser, you need to use latest selenium server standalone jar file in your test.)
(Note3 : You can replace "*googlechrome" at place of "*firefox" to run your test suite in Google chrome. You can replace "*iexplore" at place of "*firefox" to run your test suite in Internet explorer.)
Now your folder "SeleniumTest" located in "D:" drive should have files as per bellow given screen shot.
Now you are ready to run your software test suite using batch file(You can run above given syntax from command prompt (manually) too to run your test.).
Double click on "Seleniumtext.bat" file.
It will open command prompt as above screenshot > Start selenium server > Load Selenium Test Runner > Load your browser > Execute test suite(SeleniumSuite.HTML) > save test report(seleniumtestresult.html) at specified location(D:\SeleniumTest) and finally it will open test report file (seleniumtestresult.html) automatically.
Why cant I use it with tests that includes rollups commands ?
ReplyDeleteWhy cant I use it with tests that includes Rollup commands ?
ReplyDeleteNot able to run in Chrome Browser.
ReplyDeleteIs it browser version problem or typo problem.
I use Google Chrome Version 32.0.1700.102 m.
hi,
ReplyDeleteDoes it support java-script ? As I am trying to log-in the page with different users using the concept of parametrization which was mentioned in this blog. Getting an error message like Undefined storeVars, while.Could you please advise what can be done here.
Please explain what you mean by, "Step 2: Create bellow given test case in your selenium IDE." Then, in the table below that statement, how would that information go into a test case?(!)
ReplyDeleteYou need to copy paste all the commands, targets and values In selenium IDE as shown in table.
DeleteI am getting below error, any suggestion:
ReplyDelete15:43:06.393 INFO - Launching a standalone Selenium Server
15:43:06.473 INFO - Java: Oracle Corporation 21.0-b17
15:43:06.477 INFO - OS: Windows 7 6.1 amd64
15:43:06.491 INFO - v2.46.0, with Core v2.46.0. Built from revision 87c69e2
15:43:06.541 INFO - Driver class not found: com.opera.core.systems.OperaDriver
15:43:06.546 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
I'm afraid this isn't Selenium IDE you're referring to here, this is Selenium Server / RC, a great tool nonetheless.
ReplyDeleteThere are ways to open a Selenium IDE window automatically, but no way for it to be ran automatically.
Hi ..
ReplyDeleteI not able to run the test suite neither in IE nor Chrome even already follow the note 3 as below
(Note3 : You can replace "*googlechrome" at place of "*firefox" to run your test suite in Google chrome. You can replace "*iexplore" at place of "*firefox" to run your test suite in Internet explorer.)
https url is not working can please advise
ReplyDeleteHow can i use .xml file data while running with command prompt?
ReplyDeleteHow can i use .xml file data while running with command prompt?
ReplyDelete