How to pass a global variable to the HTTP body (form-data)? - katalon-studio

I am currently using Katalon Studio (V 6.1.4) to test webservices and i am just starting with katalon.
My question is how can i pass a global variable to the HTTP body?
Thanks in advance

There is a detailed tutorial about this topic: https://docs.katalon.com/katalon-studio/docs/parameterize-a-web-service-object.html#query-parameters
You need to use code like this:
findTestObject('myTestObject', [('yourParam') : GlobalVariables.yourGlobalVar]))

Related

Search results using the github API

I am using the following query:
https://api.github.com/search/repositories?q=mysql&created:%3C2009-04-11&order=asc
and see the same results as:
https://api.github.com/search/repositories?q=mysql&created:%3E=2013-04-11&order=asc
Looks the created is not taking into effect.
can you please help me if I am missing anything in the query?
At document of REST API v3, parameters are added using +. So how about the following modification?
From :
https://api.github.com/search/repositories?q=mysql&created:<2009-04-11&order=asc
https://api.github.com/search/repositories?q=mysql&created:>=2013-04-11&order=asc
To :
https://api.github.com/search/repositories?q=mysql+created:<2009-04-11&order=asc
https://api.github.com/search/repositories?q=mysql+created:>=2013-04-11&order=asc
If I misunderstand your question, I'm sorry.
Edit :
When you want to retrieve the data using curl, please use as follows. In this case, please enclose the URL using double quotations. The URL in this sample is from your comments.
curl "https://api.github.com/search/repositories?q=python+created:%3E2009-04-11&page=1"
or
curl "https://api.github.com/search/repositories?q=python+created:>2009-04-11&page=1"

Got an error in the IBM Bluemix Weather Insights API used. Kindly help me out

I am referencing the documentation page here:
https://developer.ibm.com/bluemix/2015/10/23/ibm-insights-weather-available-in-bluemix/
But I'm getting the following error :
{"metadata":{"version":"1","transaction_id":"1:677162605","status_code":404},"success":
false,"errors":[{"error":{"code":"AGW-0114","message":"Failed to parse apiname"}}]}
My Constructed URL is :
https://****:*****#twcservice.mybluemix.net/api/weather/v2/forecast/&format=JSON&geocode=11.9310,%2079.7852&language=en-US&units=e
Kindly help me with this issue .
The constructed url needs to be like this:
https://twcservice.mybluemix.net/api/weather/v2/forecast/hourly/24hour?format=JSON&geocode=11.9310%2C79.7852&language=en-US&units=e
The differences are:
call the REST API /forecast/hourly/24hour rather than just /forecast
Add the ? at the end of the API so you pass the parameters
Add the %2C in the geocode to represent the ,
See swagger doc here

How to call REST service by setting Matrix Params using Camel-Http4 component?

I have a problem trying to use Camel-http4 component. What I want to do is to set from my camel route the Matrix Params that the REST service needs to work properly. Is there any way to do that?
Thank you,
Roxana
Using traditional query parameters, the Camel URI looks as follows:
from("direct:start")
.to("http4://oldhost?order=123&detail=short");
Thus, using matrix parameters should work as well:
from("direct:start")
.to("http4://oldhost;order=123;detail=short");
Edit:
Use Exchange.HTTP_URI for dynamically setting the properties or use recipientList such as:
from("direct:start")
.recipientList(simple("http4://oldhost;order=${header.123Header};detail={{value.from.cfg}}"));

fiddler - can I output requesting client ip/name?

Using the code here shows how to add a column:
http://fiddler2.com/documentation/KnowledgeBase/FiddlerScript/AddColumns
What I'd like to know, though, is the ip (or name) of the client issuing the request. Is that possible to determine?
Thanks,
Ben
I believe you can grab this off Session object that is passed in. So in the code example in the article you link to you would set the value of you column to oS.clientIP.
For convenience the complete code you have to insert into the Handlers class:
public static BindUIColumn("ClientIP")
function ColClientIP(oS: Session){
return oS.clientIP;
}
This is now available from the UI using Customise Columns and the session flag X-clientIP. Now means V5.0.20211 of Fiddler Classic. Probably been there for some time.

How can I check my post data in Zend?

I am a beginner and I am creating some forms to be posted into MySQL using Zend, and I am in the process of debugging but I don't really know how to debug anything using Zend. I want to submit the form and see if my custom forms are concatenating the data properly before it goes into MySQL, so I want to catch the post data to see a few things. How can I do this?
The Default route for zend framework application looks like the following
http://www.name.tld/$controller/$action/$param1/$value1/.../$paramX/$valueX
So all $_GET-Parameters simply get contenated onto the url in the above manner /param/value
Let's say you are within IndexController and indexAction() in here you call a form. Now there's possible two things happening:
You do not define a Form-Action, then you will send the form back to IndexController:indexAction()
You define a Form action via $form->setAction('/index/process') in that case you would end up at IndexController:processAction()
The way to access the Params is already defined above. Whereas $this->_getParam() equals $this->getRequest()->getParam() and $this->_getAllParams() equals $this->getRequest->getParams()
The right way yo check data of Zend Stuff is using Zend_Debug as #vascowhite has pointed out. If you want to see the final Query-String (in case you're manually building queries), then you can simply put in the insert variable into Zend_Debug::dump()
you can use $this->_getAllParams();.
For example: var_dump($this->_getAllParams()); die; will output all the parameters ZF received and halt the execution of the script. To be used in your receiving Action.
Also, $this->_getParam("param name"); will get a specific parameter from the request.
The easiest way to check variables in Zend Framework is to use Zend_Debug::dump($variable); so you can do this:-
Zend_Debug::dump($_POST);
Zend framework is built on the top of the PHP . so you can use var_dump($_POST) to check the post variables.
ZF has provided its own functions to get all the post variables.. Zend_Debug::dump($this->getRequest()->getPost())
or specifically for one variable.. you can use Zend_Debug::dump($this->getRequest()->getPost($key))
You can check post data by using zend
$request->isPost()
and for retrieving post data
$request->getPost()
For example
if ($request->isPost()) {
$postData = $request->getPost();
Zend_Debug::dump($postData );
}