Variables are not getting mapped under Variable binding (API Test) - web-services

Katalon Studio Version: 5.9.1
Steps to reproduce:
I am working on API Tests using Katalon.
I created a REST request and called that in my test case. I also have couple of variables in my request body, which I am trying to parameterize from Data File.
I have added the variables under Variables tab in the Request Object.
When I create a test suite and add the test case under test suite, in the Data Binding section, variables are not getting mapped with the test data columns.
Expected Behavior:
The variables should be mapped with the test data sheet columns.
Actual Behavior:
Test Data are not getting mapped with data sheet columns.
Note - I am not able to attach the screenshots because of restrictions in office network, but I can help with details if required.

Related

How to Exclude Application Definition from Import in Oracle Apex

I need to have different values in substitution strings in DEV and PROD. How do I prevent overwriting the substitution strings when updating PROD. DEV and PROD are in separate databases.
I don't see how to exclude the application definitions in build options.
Is there a better way to meet this requirement?
Thanks
The way I see it, substitution strings are application items defined as constants. Only use them for strings that are always the same in any deployment instance of the app. As soon as the value needs to be changeable (for example dev has different value than prod), use application items instead.
If you insist on doing this with build options then this is an option:
Set the values of the application items using a computation or an application process (this is for for production).
Create a 2nd set of computations or an app process with a sequence higher than the sequence of the one above (so this will override the original values) and set a build option on those (exclude on export).
That way, when you export the app, only the first set of computations / app process will be included.
However, my preference is to configure this in the database and have a settings table that has a record indicating the status of the environment (prod/dev/stage/uat) and store the strings in a custom messages table (one record per app status/application item) . In an application process or computation get the value of the application items. The reason I prefer this is that the app doesn't need to know if it is dev or prod, but the database should. This option has a couple of challenges if the same database and schema is used for prod and dev.

Getting error, "Entity doesn't exist in AsyncLocal" when trying to call CreateBatchWrite<T> method of DynamoDBContext object

