I am geeting syntax errot insert while ( expression ) to complete Do statement. Please help...Below is the complete coding in Webdriver.

@Test
public void testUntitled() throws Exception {
  driver.get(baseUrl + "eforms/admin.aspx");
  driver.findElement(By.cssSelector("button.gskButton")).click();
  new Select(driver.findElement(By.id("ctl00_PersonSearch_CountryList"))).selectByVisibleText("Russian Federation");
  driver.findElement(By.id("PersonSearch.SearchFor.Person.gskPreferredName")).clear();
  driver.findElement(By.id("PersonSearch.SearchFor.Person.gskPreferredName")).sendKeys("slawomir");
  driver.findElement(By.id("btnPersonSelectSearch")).click();
  driver.findElement(By.id("btnPage1")).click();
  driver.findElement(By.id("sys44708")).click();
  new Select(driver.findElement(By.id("ctl00_pageBody_Form_ID"))).selectByVisibleText("Expense Report");
  driver.findElement(By.xpath("(//button[@type='button'])[2]")).click();
  // ERROR: Caught exception [ERROR: Unsupported command [waitForPopUp | _self | 30000]]

  driver.findElement(By.xpath("(//button[@type='button'])[5]")).click();
  driver.findElement(By.id("expenseDateButton")).click();
  driver.findElement(By.id("ctl00_pageBody_tcMain_tabDetails_entryPageRepeater_ctl00_receiptDateCalendar_day_1_4")).click();
  //driver.findElement(By.id("ctl00_pageBody_tcMain_tabDetails_entryPageRepeater_ctl00_txtExpenseDate")).clear();
  driver.findElement(By.id("ctl00_pageBody_tcMain_tabDetails_entryPageRepeater_ctl00_txtExpenseDate")).sendKeys("08/08/2013");
  new Select(driver.findElement(By.id("ddlExpenseType"))).selectByVisibleText("Air tickets, excluded VAT (cash)");
  driver.findElement(By.id("txtAmount")).clear();
  driver.findElement(By.id("txtAmount")).sendKeys("250");
  driver.findElement(By.id("txtNotes")).clear();
  driver.findElement(By.id("txtNotes")).sendKeys("test");
  driver.findElement(By.id("rdoReceiptYes")).click();
  driver.findElement(By.id("cmdNextEntryPage")).click();
  driver.findElement(By.id("ctl00_pageBody_tcMain_tabDetails_entryPageRepeater_ctl01_entryPageControlsRepeater_ctl01_field29701")).clear();
  driver.findElement(By.id("ctl00_pageBody_tcMain_tabDetails_entryPageRepeater_ctl01_entryPageControlsRepeater_ctl01_field29701")).sendKeys("84530");
  new Select(driver.findElement(By.id("ctl00_pageBody_tcMain_tabDetails_entryPageRepeater_ctl01_entryPageControlsRepeater_ctl03_field29703"))).selectByVisibleText("Bill");
  driver.findElement(By.xpath("(//button[@id='cmdUpdateEntry'])[2]")).click();
  driver.findElement(By.xpath("(//button[@type='button'])[18]")).click();
//driver.findElement(By.xpath("(//button[@id='tcDetails_buttonsDiv'])")).click();
   //js.ExecuteScript("return $(\"a:contains('Submit')\").mouseover();");
  JavascriptExecutor js = (JavascriptExecutor)driver;
  boolean reachedbottom;
do{
      reachedbottom = Boolean.parseBoolean(js.executeScript("return $(document).height() == ($(window).scrollTop());").toString());
} While (!reachedbottom);


  driver.findElement(By.id("cmdSubmit")).click();
  driver.findElement(By.id("popupButtonOk")).click();
  Thread.sleep(500);
  driver.findElement(By.id("btnVeryHappy")).click();
  }

Java is case-sensitive. "While" is not the same as "while".

which doesn't explain why he's getting an errot instead of an error :)
What's an errot anyway?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.