I am using data provider to pass parameters in testng and want to print custom testcase name (it will be based on the type of data I am passing to the testcase). How do i do it?
Parameters in Dataproviders looks like what you want.
If you declare your #DataProvider as taking a java.lang.reflect.Method
as first parameter, TestNG will pass the current test method for this
first parameter.
That bit of documentation also provides an example.
Related
This is my code
Pipeline
Pipelets java
Pipelets XML
I'm passing a parameter(SKUs) value into a pipeline from js.
The value is getting passed into the pipeline but not into pipelets.
It gives me parameter SKUs in not available.
Thanks in Advance
you are trying to pass a String to a List. You could try again by making Pipelet Input Parameter "SKUs" type "java.util.List<java.util.String>".
If your SKUs parameter is passed to the pipeline using JS client (via post or get), your pipelet needs to process type String[].
I have created a report definition under -Data layer and I have set parameter there as a filter.
Now, I want to call this report under work layer and pass the parameter using activity.
How can I do that ?
Well best practice is to call that Report Definition through a parametrized Data Page if parameters are very few.
Any way you can still pass those parameters to any called Activity by using bellow steps.
Create one Property-Set method before calling report definition and set these parameters.
Param.pyReportName = "YourReportName"
Param.pyReportClass = "YourReportClass"
Param.pyPageName = "PageName"
Param.GradeParameter = "ValueOfGradeParameter"
Now call the report calling activity(your 6th step) with Pass current parameter page check box checked. By checking this check box you can pass all the parameters to the called Activity which you set in the main Activity.
I would like to be able to generically access a list\dictionary of parameters from within an action. I know its possible to do this from within an ActionFilter by using:
ActionExecutingContext.ActionDescriptor.Parameters
But, I can't figure out a way to access that same list from within the action itself.
Backstory:
The end goal is for all of my actions to call the same function. The function will accept a stored proc name, and a list of parameters, then execute the stored proc using the supplied parameters. I have created each action so that the actions parameters are the same name\type as the stored proc parameters. Using this setup, I want to be able to just send the list of parameters associated with the action to a single generic call.
I have tried using:
HttpContext.Request.Query
But, that won't work, because I could have some action parameters that aren't required and have a default, these don't show up in the http query, and I still need them to be passed into my generic function.
"ModelState" is what I was looking for, it has everything I need, including the default values of the parameters that weren't in the query string.
I have a generated Ecore model - works perfectly fine.
what I now do is, create an instance of the model programmatically and load it:
EARepository repository = EaadapterFactory.eINSTANCE.createEARepository();
repository.setFile(f);
repository.load();
Now I can call the methods like
repository.getName();
works fine!
My Problem: I want to customize the behavior of getName() now!. I would like to set a decorator here, like the genmodel does. E.g. the getName() method should return "no value set" if it has no value set.
Is it possible to customize the getName()'s behavior method here, like setting a decorator ?!
Reason: I want to keep the original behavior of the model. But in one of my use cases, the model should behave a little bit different.
thanks
Generally you should be using the generated item providers for producing the labels you see in the UI. I.e., there is a generated EARepositoryItemProvider with a getText method that you'd specialize for this purpose.
I would like to be able to pass a variable a string variable to the ITestResult so that I can do something with it on a pass and failure.
I have a build number that is pulled off the screen and stored in a build variable. I then would like to be able to use this build variable after the test has passed or failed to report the results back to the database with this custom build text.
Does anyone know if this is possible?
You can use ITestContext#{s,g}etAttribute.