Variable State Information in web form script
carteltest
Posts: 2
Hello. I am having difficulty modifying my recorded script to take State Information and make variable input for a web form.
My recorded script is:
WebClient.HttpRequest.Pragma = "no-cache"
WebClient.HttpRequest.ContentType = "multipart/form-data; boundary=
7d72114510340"
WebClient.HttpRequest.SetPostData(System.Text.Encoding.ASCII.GetBytes( _
"
7d72114510340" & _
vbCrLf & _
"Content-Disposition: form-data; name=""ctl00$MainContent$SingleOrder1$txtAddress""" & vbCrLf & _
"" & vbCrLf & _
"700 Test Street" & vbCrLf & _
"
7d72114510340" & _
"" & vbCrLf & _
"Content-Disposition: form-data; name=""ctl00$MainContent$SingleOrder1$txtCity""" & vbCrLf & _
"" & vbCrLf & _
"Denver" & vbCrLf & _
The data I want to take for State Information is street address (seen here as 700 Test Street and city name (seen here as Denver)
Please advise.
Regards.
My recorded script is:
WebClient.HttpRequest.Pragma = "no-cache"
WebClient.HttpRequest.ContentType = "multipart/form-data; boundary=
7d72114510340"
WebClient.HttpRequest.SetPostData(System.Text.Encoding.ASCII.GetBytes( _
"
7d72114510340" & _
vbCrLf & _
"Content-Disposition: form-data; name=""ctl00$MainContent$SingleOrder1$txtAddress""" & vbCrLf & _
"" & vbCrLf & _
"700 Test Street" & vbCrLf & _
"
7d72114510340" & _
"" & vbCrLf & _
"Content-Disposition: form-data; name=""ctl00$MainContent$SingleOrder1$txtCity""" & vbCrLf & _
"" & vbCrLf & _
"Denver" & vbCrLf & _
The data I want to take for State Information is street address (seen here as 700 Test Street and city name (seen here as Denver)
Please advise.
Regards.
Comments
create 2 columns street_no and city in stae info table
dim street as string = stateinformation.get("street_no")
dim street as string = stateinformation.get("city")
where you find this "700 Test Street" replace with street
where you find this "denver" replace with city
if you want put me.logtofile(street & " " & city) check in Ants trace log file under C:\program files\ANTS Load directory.
Guru