Pass large parameters to browser - api

I created more than 20 reports using crystal report. Now I am integrating them to my API service. One particular report uses the following parameters:
lngCompanyId=1
szITSfromCompany=Sample
strGroupBy=Region
strGroupBy1=Greater Accra
strQuery1='and #tblRetOutletSumm.iRegionID=4'
strQuery2='and #tblRetOutletSumm.iDistrictID=8'
strQuery3='2016-10-27'
strQuery4='2016-10-27'
strPicHeight=1
strPicWeight=1
Now i have to pass them to my web browser to generate the report. I tried the following URL after running the project:
http://localhost:20010/Home/CreateSummaryReport?lngCompanyId=1&szITSfromPersol=Sample&strGroupBy=Region&strGroupBy1=Greater Accra&strQuery1=and #tblRetOutletSumm.iRegionID=4&strQuery2=and #tblRetOutletSumm.iDistrictID=8&strQuery3=2016-10-27&strQuery4=2016-10-27&strPicHeight=1&strPicWeight=1
It broke the code. It passed up to strGroupBy1 which is Greater Accra but when it came to strQuery1, it only showed me the first word which is and instead of and #tblRetOutletSumm.iRegionID=4 and all the remaining parameters threw null values.
I know the '#' tag causes the problem, so how do I pass the parameter? Or should I change a the database procedure?

Changing the '# tag' by ascii symbol solved the issue.
I changed the '#' tag by '%23' and the issue is solved.
Somad

Related

Issues pulling change log using python

I am trying to query and pull changelog details using python.
The below code returns the list of issues in the project.
issued = jira.search_issues('project= proj_a', maxResults=5)
for issue in issued:
print(issue)
I am trying to pass values obtained in the issue above
issues = jira.issue(issue,expand='changelog')
changelog = issues.changelog
projects = jira.project(project)
I get the below error on trying the above:
JIRAError: JiraError HTTP 404 url: https://abc.atlassian.net/rest/api/2/issue/issue?expand=changelog
text: Issue does not exist or you do not have permission to see it.
Could anyone advise as to where am I going wrong or what permissions do I need.
Please note, if I pass a specific issue_id in the above code it works just fine but I am trying to pass a list of issue_id
You can already receive all the changelog data in the search_issues() method so you don't have to get the changelog by iterating over each issue and making another API call for each issue. Check out the code below for examples on how to work with the changelog.
issues = jira.search_issues('project= proj_a', maxResults=5, expand='changelog')
for issue in issues:
print(f"Changes from issue: {issue.key} {issue.fields.summary}")
print(f"Number of Changelog entries found: {issue.changelog.total}") # number of changelog entries (careful, each entry can have multiple field changes)
for history in issue.changelog.histories:
print(f"Author: {history.author}") # person who did the change
print(f"Timestamp: {history.created}") # when did the change happen?
print("\nListing all items that changed:")
for item in history.items:
print(f"Field name: {item.field}") # field to which the change happened
print(f"Changed to: {item.toString}") # new value, item.to might be better in some cases depending on your needs.
print(f"Changed from: {item.fromString}") # old value, item.from might be better in some cases depending on your needs.
print()
print()
Just to explain what you did wrong before when iterating over each issue: you have to use the issue.key, not the issue-resource itself. When you simply pass the issue, it won't be handled correctly as a parameter in jira.issue(). Instead, pass issue.key:
for issue in issues:
print(issue.key)
myIssue = jira.issue(issue.key, expand='changelog')

Jmeter: validating Code in Beanshell Sampler

Here is the simple code
vars.put("str" , "${__time(dd/mm/yyyy HH:MM:SS)}");
log.info("${str}");
I am expecting to see the value of str in logs but I am getting ${str}. I am validating it because I have to assign the current time to a variable and later want to use it in script. But I am not getting the value stored in str.
try as follows using vars.get:
vars.put("str" , "${__time(dd/mm/yyyy HH:MM:SS)}");
log.info("str " + vars.get("str"));
I wouldn't recommend inlining functions and/or variables into Beanshell script as you may face syntax error issues, i.e. type mismatch if the value has quotation marks.
So either use log.info(vars.get("str")); or use Debug Sampler and View Results Tree listener combination to see JMeter variables values.
More information: How to Debug your Apache JMeter Script

