I have a Ranorex project* with two params which I have defined in Global Parameters and bound to modules in the test case. When I look at Global Parameters for the project, it says they are [Unbound] in the Module Variable column:
but in the Data Binding for the test case it shows them bound:
I have tried passing the parameters when trying to run the exe from the command line, as well as when running in debug mode using values entered in the Start Options from the Debug pane of the project parameters.
In either case the parameters are simply not being found by the project while running.
i am calling it from the cmd line thus:
$ src/main/resources/downloadAndInstall.exe /pa:downloadUrl="http://www.aone05281242.com/index.jhtml?partner=^1242^yyyyyy^YYA&sandbox=false" /pa:hostEntriesText="127.0.0.1 localhost"
output includes this line:
[2015/05/28 14:00:54.223][Info ][Data]: Current variable values:
$hostEntriesText = ''
As you can see it doesn't even report the other variable that I'm passing.
I also tried it without the quotes around params but that didn't help. Also, my second parameter actually has multiple lines so I'm not sure how to ensure I pass it correctly. However, I tried it with a single line for that param to eliminate it as a source of the bug. No joy. I'm pretty frustrated. Please help...
* "Well there's your first problem, you're trying to use Ranorex"
I don't think this is a bug.
There are two different types of parameters
param|pa:<global parameter name>=<value>
Creates or overrides values for global parameters specified in the test suite.
testcaseparam|tcpa:<name or guid of test case>:<parameter name>=<value>
Creates or overrides values for testcase parameters specified in the test suite.
You are using the global parameters in your call, but the variables are bound to the test case parameters.
Try to use the test case parameters.
Related
I am trying to work out how to pass a particular piece of data in a POST via a Visual Studio Web Test, without it being recognized and treated as a Context Parameter.
The POST contains a (string) body that is a json document. Part of the body includes something like the following:
"My Attribute":"Some test surrounding this {{SomeValue}} other stuff"
The issue is that the Web Test is trying to match {{SomeValue}} to a Context Parameter (which doesn't exist) and so this request fails.
The value is legitimate, and needs to be sent with the request as is.
I've done some Googling and can't find any documentation that talks about, for example, escaping this string so that the value will be passed correct, and won't be treated as a Context Parameter.
I guess I could write a Web Test plugin to intercept this particular request, and do some token replacement, but that feels like a sledgehammer approach.
Any other ideas?
You could create the context parameter SomeValue and set its value to {{SomeValue}}.
You could create the two context parameters OpenDoubleCurly and CloseDoubleCurly set to the values {{ and }} respectively. Then modify the POST text to be:
"My Attribute":"Some test surrounding this {{OpenDoubleCurly}}SomeValue{{CloseDoubleCurly}} other stuff"
Normally web tests only do one level of context parameter expansion. You need to use (or for this question avoid using) plugins that do multiple expansion passes.
I have a project in TeamCity and I am trying to update one of its inherited parameter's values, the parameter is inherited from the parent project and has a blank value.
When I PUT a new value against the API, a new parameter with the same name is created with the correct value, but the inherited parameter's value remains blank.
I am using the C# the FluentTC library to do this but I have also tried using the TeamCity REST Api directly.
var teamCity = new RemoteTc()
.Connect(h => h
.ToHost("teamcity")
.AsUser("someUser", "somePassword));
teamCity.SetProjectParameters(project =>
project.Id("someProjectId"), buildConfig => buildConfig.Parameter("someParameter", "4"));
The documentation for the above code can be found under the "Set project parameter" here.
Any help would be greatly appreciated.
I had this problem for quite a while, which confused me because the request and response all looked good.
Eventually I found that I had edited the inherited value in the child project, which was causing the problem. It was always using the overridden value because I was accessing the parameter in the build steps of the child project.
To solve I pressed the 'reset' button against the parameter in the child project's properties, and this constant override was removed. The value turned from black to being greyed out, showing the true value of the parameter in the base project, which is the one that the REST api updates.
When using DoFixture I can set a domain object as System Under Test which allows me to call methods on that object instead of the fixture itself.
Unfortunately, if such a method requires more than one parameter I have to separate those parameters with empty cells because otherwise fitnesse/fitSharp uses odd/even cells to build up the method name. I can see how this makes my tests to resemble plain English better, but it's not really feasible to start renaming domain object methods just to satisfy test framework requirements.
For example, say I want to call method Entry AddEntry(string name, string description) and store the result as symbol e1. If I try the following table:
|name|e1|add entry|sample name|sample description|
it will try to find a method named AddEntrySampleDescription and pass it a single parameter "sample name".
I can do
|name|e1|add|sample name|entry|sample description|
but it just doesn't look right.
So, what I ended up doing is (note the extra empty cell between the parameters)
|name|e1|add entry|sample name||sample description|
which does what I want and isn't as ugly as the option #2 but it still seems like a hack. Do I miss something or is that actually the way to call methods on domain objects?
You can add the empty cell between parameters - this is a widely-used technique. Or you can use SequenceFixture:
http://fitnesse.org/FitNesse.UserGuide.FixtureGallery.FitLibraryFixtures.SequenceFixture
SequenceFixture is very similar to DoFixture and has almost the same
features — in fact the only difference between those two is the naming
convention for methods. Instead of using odd cells to construct a
method name, SequenceFixture takes the first cell in each row as the
method name, and all other cells as arguments
I have created a webtest in visual studio to perform a test on a Rest API.I have some code that generates a random serial number that i need to pass into my QueryString parameter is there anyway to do this? I noticed that i can bind xml, csv and a database to it for Dynamic values. Would i have to change my code to wright to a xml file or is it possible to perform a direct call to the method inside the .cs file? C# Langauge.
I want to do something like in the below method but i want the sessionToken.sessionToken() to be the method that was called from the .cs file.
QueryString Parameters
generatedToken=sessionToken.sessionToken()
Write your code within the PreRequest method of a Web Test Request plugin, or call your method from the plugin. One of the last statements of the plugin should write the generated value to a context parameter, with code something like:
e.WebTest.Context["YourContextParameter"] = TheGeneratedValue.ToString();
The value of the query string parameter can then be in one of these styles
{{YourContextParameter}}
or
Some text{{YourContextParameter}}more text
With a little more effort you can pass the context parameter name as a parameter of the plugin.
It can be useful to add diagnostics from the plugin into the log; to showit has been called and to record its output. This can be done with a statement of the form:
e.WebTest.AddCommentToResult("Plugin result is " + TheGeneratedValue.ToString());
Another approach is to convert the entire webtest to a coded test, by using one of the command icons just above the webtest. That produces C# that you can edit as much as you want. However, that conversion is a one-way process. After doing it you cannot use the webtest editor to further change the test. Hence I recommend the plugin route.
I am trying to pull report parameters from the report server using ReportService2010 proxy, but I noticed ValidValue[] array from the returned ItemParameter[] array comes as null if the values are query-based.
Is there a way to return them directly or do I have to use the query used for retrieving the parameter values?
This link has the information you need:
Using GetReportParameters in Reporting Services
In short, the first thing you must do is set the forRendering parameter to true when calling to GetItemParameters.
If you have parameters with valid values from a query that uses other parameters, then you may need to call GetItemParameters several times until all dependencies are resolved. See the link for the complete explanation.