For create test cases
Need the following
2. You need download from page selenium-java-client-driver-1.0.1.jar and selenium-server-standalone-2.42.2 of http://docs.seleniumhq.org/download/
3. For execute in different browser, you need download the plugins.
Download for internet explorer plugins of http://docs.seleniumhq.org/download/
Download for google chrome plugins of http://docs.seleniumhq.org/download/
4. The plugins download
Create test case in Eclipse
We follow next steps .Execute Eclipse IDE
Adding JARs
Create JUnit Test case
The
labels is important in executing the test
The
label "@Before" indicates to JUnit, that the this method code be
execute first before that the test. Preparation for the execution of the test. its
name of the method is "setUp ()".
on
this section we initialize the browser
and execute
the
label “@Test” indicates to JUnit, this part is the test and that it should
execute it.
this
method, we can put the name that we want.
The
label “@After” indicates to JUnit that execute to ends the test case .
on
this part, close the browser and ends
the test.
Its
name of the method is “ tearDown ()”.
We
need import the follow in this test
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.By;
Execute the test case on Firefox
Execute the test case on different browsers
Configure for execute the test case























It would be good explain a litle bit more in top of the post about which are the goals of this post and then explain the tools used are the steps. But in general is good.
ResponderEliminar