1

Good day and thanks in advance

So I have a webpage that uses iframe. Inside that iframe there is a table with a vertical scroll bar to the right. I want to know how I can scroll up and down on the iframe bar using java with/without webdriver.

The command that is most popular is

js.executeScript("window.scrollTo(0,Math.max(document.documentElement.scrollHeight,"+
   "document.body.scrollHeight,document.documentElement.clientHeight));");

However this code only controls the windows scroll bar for Firefox not the nested bar. So I want to know what the code is to control the nested bar.

my code:

 <iframe id="myframe" style="width: 100%; height: 1000px; border: 0">
  <div id="mytable" class="body">
  .
  .
  .
  </div>
 </iframe>
Anon
  • 31
  • 3
  • Yippie I found the solution. hurray for myself and Brian Gleeson - IBM http://stackoverflow.com/questions/12035023/selenium-webdriver-cant-click-on-a-link-outside-the-page WebElement target = driver.findElement(By.id("myId")); ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);",target); Thread.sleep(500); //not sure why the sleep was needed, but it was needed or it wouldnt work :( target.click(); – Anon May 29 '13 at 19:43

0 Answers0