Forum Discussion

brudnick's avatar
brudnick
Occasional Contributor
14 years ago

textbox assigned empty string after recording - playback fails

Hi.

I'm testing logon functions for an ASP.NET web application.

I recorded a script to testing the selection and entry of security questions for a new account.

User must pick and answer 5 questions, so there's a table with 3 columns and 5 rows.

Column one of each row is a drop-down selector with the question.

Column two is a textbox for entry of answer.

Column three is a button to save the row.



On replay, the script does not enter any answer in the answer textbox.

How do I make this work?



Here's the script:

function AF1()

{

  var  iexplore;

  var  page;

  var  table;

  var  panel;

  var  textbox;

  TestedApps.iexplore.Run();

  iexplore = Sys.Process("iexplore", 2);

  iexplore.ToURL("http://qa/External/qa7/Login.aspx");

  page = iexplore.Page("http://qa/External/qa7/Login.aspx");

  table =
page.Panel("WrapDiv").Form("form1").Panel("page").Table("fullContent").Cell(0,
0).Panel("contenthere").Panel("pnlLogin").Table("LoginTbl");

  table.Cell(4, 1).Textbox("txtUserName").Text = "ULYGRANT6";

  table.Cell(7, 1).PasswordBox("txtPassword").Text = "password";

  table.Cell(9, 1).SubmitButton("btnLogIn").Click();

  //Please wait until download completes: "http://qa/External/qa7/RequiredInformation.aspx"

  page.Wait();

  Objects.Compare(Sys.Process("iexplore",
2).Page("http://qa/External/qa7/RequiredInformation.aspx").Panel("WrapDiv").Form("form1").Panel("page").Panel("pnlSecurityQs").Table(0),
"AF12-a", true);

  panel = page.Panel("WrapDiv").Form("form1").Panel("page");

  table = panel.Panel("pnlSecurityQs").Table(0).Cell(1, 0).Table("SQPanel");

  textbox = table.Cell(1, 2).Textbox("SQPanel_SQText_1");

  textbox.Click(141, 4);

  textbox.Text = "";

  table.Cell(1, 3).Button("Save").Click();

  textbox = table.Cell(2, 2).Textbox("SQPanel_SQText_2");

  textbox.Click(172, 11);

  textbox.Text = "";

  table.Cell(2, 3).Button("Save").Click();

  textbox = table.Cell(3, 2).Textbox("SQPanel_SQText_3");

  textbox.Click(219, 6);

  textbox.Text = "";

  table.Cell(3, 3).Button("Save").Click();

  textbox = table.Cell(4, 2).Textbox("SQPanel_SQText_4");

  textbox.Click(192, 11);

  textbox.Text = "";

  table.Cell(4, 3).Button("Save").Click();

  textbox = table.Cell(5, 2).Textbox("SQPanel_SQText_5");

  textbox.Click(143, 16);

  textbox.Text = "";

  table.Cell(5, 3).Button("Save").Click();

  Objects.Compare(Sys.Process("iexplore",
2).Page("http://qa/External/qa7/RequiredInformation.aspx").Panel("WrapDiv").Form("form1").Panel("page").Panel("pnlSecurityQs").Table(0).Cell(1,
0), "AF14-a", true);

  panel.Table(1).Cell(0, 0).SubmitButton("btnSubmit").Click();

  //Please wait until download completes: "http://qa/External/qa7/BillSelector.aspx?statementtype=3"

  page.Wait();

  Objects.Compare(Sys.Process("iexplore",
2).Page("http://qa/External/qa7/BillSelector.aspx?statementtype=3").Panel("WrapDiv").Form("aspnetForm").Panel("page").Panel("userinfo"),
"AF15-a", true);

 
page.Panel("WrapDiv").Form("aspnetForm").Panel("page").Panel("header").Table(0).Cell(0,
0).Link("LogOutLink").TextNode("ctl00_Label2").Click(25, 5);

  //Please wait until download completes: "http://qa/External/qa7/Login.aspx?action=out"

  page.Wait();

  Sys.Process("iexplore", 1).IEFrame(0).Close();

}



NOTICE that after recording... each answer textbox is assigned to an empty string.

I did manually enter the info in the script, but the playback still fails.