I have created a DynamoDb table in my dev machine and I'm trying to insert couple of rows from my .NET Core application using the CreateBatchWrite<T> method of DynamoDBContext object. I'm able to query the table from DynamoDB Javascript Shell window from the localhost:8000/shell url and it returns row count as 0. But when trying to call the CreateBatchWrite<T> method I get the error, "Entity doesn't exist in AsyncLocal".
Explanation
When using X-Ray, this happens when there is an attempt to create a SubSegment without a Parent Segment. Depending on your setup, when you run a query it might try creating a SubSegment, but it's failing because there is no parent segment.
This is common when running a Lambda function locally, as the Mock Lambda Test Tool will not create a Segment for you like the actual Lambda environment does on AWS. This can happen in other scenarios too.
More details here: https://github.com/aws/aws-xray-sdk-dotnet/issues/125
Solution
Easiest way to solve this is disabling X-Ray locally (as you probably don't want to generate traces locally):
In appsettings.Development.json add this:
"XRay": {
"DisableXRayTracing": "true",
"UseRuntimeErrors": "false",
"CollectSqlQueries": "false"
}
The important bit is the DisableXRayTracing equals true.
Make sure your appsettings.Development.json is set to Copy Always in the properties window. You can do this by including this in your .csproj:
<ItemGroup>
<None Update="appsettings.Development.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
If you really want to trace things locally, then make sure you create
a parent segment only when running locally (on AWS this would cause
problems as you would have two parent segments, one created manually
by you, another one created by AWS).
Add this line before any DynamoDB API methods are executed:
AWSXRayRecorder.Instance.ContextMissingStrategy = ContextMissingStrategy.LOG_ERROR;
You can find more info in GitHub discussion https://github.com/aws/aws-xray-sdk-dotnet/issues/69#issuecomment-482688754
Also, you will need to import these 2 packages.
using Amazon.XRay.Recorder.Core;
using Amazon.XRay.Recorder.Core.Strategies;
If you are tracing requests made with the AWS SDK, the X-Ray SDK attempts to generate a subsegment automatically to represent those requests, such as CreateBatchWrite. However, a subsegment can only be created as the child of an existing Segment, so if you have not created a segment beforehand that Entity doesn't exist error will occur.
See these docs for how to create custom segments. Alternatively, if you are developing a web app, the X-Ray SDK can automatically create segments for requests made to your service by adding configuration described in these docs

Not able to use regular expression extractor variable from one test plan to other test plan in jmeter

I am performing load testing using jmeter. I created a test plan with https request and used regular expression extractor to extract variable returned from first https request.
Variable: csrftoken
Regular Expression: value="(.*)"
Template: $1$
Match Number: 1
Default Value: EMPTY
2.Used JSR223 Postprocessor and verified that the extracted variable are correct.
log.info("***************************"+vars.get("csrftoken"));
I Created new test plan for signin request were I'm using the variable which was extracted in first test plan and defining the variable in parameters as
csrfmiddlewaretoken : ${csrftoken}
email : xxxxxxxx#gmail.com
password : Password
But ${csrftoken} variable are not getting picked up when I run the request.
Is there any other possible way to make use of variable from one test plan to other test plan and run the request with the same variable.
Help would be really appreciated!!
Thanks in advance.
What do you mean by "test plan", if you referring to this Test Plan and want to pass the value between 2 separate .jmx test scripts - the only way to do it is to write the CSRF token(s) into a file using i.e. Flexible File Writer in one test plan and read it back using CSV Data Set Config in another test plan
As per JMeter Documentation on variables, Variables are local to a thread to you cannot access a JMeter Variable anywhere but within the bounds of single thread (virtual user) context, you cannot even access it in the different Thread Group, not talking about different test plans.

Run next request with new iteration data from json by using setNextRequest in postman

I have a case where i have a folder in a collection which has to run for a specific set of iterations before going to the next folder.
There is no direct feature in postman yet which allows you to set different iterations at each folder level and still run the collection as whole.
I want to run a specific request in a folder with all the testdata i provide in a json and then move to the next request as per the collection folders.
I tried achieving the same using setNextRequest in the same request which has to be run multiple times but with different data.
However, it runs the same data again for the second time as well and through the runner it goes to iteration 2 which was set to 2 at collection level as well.
How can I achieve my usecase.

Kohana 3.1 Web Services Bootstrapping Based on Environment and Stored Like A Session

We are building a n-tiered style application in Kohana 3.1 which distributes JSONP powered widgets to our partners based on a partner_id.
Each partner needs to be able to call a widget and specify an environment parameter: test OR production with the initial call, which will be used to select the appropriate database.
We need our bootstrap to watch for $_REQUEST['environment'] variable and then to maintain the state of that variable whenever the partner makes a call to the widget service.
The problem is, that all requests in the application use Bootstrap.php, but many of the requests are internal - i.e. they do not come with a partner_id or environment variable. We tried to use sessions to store these, but as these are server-to-server GET/POST calls, it does not seem possible to store and recall the session id in a cookie on the server (this is browser-less GET).
Does anyone have any suggestions? We realise we could pass the environment variable with every single call internal or external, but this does not seem very robust.
We have a config file which stores partner settings (indexed by partner_id), such as the width and height of the widget and we thought about storing the partner's environment in here, but not all calls to the server would be made by a partner, so we would still need another way to trigger the environment for other calls and select the correct DB.
We also thought of storing a flat file for the partner which maintains the last requested environment, but again, as we have many internal requests after the initial one, we don't always have a knowledge (i.e. we don't usually care) which partner_id is used in the initial call.
Hope this makes sense...!
The solution would be to call the models and methods that are needed to 'do stuff' from a single controller, keeping the partner_id only in the controller and sending the requested data back once all of the 'do stuff' methods have been run, as per the MVC model.
i.e., request from partner -> route -> controller -> calls models etc -> passes back to controller -> returns view to partner
That allows the partner_id to be kept by the controller and only passed to whatever models require it to 'do stuff', keeping within the MVC framework.
If you've not kept within the confines of MVC, then things will obviously get more complex and you'll need to store the variable somewhere.