title: Using Selenium IDE's getEval command with FirefoxWebdriver
body: <p> Hello,</p>
  
  <p></p></p>
  
  <p> I have a working Selenium IDE script that is working using this code:</p>
  
  <pre><code> getEval |      this.page().findElement('xpath=//html/body/div[18]/div[9]/div[2]/div/div[9]/div[2]/center/div/div/div[2]/div/span/span/a').removeAttribute('target')
  </code></pre>
  
  <p></p>
  
  <p> I then exported the entire test case as a Junit test case.  The command for the getEval was not included with the export.  I tried the following code: </p>
  
  <pre><code>if (driver instanceof JavascriptExecutor) {
      js = (JavascriptExecutor)driver;
  
  }
  js.executeScript("this.page().findElement('xpath=//html/body/div[18]/div[9]/div[2]/div/div[9]/div[2]/center/div/div/div[2]/div/span/span/a').removeAttribute('target');");
  </code></pre>
  
  <p></p>
  
  <p> When running this line of code, I get and exception: page is not defined</p>
  
  <p></p>
  
  <p>I have also tried:</p>
  
  <pre><code>sel = new WebDriverBackedSelenium(driver, driver.getCurrentUrl());
      sel.getEval("page().findElement('xpath=//html/body/div[18]/div[9]/div[2]/div/div[9]/div[2]/center/div/div/div[2]/div/span/span/a').removeAttribute('target')");
  </code></pre>
  
  <p>  The Junit test crashes when this line in ran, and the test case fails.  I was wondering if I am sending the correct javascript script or if there is another, better, way of doing such a Selenium command through java.</p>
  
  <p></p></p>
  
  <p> I am using java 6 and Selenium 2.33.0</p>