Contributions
Re: Missing XML representation of response.
I am a little bit confused now because in my old REST project in which I try now send the same request, to the same service I can see XML representation. In both I use POST method with application/json Media Type. For now I cant notice difference between them but when I find it out I will let You know. Thanks nmrao :)9 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.7KViews0likes1CommentMissing XML representation of response.
Hello, Im using now SoapUI NG Pro 1.7. I create new REST project from URL. From Projects tab i try out my new service by sending request. Service send me back JSON response but when I try to view it in XML view I see only: <xml/> In JSON, Raw and Outline everything is ok. I see only xml root in XML and Overview views. Anyone notice the same problem? Is this problem with new 1.7 version of soapUI? I can upload some private way my original JSON response examples.Solved9 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.7KViews0likes3CommentsDifferences in output after execute the same groovy script inside and outside soapUI.
Hello, I want to transform XML into HTML using groovy and XSL file. I usejavax.xml.transform library for this. But when I try run groovy script inside and outside soapUI it it gives me diffrent responses. Here are my test files: <?xml version="1.0" encoding="UTF-8"?> <apis> <api min="" max="2.0"> <resource name="A"> <description>A from beggining to 2.0</description> </resource> </api> <api min="2.0" max="2.0.1"> <resource name="A"> <description>A from 2.0 to 2.0.1</description> </resource> </api> <api min="2.0.1" max=""> <resource name="A"> <description>A from 2.0.1 to now</description> </resource> </api> </apis> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="api-version" select="2.0"/> <xsl:template match="/apis"> <html> <head/> <body> <table border="1"> <th colspan="2"> <xsl:text>Doc for API: </xsl:text> <xsl:value-of select="$api-version"/> </th> <xsl:apply-templates select="api[(@min='' or @min <= $api-version) and (@max='' or @max > $api-version)]/resource"> <xsl:sort select="@name"/> </xsl:apply-templates> </table> </body> </html> </xsl:template> <xsl:template match="resource"> <tr> <td> <xsl:value-of select="@name"/> </td> <td> <xsl:value-of select="description"/> </td> </tr> </xsl:template> </xsl:stylesheet> import javax.xml.transform.TransformerFactory import javax.xml.transform.stream.StreamResult import javax.xml.transform.stream.StreamSource def workspacePath def xslPath def xslFileName def xmlPath def xmlFileName def outputPath def outputFileName def xslt def transformer def xml def html def apiVersions //define workspace workspacePath = "C:/test/" //define xls location xslPath = "transformations/" //define xsl file name xslFileName = "test4.xsl" //define source xml location xmlPath = "pendingFeature/" //define xml file name xmlFileName = "test4.xml" //define output path outputPath = "outputs/" //define api version apiVersions = ['1.0','2.0','2.0.1'] // load xslt xslt = new File(workspacePath + xslPath + xslFileName).getText() // create transformer transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(xslt))) // load xml xml = new File(workspacePath + xmlPath + xmlFileName).getText() apiVersions.each { apiVersion -> //define output file name outputFileName = "doc for " + apiVersion + " api version.html" // set output file html = new FileOutputStream(workspacePath + outputPath + outputFileName) // set api version transformer.setParameter("api-version", apiVersion) // perform transformation transformer.transform(new StreamSource(new StringReader(xml)), new StreamResult(html)) //close stream html.close() } For API version 1.0 it is ok, but for 2.0 and higher there is a problem while running script outside soapUI with finding matching api node with expresion (@min='' or @min <= $api-version) and (@max='' or @max > $api-version) I think it is because in XPath 1.0 the < and > operators always do numeric comparison and 2.0 doesn't. But I declare in XSL files xsl:stylesheet version="2.0" so is should use XPath 2.0 in both places and work. W3schools says: "XSLT 2.0, XPath 2.0, and XQuery 1.0, share the same functions library. There are over 100 built-in functions. There are functions for string values, numeric values, date and time comparison, node and QName manipulation, sequence manipulation, Boolean values, and more." Why in soapUI it works?Solved1.2KViews0likes1Comment- 9 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.7KViews0likes0Comments
[composite project] Test Cases rename
Hello, I want to develop my REST project in SoapUI NG PRO as composite project and put it into git repository. But I have some doubt about file names in saved project. Let's follow that steps: 1. Create new Test Case named 'test1'. 2. Save project. 3. Rename 'test1' into 'test2'. 4. Save project. Now when I take a look into saved project files I see still 'test1.xml' file but with changed property name="test2" inside. I think that will be, after some time of developing and refactoring project, littleuncomfortable in maintenance. What do You think about it? There is way to keep files names the same as Test Cases names? Can I manualy change file names? There are somewhere references for thoese names?Solved9 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.7KViews0likes2CommentsRe: Run Test Case as test step failure
I have exactly the same problem. I run my "TestStep1" in "TestCase1" which runs "TestCase2" through "Run TestCase" test step type. It finish with success. But when after this I try to run first step of TestCase1 which is a groovy test step it gives me message: "java.lang.NullPointerException".9 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.5KViews0likes11Comments- 9 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.8KViews0likes0Comments