Forum Discussion
sumitmishra
15 years agoOccasional Contributor
Here is the warpper class:
Here is how you call it in a groovy test step in soapUI:
and so you can use your selnium handle throughout your soapUI project. Make suer to close it when you're done using it or when you encounter exception.
package tools;
import com.thoughtworks.selenium.*;
import java.util.regex.Pattern;
public final class Browser {
private static Browser instance;
private Selenium selenium;
private boolean inuse;
private Browser (String host,int port, String browserType, String url) {
this.selenium = new DefaultSelenium(host, port, browserType, url);
this.selenium.start();
inuse = true;
}
public static Browser getInstance(String host, int port, String browserType, String url) {
if (instance == null) {
instance = new Browser(host,port,browserType,url);
}
return instance;
}
public void open(String url) {
this.selenium.open(url);
}
public xxxx() {}.....
}
Here is how you call it in a groovy test step in soapUI:
import com.thoughtworks.selenium.*;
import tools.*;
Browser selenium = Browser.getInstance(host,port,type,url);
selenium.open(url);
selenium.xx
....
and so you can use your selnium handle throughout your soapUI project. Make suer to close it when you're done using it or when you encounter exception.