In the last Lesson we have seen, how to record the selenium script using Selenium IDE( Lesson no 4). In this lesson we will how we can import the same script and execute it from eclipse.
Before we jump into steps, make sure that you have exported the file in Java/Junit4/Webdriver format, else it will cause an error and you will face difficulties in running the script.
On other hand make sure that you have configure your Eclipse properly with Selenium and setup the correct java path. ( Lesson no 2)
Now, you have to performed following the steps
Step 1: Open Eclipse > Load the work-space in which you want to run your script
Step 2: Open ( created in Lesson no 2) or create new Java project ( if you you are creating new project, you have import the selenium Jar file as external Jar in your project. see the lesson no 2 last section for it.
Step 3: Go to File Menu > New > Other > Wizard will open, Type “Junit Test Case” > select Junit Test Case
Step 4: Now, File menu > Open file…> open the record file
Step 5: in Open Recorded file, Copy the Entire code and paste in Junit Test case file. You will get some reference errors, resolve it. errors are simple to fix. ( if you face any issue, refer the selenium video here)
Step 6: Execute/Run the file.
You are Done!
Let us know, you have any queries about executing the recorded script in eclipse.