Hello everyone,
I am fairly new to MACT, I am currently trying to parse the
oResponse.Body to retrive a dynamic values...store in an array and then
randomly post those values.
Does anyone have any sample code on how to parse the oResponse.Body?
This is what I have so far but I cannot seem to get the value I'm
trying to pick up.
I have been struguling on getting this values for a couple of days now.
The line of source code I'm trying to pickup displays as follows:
<form name="form2" action="/emobile/l.cfm" method="post">
<input type="hidden" name="params"
value="RAND;392 8;P_TYPE;0;MYST ATUS;5;AREA;2;S D;0;SEARCH;Sear ch;"/>
I would like to grab value and store it somewhere.
Thanks in advance.
'--------------------------------------------
' Here I'm posting my random search critieria
' and then it will return a page with the results in a form
' of links. The links area property address'
'
Sub SendRequest9()
Dim oConnection, oRequest, oResponse, oHeaders, strStatusCode
If fEnableDelays = True then Test.Sleep (20051)
Set oConnection = Test.CreateConn ection(sSiteNam e, 80, false)
If (oConnection is Nothing) Then
Test.Trace "Error: Unable to create connection to " & sSiteName
Else
Set oRequest = Test.CreateRequ est
oRequest.Path = "/emobile/l.cfm"
oRequest.Verb = "POST"
oRequest.HTTPVe rsion = "HTTP/1.0"
oRequest.Encode Body = False
set oHeaders = oRequest.Header s
oHeaders.Remove All
oHeaders.Add "Accept", "image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel,
application/vnd.ms-powerpoint, application/msword, */*"
oHeaders.Add "Referer", "http://" & sSiteName &
"/emobile/cr.cfm"
oHeaders.Add "Accept-Language", "en-us"
oHeaders.Add "Content-Type",
"applicatio n/x-www-form-urlencoded"
oHeaders.Add "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR
2.0.50215)"
'oHeaders.Add "Host", sSiteName
oHeaders.Add "Host", "(automatic )"
oHeaders.Add "Pragma", "no-cache"
oHeaders.Add "Cookie", "(automatic )"
oHeaders.Add "Content-Length", "(automatic )"
' Test.TraceLevel = -1
oRequest.Body = "rand=8833&p_ty pe=" & GetRandomProper tyType &
"mystatus=" & GetRandomStatus & "area=" & GetRandomArea &
"st=&street nu"
oRequest.Body = oRequest.Body + "m1=&streetnum2 =&zip_code=&lp1 =" &
GetRandomPrice1 & "lp2=" & GetRandomPrice2 & "br1=" & GetRandomBed1
oRequest.Body = oRequest.Body + "br2="& GetRandomBed2& "ba1=" &
GetRandomBath1 & "ba2=" & GetRandomBath2 &
"sf1=&sf2=&lsz1 =&lsz2=&unt1=&u nt2"
oRequest.Body = oRequest.Body + "=&sd=0&Search= Search"
Set oResponse = oConnection.Sen d(oRequest)
If (oResponse is Nothing) Then
Test.Trace "Error: Failed to receive response for URL to "
+ "/emobile/l.cfm"
Else
strStatusCode = oResponse.Resul tCode
End If
oConnection.Clo se
End If
End Sub
'---------------------
' here I am trying to parse the oResponse.body but get
' nothing using the InStr towards the end of the Sub. I also tried
' the code on the sub above right after the If (oResponse Nothing)
' Then
Else
'Begin params parsing
Sub SendRequest10()
Dim oConnection, oRequest, oResponse, oHeaders, strStatusCode
Dim oUser, Pos1, Pos2, sParams
If fEnableDelays = True then Test.Sleep (287)
Set oConnection = Test.CreateConn ection(sSiteNam e, 80, false)
If (oConnection is Nothing) Then
Test.Trace "Error: Unable to create connection to " & sSiteName
Else
Set oRequest = Test.CreateRequ est
Set oUser = Test.GetCurrent User
oRequest.Path = "/emobile/l.cfm"
oRequest.Verb = "GET"
oRequest.HTTPVe rsion = "HTTP/1.0"
set oHeaders = oRequest.Header s
oHeaders.Remove All
oHeaders.Add "Accept", "*/*"
'Test.Trace("** *************** *********" & oUser.Name & "
RETRIEVING RESULTS******** *************** ***")
oHeaders.Add "Referer", "http://" & sSiteName &
"/emobile/l.cfm"
oHeaders.Add "Accept-Language", "en-us"
oHeaders.Add "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0;
Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR
2.0.50215)"
'oHeaders.Add "Host", sSiteName
oHeaders.Add "Host", "(automatic )"
oHeaders.Add "Cookie", "(automatic )"
Set oResponse = oConnection.Sen d(oRequest)
If (oResponse is Nothing) Then
Test.Trace "Error: Failed to receive response for URL to "
+ "/CFIDE/debug/images/topdoc.gif"
Else
'Begin params parsing
If InStr(oResponse .Body, "params") Then
Pos1 = InStr(InStr(oRe sponse.Body, "params"), oResponse.Body,
"value=")
Pos2 = InStr(Pos1, oResponse.Body, "/>")
sParams = Mid(oResponse.B ody, Pos1, Pos2)
Test.Trace "params 2= " & sParams
End If
strStatusCode = oResponse.Resul tCode
'Test.Trace "params = " & sParams
End If
oConnection.Clo se
End If
End Sub 0 2142 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: 50295 |
last post by:
Hi!
I'm trying to set the align property/attribute of an IFrame to center
but its not working (see below). Can anyone please tell me what's going
on, and if there's a work around for this?
Thanks,
- Olumide
|
by: Anthony Abbot |
last post by:
Hi
I have a requirement to use the Application Center Test
(part of Visual Studio.Net Enterprise architect) program,
to simulate loading on my Web servers. Does anyone know
if it is any good? I have gotten it to work and it seems
to do the job.
I have a requirement to run multiple tests from many
computers simultaneously. The manual seems to hint that
|
by: benh |
last post by:
Does anyone have any insight into how Application Center Test handles
binary data in a response body?
My problem:
I need some specific data from inside a PDF file that is coming down
as the response body. The response contains binary data mixed with
plain text which is where my data lies. Unfortunately, when I print
the response body to the Trace Log it is truncated. The response
ContentLength is about 21,000 bytes so I have used...
|
by: cpavon |
last post by:
Hello everyone,
I am fairly new to MACT, I am currently trying to parse the
oResponse.Body to retrive a dynamic values...store in an array and then
randomly post those values.
Does anyone have any sample code on how to parse the oResponse.Body?
This is what I have so far but I cannot seem to get the value I'm
trying to pick up.
|
by: AA |
last post by:
This is making me crazy!!
Please, if some body can help me.
I'm testing a ver simple socket client.
In my test I just open and close a connection (in a loop) to my local IIS
server (port 80)
using System.Net.Sockets;
| |
by: sokolo |
last post by:
Hello,
I wrote a windows service application however it is not working. The
service is supposed to enter a new task every 5 sec within Microsoft
Outlook.
Here is the code for application:
public partial class CheckAccountsService : ServiceBase
{
|
by: mudasserrafiq |
last post by:
I am using following asp file default.asp
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="0 Days" name=revisit-after>
<META content=info@siderinternational.com name=email>
<META content="Omer Safdar" name=author>
<META content=MegaStudios.com name=publisher>
<META content="Copyright ©2005 - MegaStudios.com" name=copyright>
<SCRIPT...
|
by: SilentCodingOne |
last post by:
I'm creating an application that allows the user to create, edit and begin to post ads to Craiglist. I have everything but the begin to post the ad portion complete and cannot seem to get it to work. I basically want it to send the data the user has put into the ad so that the user does not need to do anything until they get to the 2nd page of the post attempt where a person would complete the process by answering the captcha question. I have it...
|
by: morrisqueto |
last post by:
Hello,
One of my websites just started sending a new rare error. The site has been working for almost 2 years without trouble, but today morning started giving away this error in all my views.
Microsoft VBScript runtime error '800a01fb'
An exception occurred: 'MoveNext'
/test.asp, line 544
Here is the code:
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |