Forum Discussion

laxmankumar's avatar
laxmankumar
Occasional Contributor
11 years ago

Unable to solve SYNTAX error and Unable to execute DDT text

Hi,



I just recorded a script and I am facing couple of issues here...



1. System show syntax error at the "catch" statement. Dont know why?

2. When I dont use "try catch" statements and just use a function test1(), my script does not perform and I get JScript run-time error at DDT.ExcelDriver("C:\\LaxTest1.xlsx","Sheet1", true); . I installed "AccessDatabaseEngine.exe" file as suggested for ACEDriver setup. Eventhen I get JScript Runtime error.



If you need any info, please let me know. 



Below is the script. 




function Main()


  {


    try


      {


        DDT.ExcelDriver("C:\\LaxTest1.xlsx","Sheet1", true);


        DDT.CurrentDriver.DriveMethod("Unit1.Test1");  


      }


    catch


      {


        Log.error("Exception", exception.description);


      }


  }


function Test1()


{


  var browser;


  var page;


  var form;


  var textbox;


  var table;


    


  Browsers.Item(btIExplorer, "", Browsers.pX64).Run("http://www.cnn.com/");


  browser = Aliases.browser;


  browser.ToUrl("http://www.qaforums.com/");


  page = browser.pageSoftwareTestingAndQualityAss;


  form = page.form;


  textbox = form.textboxLoginname;


  textbox.Click(27, 13);


  textbox.SetText(DDT.CurrentDriver.Value("UserName"));


  textbox.Keys("[Tab]");


  table = form.tableAutonumber1;


  table.passwordboxLoginpass.SetText(DDT.CurrentDriver.Value("Password"));


  table.submitbuttonButtlogin.ClickButton();


  page = browser.pageSoftwareQualityAssuranceForu2;


  page.Wait();


  page.table.linkSearch.Click();


  page = browser.pageSoftwareQualityAssuranceForu;


  page.Wait();


  form = page.table.form;


  //form.selectForum.SelectItem(2);


  form.selectForum.ClickItem("*AutomatedQA / SmartBear TestComplete");


  table = form.tableTablesurround.cell.tableTableborders;


  textbox = table.cellLighttable.textboxWords;


  textbox.Click(40, 7);


  textbox.SetText("DataDriven");


  table.submitbuttonButtsubmit.ClickButton();


  page = browser.pageSoftwareQualityAssuranceForu3;


  page.Wait();


  page.table.linkLogout.Click();


  browser.pageSoftwareQualityAssuranceForu4.Wait();


}

2 Replies