I have generated a Selenium test for testing a web service and exported that as a Java/Junit4/Remote Control test file. The file looks as follows :
package com.example.tests;
import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import java.util.regex.Pattern;
public class RemoteControl {
private Selenium selenium;
@Before
public void setUp() throws Exception {
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://rrrtttwwweee.com:8080/xxxx/vvvv/servers");
selenium.start();
}
@Test
public void testRemoteControl() throws Exception {
selenium.open("/boingo-object-model/vpn/servers");
verifyTrue(selenium.isTextPresent("{\"servers\":[{\"name\":\"automatic\",\"dns\":\"auto.ssl.boingovpn.com\"},{\"name\":\"us_west\",\"dns\":\"california.ssl.boingovpn.com\"},{\"name\":\"europe\",\"dns\":\"ireland.ssl.boingovpn.com\"},{\"name\":\"asia\",\"dns\":\"singapore.ssl.boingovpn.com\"}]}"));
assertTrue(selenium.isTextPresent("{\"servers\":[{\"name\":\"automatic\",\"dns\":\"auto.ssl.boingovpn.com\"},{\"name\":\"us_west\",\"dns\":\"california.ssl.boingovpn.com\"},{\"name\":\"europe\",\"dns\":\"ireland.ssl.boingovpn.com\"},{\"name\":\"asia\",\"dns\":\"singapore.ssl.boingovpn.com\"}]}"));
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
}
I now want to use this test file in my eclipse project. I know I will have to download a jar that contains thoughtworks.selenium
somehow.
Wondering if someone already has experienced doing something similar before and if they know how to step through the process?
Thanks!