cancel
Showing results for 
Search instead for 
Did you mean: 

how can i list all the Httprequest BodyVariables Item names ?

Highlighted
New Contributor

how can i list all the Httprequest BodyVariables Item names ?

How can i list all the Httprequest BodyVariables Item names ?

HTTPTask.Connection(0).Request(0).BodyVariables ????



--- i can get the value for the speical name

HTTPTask.Connection(0).Request(0).BodyVariables.item("login")
1 REPLY 1
Highlighted

RE: how can i list all the Httprequest BodyVariables Item names ?


Hi,





There are no built-in means to retrieve body variables' names. I have registered your request as a suggestion in our DB. Thank you for your post.





I suggest that you use the function below to get their names.





    function Test()

    {

    var request = HTTPTask.Connection(0).Request(0);

    var pairs = request.RequestBody.Contents.split("&");

    for (var i=0; i < request.BodyVariables.Count; i++)

    {

        Log.Message(pairs.split("=")[0]);

    }

}

-----

Alexander
Customer Care Manager
New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare images using the Region Checkpoint

See replies!

Converting UTC TimeDate in an Excel file

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors