Current time: 10-24-2019, 02:14 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting is not working for me
05-28-2011, 06:59 PM (This post was last modified: 05-29-2011 03:11 AM by david.)
Post: #1
Scripting is not working for me
I am using a private instance of webpagetest and all works well expect when using scripting.
The script I am using is below with the simple aspx webform. Can anyone spot what I am doing wrong?

script:
logData 1
navigate testform.aspx
setValue name=textfield1name 1
setValue name=namefield1name 2
submitForm name=testform1


testform.aspx:
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
results.Text = Request.Form["textfield1Name"] + " " + Request.Form["selectfield1Name"];
}
}
</script>


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>test page</title>
</head>
<body>
<form id="testform1" runat="server" >
<div>
<input id="textfield1Id" name="textfield1Name" size="20" />
<select id="selectfield1Id" name="selectfield1Name" >
<option value="1">First Choice</option>
<option value="2">Second Choice</option>
<option value="3">Third Choice</option>

</select>
<input type="submit" value="Submit"/>
<p>Previous Results : <asp:Label id="results" runat="server"/></p>
</div>
</form>
</body>
</html>
Find all posts by this user
Quote this message in a reply
05-29-2011, 03:09 AM
Post: #2
RE: Scripting is not working for me
I trawled through the old posts and found that I needed to turn off all logging until the final submission (and submit the form using an id). So the fix was easy in the end:

logData 0
navigate testform.aspx
setValue name=textfield1name 1
setValue name=namefield1name 2
logData 1
submitForm id=testform1

job done!
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)