Best Of
"No Projects Found" when trying to import IAR project to parasoft C/C++test
Hi,
I am trying to import an IAR project into parasoft according to the instructions written here: https://docs.parasoft.com/display/CPPDESKE1033/Importing+Projects+with+IAR+Embedded+Workbench+Support
I enter the path and click refresh and no project is found. I even tried selecting in the path the actual project files (either eww or ewp) and still it says no project found.
I tested and the project opens fine in IAR and works without any issue.
I have Parasoft C/C++test Professional Version 2021.1.0(10.5.1.20210505B1390)
How can this be resolved?
Re: Why my access to parasoft360 denied?
Dear Jasmeen,
Please get in touch with Parasoft support using the customer portal. Your account may not yet approved.
I checked your account. Indeed, your account wasn't associated with your company. Please log back into the Customer Portal. You should have access to Parasoft360.
Re: Need to access application database for test data used in Selenic tests
@Speedy993 I think you added this comment to the wrong thread!
Re: Trying to Switch to a New Browser Tab Opened By The App
Because you are expecting a PDF document in the open window and Browser Testing Tools do not validate PDF content, it would probably be best for you to add some kind of validation to the request made by the browser for the PDF document. You will first need to add application/pdf to the binary MIME Types allowed in the Traffic Viewer and Outputs under Preferences> Parasoft> Browser> Allowable Binary Files in Traffic Viewer and Outputs> MIME types. When you play back your scenario you should see your PDF request in the traffic viewer for the step that opens the PDF document. If you do not see it, try adding an additional "Wait for Specified Time" wait condition to the step to ensure the file has had enough time to transfer.
Then you will right-click the Browser Testing Tool that contains the request to the PDF and choose Add Output... > HTTP Traffic and select the request for the PDF. Choose Response > Body and then you can add a tool to verify the PDF content, such as a Search Tool that searches for the term %PDF and "Display Message If Search Term: Not Found."
For reference, you can access windows by their index only using a special name in this format:
;index:N where N is the order in which the window appeared, starting at 0 for the first window. For reference, the complete format is windowName;index:N where windowName is the expected name of the window. windowName will first be used to identify the window and then the index. For this reason, window name is optional and so the format ;index:N can be used to only specify the index.
To use this special name in the Browser Testing Tool, under User Action change the Window to "Custom" and enter a value such as:
;index:1
Re: Adding IMS Transport via SOAVIRT API
Try making a GET - /virtualAssets/{id} call on a preconfigured asset to ensure you're using the correct classname for your custom listener.The following payload updated my deployment successfully. Give it a try.
{ "name": "ims_listener_test", "pvaLocation": { "id": "/VirtualAssets/ims_listener_test.pva" }, "enabled": true, "description": "Testing IMS listener deployment using REST API", "transports": { "http": { "path": "/ims_listener_test" }, "custom": { "className": "com.parasoft.virtualize.listener.ims.ImsMessageListener", "properties": [ { "name": "numThreads", "value": "100" }, { "name": "port", "value": "12345" } ] } } }
Re: How to add a stub for a Class member function?
@sorel ,
The stub code that you provided does not look right, but I assume that some of the issues came from the stub code being interpreted by HTML renderer of this forum post. In any case, I created a stub like this and it works fine:
int (::A::CppTest_Stub_Foo) (void) { CPPTEST_STUB_CALLED("A::Foo"); int __return = 0; if (CPPTEST_STUB_HAS_CALLBACK()) { CPPTEST_STUB_CALLBACK_PARAMS(int* __return, ::A* __this); CPPTEST_STUB_INVOKE_CALLBACK(&__return, this); } return __return; }
A few issues that I can point out in your stub:
1. The stub signature. When stubbing a method of a class, the stub itself has to be a method as well. In your case it is a function: "void CppTest_Stub_Foo()". It would not work as a stub for a class method.
2. The macro "CPPTEST_STUB_CALLBACK" does not exist. It should be "CPPTEST_STUB_CALLBACK_PARAMS".
3. Parameters to "CPPTEST_STUB_CALLBACK_PARAMS" should be pointers - see my example above.
While I could not reproduce the internal compiler error issue with my GNU GCC 9.4.0, I think that fixing the stub code should help.
I would also advise to create user stubs using C/C++test's "Create User Stub" functionality available from "Stubs" view instead of adding stubs manually (see https://docs.parasoft.com/display/CPPTESTPROEC20232/Adding+and+Modifying+Stubs). C/C++test will create all the boilerplate code exactly as needed, with all the proper declarations and stub structure. You can always trim down the auto-created stub code later, after the stub is proven to work.
Re: Both - Traffic Object - What is the input?
The last link I included is now bad. Here are the correct links for enabling OIDC.
SOAtest/Virtualize: OpenID Connect
CTP: Configuring OpenID Connect
DTP: Configuring OpenID Connect
Re: custom script to choose Response by name
Hi,
That tool uses a different approach than what Parasoft tools do. Instead of having to use a script to do correlation, extract values, and build the response much of that can be accomplished using easy to setup tools. The Responder Correlations will take care of matching without needing scripting. XML or JSON data banks can be used to extract values from the request. A DB Tool can be used to execute database queries. All of this can be done without scripting. I doubt that a script taken directly from another tool would work without significant changes.
Re: Re-Deploy VA Not Working
Hi,
For a server that doesn't automatically create a deployment for a pva file one can be created for it using the POST /virtualAssets or the POST /virtualAssets/{id} resources.
The outline for API calls to depoy a pva file and create a deployment for it would
POST /files/upload?id=/VirtualAssets/my.pva&deploy=false
POST /virtualAssets
The query parameter "deploy" on the POST /files/uploads resource can be used to make the process consistent across all servers regardless if they are configured for auto-deployment or not.
If using the resource POST /virtualAssets/{id} then you can explicitly assign a string value that will be used instead of the autogenerated UUID. If the same {id} value is used a second time an error will be returned indicating that id is in use.
As a general workflow for when a deployment may or may not exist then the outline of API calls would be something along these lines
POST /files/upload?id=/VirtualAssets/my.pva&deploy=false
GET /virtualAssets?pvaLocation={pva file id}
if deployment exists, then redeploy
POST /virtualAssets/redeployments
or
PUT /virtualAssets/{id}/enabled false
PUT /virtualAssets/{id}/enabled true
else if no deployment exists, then create one
POST /virtualAssets
or
POST /virtualAssets/{id}
Hope this helps!
Re: Calculate sum of several columns in an XML databank
The simplest way is not to use a Jython script but instead to construct an XPath that uses the XPath sum() function. First you need to construct an XPath that selects all nodes that have the values you want. Next, you pass that XPath to the sum() function. Consider the following example:
<xml> <foo>1.00</foo> <foo>4.15</foo> </xml>
For this example you could create the XPath "sum(/xml/foo/text()))" which will return the value "5.15". You could then use this XPath in an XML Data Bank or XML Assertor tool.