DGRAPH Log report DocumentCollectionCategories::GetDocumentScore invalid parameter

I'm looking at our Dgraph.log file and I'm seeing a lot of the following errors. Can anybody point me towards the cause of it? I've verified that my property "p_sort_default" exists and is being populated with data. I'm not sure how to track down where it's being used as a parameter incorrectly.
ERROR 01/02/14 06:02:50.414 UTC DGRAPH {dgraph}: DocumentCollectionCategories::GetDocumentScore invalid parameter "p_sort_default".
This error is due to using a search interface with a dimension search. The search interface was designed to be used with a navigation query which have the parameter "p_sort_default". The dimensions do not have the parameter and are throwing the error. We are setting up a new search interface specific for the dimension search to use to clear up the error.

BeanShell PreProcessor updates User define variables

I'm very new at JMeter issues.
In a test script i have a BeanShell PreProcessor element that updates some variables previously defined at a "User Defined Variables" element.
Latter those variables are used in "Http Requests". However, the value that is used in the http request is the default one.
The scripts seems to be working due to some debug print();
My question is if it's necessary to delay the script to be sure that the BeanShell finishes?
Thanks a lot for your attention
There is no need to put any delay to Beanshell Pre-Processor as it's being executed before request. I'd recommend to check your jmeter.log file to see if there are any scripting issues as Beanshell Pre-Processor does not report errors anywhere including View Results Tree listener.
There are at least 2 ways to assure that everything is fine with your Beanshell script:
Put your debug print code after variables replace logic to see if it fires
Use JMeter __Beahshell function right in your HTTP request. If it's ok - View Results Tree will demonstrate beanshell-generated value. If not - the field will be blank and relevant error will be displayed in the log.
Example test case:
Given following Test Plan structure:
Thread Group with 1 user and 1 loop
HTTP GET Request to google.com with path of / and parameter q
If you provide as parameter "q" following beanshell function:
${__BeanShell(System.currentTimeMillis())}
and look into View Results Tree "Request" tab you should see something like:
GET http://www.google.com/?q=1385206045832
and if you change function to something incorrect like:
${__BeanShell(Something.incorrect())}
you'll see a blank request.
The correct way of changing existing variable (or creating new if variable doesn't exist) looks like
vars.put("variablename", "variablevalue");
*Important: * JMeter Variables are Java Strings, if you're trying to set something else (date, integer, whatever) to JMeter Variable you need to cast it to String somehow.
Example:
int i = 5;
vars.put("int_i", String.valueOf(i));
Hope this helps.
You can update the vale of a "user defined variable".
You have to create a bean shell sampler
vars.put("user_defined_variable", "newvalue");
#theINtoy got it right.
http://www.blazemeter.com/blog/queen-jmeters-built-componentshow-use-beanshell
I'm new to jmeter too but as I know variables defined in "User defined variables" are constants, so you can't change them. I recommend to use "User Parameters" in preprocessors or CSV Data Set Config.

Passing parameters to SSRS from Clarion

I have a SSRS report that need 2 parameters ... I need to call it from Clarion using hyperActive template... Others reports without parameters work good
but for this I'm testing the URL in IE and I got the error..
the parameters are used by stored procedure
http://server/reportserver?/Report.aspx?ItemPath=%2fFoxtel%2fCable%2fTech+Stock+Held&LocationComId=1284&DaysHeld=5
In my report I hidden the parameters, and I receive the error "The 'LocationComId' parameter is missing a value"
some idea why???
I got some answer for this question if someone need in the future from the link
http://www.mssqltips.com/sqlservertip/1336/pass-parameters-and-options-with-a-url-in-sql-reporting-services/