Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
Hi all,
I have automated some MKS functionalities using the CLI option im.exe. I would like to ask if it is also possible to automate the web client and how?
Thanks,
Please give a more detailed use case description.
Hi Matthias,
I wanted to create new queries and create new reports to an excel sheet. I was able to do this using the CLI. But now I want to do this via the Web client, without using any automation tool. If not possible, what open source automation tool is good to used? Selenium?
thanks,
Hi,
I haven't tried it with MKS but I've used Selenium (Webdriver) with Python to automate web interactions in a couple of projects, works very well.
Eric
Hi jdcc,
Our QA department has talked about using either Selenium or one of the HP automation testing tools to automate happy-path regression testing of our integrity workflows when we make changes. They have not found the time to do it, but definitely seems possible.
At the same time, you may be able to build server-side triggers to automate some of the query/report creation. The good thing is that since they are server-side, they will work for both the web and the desktop client.
For example, the Agile Solution template has triggers that automatically create a query and chart when the Sprint item reaches a certain state. The query and chart are based on the data on the Sprint item itself.
The best approach will depend on the details of the queries and reports and how often you need to create them.
If you need to create the queries/reports based on events happening to the items in the system, a rule based trigger would probably work better. If these queries/reports are created periodically, like a monthly metrics/status report, you could either use a scheduled trigger or one of the automation tools you referenced.
Hope that helps,
Matt
Hi Matt,
How do you do the scheduled trigger via the webclient? Is this possible? Please do share how you set that up.
Thanks,
You cannot directly run a trigger via the webUI. I think what Matt is suggesting is to use a trigger to execute the report and then save the output somewhere. This is a very sound approach that I know several customers use.
For example, you set up a custom trigger script to call something like "im runreport --outputFile=in/server/public_html/...", either on a scheduled basis (e.g. nightly) or using a rule-based trigger on some event (e.g. when the parent project changes state). The report is run once, by the trigger, and the static output placed in the server public_html folder, network share, sharepoint site, etc. via your custom trigger code. Then you simply refer to that location for the report.
This has the benefit of caching the report results so there is no waiting for it to run or impact on the server, and ensures everyone who views it will see the same thing.
I'm not sure I'm 100% clear about what you mean when you refer to automation, but if you want to run a report directly in the webUI you can use a hyperlink of the form:
http://{hostname}:{port}/im/runreport?selection={reportname}
I do not believe you can create a query in a similar fashion, but you can pass a query name or query definition (URLEncoded) as extra arguments in the URL above to use a query other than the one defined in the named report.
You might also investigate the Integrity web services if you are looking at a scripted solution that doesn't need a local client installed.
Hi Marcus,
Yes that is what I wanted, basically to automate creating queries and report. The ff is what I intend to do;
- create a query
- create a report for that query
- run the report with an xls spreadsheet output
Is this possible through the web client? And yes you were right, I wish to do this without the need of installing the local client.
Also, can you please elaborate on how you pass a query definition in the URL? Can you please site and example?
Thanks,
Hi jdcc,
I don't believe you can create a named query in the querystring via a single call to the webUI, although I've actually never tried.
My approach would be to create a 'generic' query that returns some potentially useful results, and then create report in the GUI and configure it the way you want using that query. Then if somebody were to execute the report directly, they would get whatever you set up in that generic named query.
For your automated reports, you would create a hyperlink to the same report in the webUI, but pass in a different query definition to use as an argument in the URL.
The syntax is like:
http://server:port/im/runreport?selection=AAA&queryDefinition=BBB
Where AAA is the URL Encoded name of your report (i.e. %20 or + for spaces and such)
and where BBB is the URL Encoded query definition. If you don't know the query definition syntax, I would create a specific instance of the query you want in the GUI, then run "im viewquery" from the CLI to see the definition. You can use that output and swap in your dynamic values.
e.g. ((field[Type] = "Defect") and (field[Priority] = "Low"))
becomes
%28%28field%5BType%5D+%3D+%22Defect%22%29+and+%28field%5BPriority%5D+%3D+%22Low%22%29%29
And you replace the "Low" value with whatever priority you want in your report (for this example).
Hi Marcus,
Thanks again for your inputs. I decided i'll just stick with the CLI instead of automating the webclient. However, I would like to ask how to use the CLI (im.exe) without installing the client. What files do I need? I tried to just copy the bin folder only and tried to run it but it didn't work. Please advise.
C:\Users\jc185178\Desktop\bin>im.exe -?
im.exe: Attempt to launch MKS Integrity Client Timed out. To solve this please t
ry the following:
- Verify that the user you are logged in as has read and write permissions to th
e Integrity Client install directory.
- Make sure the Integrity Client install directory is the very first entry in th
e path.
Thanks
The command line interface and Java Swing GUI are one and the same client. If you completely close the client, and run "im about" from the CLI to display the version, you'll notice (under MS Windows) the Integrity icon appear in your system tray just as if you ran the GUI version. Unfortunately there is no way to separate them as all of the main code is shared.
If you are concerned about file size or client installation, you could potentially write a small Java application to interact with Integrity via the Java API. This requires only the 'mksapi.jar' file if you use a server integration point. However, PTC recommends against a server integration point when possible, and suggests you use a local client integration point instead. Another approach would be to use the Integrity SOAP web serivces and avoid the client or API altogether.
Cheers,
Marcus
Hi Marcus,
Can you please give details on the Integrity SOAP web services? Where can we download and what languages is this supported?
Thanks,
Jeric
Hi Eric,
They are pretty typical web services if you are familiar with SOAP. You can get a reference guide from the Integrity eSupport Portal under documentation (or just do a search for "Web Services Reference"). Hopefully this link works if you are logged into the portal: http://www.ptc.com/WCMS/files/149444/en/WebServicesReference_Integrity_10_2.pdf
The WSDL file for Integrity services is located at: http://<servername>:<port>/webservices/10/Integrity/?WSDL where '10' is the version (e.g. use 2009 to get that version of the services instead).
The benefit of web services is that there is no dependence on your programming/scripting language. You just need to be able to call a web page. Since SOAP is a very common standard most languages (Java, Perl, PHP, C#, etc...) will have libraries to handle all the details for you, and you can even use command-line utilities like curl.
Best regards,
Marcus
Hi again Marcus,
I found only a few web services available for the WSDL you mention above. Is there any other? How do you login to integrity? Can we run reports and chart with outputFile? Please advise. Thanks
<xs:import namespace="http://webservice.mks.com/2009/Integrity/schema"/>
<xs:element name="createItem" type="tns:createItem"/>
<xs:element name="createItemResponse" type="tns:createItemResponse"/>
<xs:element name="editItem" type="tns:editItem"/>
<xs:element name="editItemResponse" type="tns:editItemResponse"/>
<xs:element name="fetchAttachments" type="tns:fetchAttachments"/>
<xs:element name="fetchAttachmentsResponse" type="tns:fetchAttachmentsResponse"/>
<xs:element name="getAttachmentDetails" type="tns:getAttachmentDetails"/>
<xs:element name="getAttachmentDetailsResponse" type="tns:getAttachmentDetailsResponse"/>
<xs:element name="getItem" type="tns:getItem"/>
<xs:element name="getItemResponse" type="tns:getItemResponse"/>
<xs:element name="getItemsByCustomQuery" type="tns:getItemsByCustomQuery"/>
<xs:element name="getItemsByCustomQueryResponse" type="tns:getItemsByCustomQueryResponse"/>
<xs:element name="getItemsByIDs" type="tns:getItemsByIDs"/>
<xs:element name="getItemsByIDsResponse" type="tns:getItemsByIDsResponse"/>
<xs:element name="getItemsByNamedQuery" type="tns:getItemsByNamedQuery"/>
<xs:element name="getItemsByNamedQueryResponse" type="tns:getItemsByNamedQueryResponse"/>
<xs:element name="getProjects" type="tns:getProjects"/>
<xs:element name="getProjectsResponse" type="tns:getProjectsResponse"/>
<xs:element name="removeAttachment" type="tns:removeAttachment"/>
<xs:element name="removeAttachmentResponse" type="tns:removeAttachmentResponse"/>
Unfortunately at this point the SOAP web services are not as comprehensive as the Java API or other UIs. There are /Integrity /Source and /Generic options available that you can learn more about in the Web Services Reference guide I linked to before. It describes the authentication -- you just pass in credentials as part of the request. The Generic ones offer "raw" access to the Java API on the server more as a fallback without special manipulation of the response. Although I have not tried, I doubt that reports or charts will work as the output would need to be Base-64 encoded or something similar and encapsulated in the response.
In order to get an XLS report based on a dynamic query with no client footprint, I think your best option is either writing a small app using the API (e.g. Java app with 'mksapi.jar', a server integration point, and the Apache POI to generate your spreadsheet), or writing a JSP/servlet version hosted on the Integrity server that would serve up the .xls directly by visiting an appropriate URL.