Forum Discussion

emwillia's avatar
emwillia
Occasional Contributor
12 years ago

Groovy Script Failing

I have attempted to create a groovy script via selenium and have it execute a few simple tasks. I am able to execute the groovy script from eclipse using the groovyConsole, however, when I run it within LoadUI I get a null pointer exception as follows: "java.lang.NullPointerException: Cannot set property 'binding' on null object'.

I have the 3 jar's that my script is grabbing in the ext directory of my load UI (I read somewhere that it could be a problem if they are not there).

Here is the script:



@Grapes([
@Grab("org.seleniumhq.selenium:selenium-support:2.23.1"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.23.1")
])

import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.By

FirefoxDriver driver = new FirefoxDriver()
driver.get("http://www.up.com");
driver.findElement(By.linkText("Employees")).click();
driver.findElement(By.cssSelector("div.grpbox > ul > li > a")).click();
driver.findElement(By.linkText("ePayroll")).click();
driver.findElement(By.id("USER")).clear();
driver.findElement(By.id("USER")).sendKeys("USER_ID");
driver.quit();



Any help would be greatly appreciated.
No RepliesBe the first to reply