Contributions
Re: Names with xsi:type=ns*:RemoteUser name values only needed
If I do something like: def y = holder.getNodeValue("//multiRef[contains(@id,'id5')]/name/text()"); I get kevbac Wed Aug 07 14:54:26 EDT 2013:INFO:kevbac It seems to like @id, but using @type does not work. I get null as response. How do you handle xsi:type="ns7:RemoteUser? I tried with no success: @xsi,RemoteUser null @xsi:type,RemoteUser prefix xsi has not been declared @type,RemoteUser null What about how each RemoteUser has a namespace (ns) with an incremental number (e.g., ns7:RemoteUser)?11 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.7KViews0likes0CommentsRe: Names with xsi:type=ns*:RemoteUser name values only needed
The piece I want is: <multiRef id="id6" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:RemoteUser" xmlns:ns3="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <email xsi:type="xsd:string">rob.low@fakemail.com</email> <fullname xsi:type="xsd:string">Rob Low</fullname> <name xsi:type="xsd:string">roblow</name> </multiRef>11 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.7KViews0likes0CommentsRe: Names with xsi:type=ns*:RemoteUser name values only needed
Thank you Rao for the suggestion. I tried: def x = holder.getNodeValues("//multiRef[contains(@type,'RemoteUser')]/name/text()"); for (def part in x) { log.info part; } but it returned nothing. The full response by the way: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <ns1:getProjectRoleActorsResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.rpc.jira.atlassian.com"> <getProjectRoleActorsReturn href="#id0"/> </ns1:getProjectRoleActorsResponse> <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:RemoteProjectRoleActors" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://beans.soap.rpc.jira.atlassian.com"> <project href="#id1"/> <projectRole href="#id2"/> <roleActors soapenc:arrayType="ns2:RemoteRoleActor[2]" xsi:type="soapenc:Array"> <roleActors href="#id3"/> <roleActors href="#id4"/> </roleActors> <users soapenc:arrayType="ns2:RemoteUser[2]" xsi:type="soapenc:Array"> <users href="#id5"/> <users href="#id6"/> </users> </multiRef> <multiRef id="id6" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:RemoteUser" xmlns:ns3="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <email xsi:type="xsd:string">rob.low@fakemail.com</email> <fullname xsi:type="xsd:string">Rob Low</fullname> <name xsi:type="xsd:string">roblow</name> </multiRef> <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:RemoteRoleActor" xmlns:ns4="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <descriptor xsi:type="xsd:string">Rob Low</descriptor> <parameter xsi:type="xsd:string">roblow</parameter> <projectRole href="#id2"/> <type xsi:type="xsd:string">atlassian-user-role-actor</type> <users soapenc:arrayType="ns4:RemoteUser[1]" xsi:type="soapenc:Array"> <users href="#id6"/> </users> </multiRef> <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:RemoteProjectRole" xmlns:ns5="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <description xsi:type="xsd:string" xsi:nil="true"/> <id xsi:type="xsd:long">10002</id> <name xsi:type="xsd:string">Administrators</name> </multiRef> <multiRef id="id4" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns6:RemoteRoleActor" xmlns:ns6="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <descriptor xsi:type="xsd:string">Kevin Bacon</descriptor> <parameter xsi:type="xsd:string">kevbac</parameter> <projectRole href="#id2"/> <type xsi:type="xsd:string">atlassian-user-role-actor</type> <users soapenc:arrayType="ns6:RemoteUser[1]" xsi:type="soapenc:Array"> <users href="#id5"/> </users> </multiRef> <multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns7:RemoteUser" xmlns:ns7="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <email xsi:type="xsd:string">kevin.bacon@fakemail.com</email> <fullname xsi:type="xsd:string">Kevin Bacon</fullname> <name xsi:type="xsd:string">kevbac</name> </multiRef> <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns8:RemoteProject" xmlns:ns8="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <description xsi:type="xsd:string" xsi:nil="true"/> <id xsi:type="xsd:string">10012</id> <issueSecurityScheme xsi:type="ns8:RemoteScheme" xsi:nil="true"/> <key xsi:type="xsd:string" xsi:nil="true"/> <lead xsi:type="xsd:string" xsi:nil="true"/> <name xsi:type="xsd:string">Product Catalog</name> <notificationScheme xsi:type="ns8:RemoteScheme" xsi:nil="true"/> <permissionScheme xsi:type="ns8:RemotePermissionScheme" xsi:nil="true"/> <projectUrl xsi:type="xsd:string" xsi:nil="true"/> <url xsi:type="xsd:string" xsi:nil="true"/> </multiRef> </soapenv:Body> </soapenv:Envelope>11 years agoPlace ReadyAPI QuestionsReadyAPI Questions2.7KViews0likes0CommentsNames with xsi:type=ns*:RemoteUser name values only needed
Hello, I have xml soapui reponse with many xsi:type returns, but I only response from one with particular type. For example, The xml data: ... <multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns7:RemoteUser" xmlns:ns7="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <email xsi:type="xsd:string">joe.smoo@fakemail.com</email> <fullname xsi:type="xsd:string">Joe Smoo</fullname> <name xsi:type="xsd:string">joesmoo</name> </multiRef> <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns8:RemoteProjectRole" xmlns:ns8="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <description xsi:type="xsd:string" xsi:nil="true"/> <id xsi:type="xsd:long">10002</id> <name xsi:type="xsd:string">Administrators</name> </multiRef> ... I was using: def request = testRunner.testCase.getTestStepByName(teststep); def responseData = request.getProperty("Response"); def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ); def holder = groovyUtils.getXmlHolder( "getProjectRoleActors#Response" ); def x = holder.getNodeValues("//multiRef/name"); for (def part in x) { log.info part; } This returns all the name values even for the ones that are not listed with type RemoteUser. I wanted something regular repression like with getNodeValue or getNodeValues, but no luck. Things I tried with no success: def x = holder.getNodeValues("//multiRef/ns:RemoteUser/name"); # says it is not declared def x = holder.getNodeValues("//multiRef/RemoteUser/name"); # does not work def x = holder.getNodeValue("//multiRef /*RemoteUser*/name"); # does not work How can I get just the data with RemoteUser as the type?11 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.4KViews0likes7CommentsRe: Specific xsi:type=ns*:RemoteUser name values only needed
I tried to attach a txt file but it did not let me. I will paste the content here: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <ns1:getProjectRoleActorsResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://soap.rpc.jira.atlassian.com"> <getProjectRoleActorsReturn href="#id0"/> </ns1:getProjectRoleActorsResponse> <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:RemoteProjectRoleActors" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://beans.soap.rpc.jira.atlassian.com"> <project href="#id1"/> <projectRole href="#id2"/> <roleActors soapenc:arrayType="ns2:RemoteRoleActor[2]" xsi:type="soapenc:Array"> <roleActors href="#id3"/> <roleActors href="#id4"/> </roleActors> <users soapenc:arrayType="ns2:RemoteUser[2]" xsi:type="soapenc:Array"> <users href="#id5"/> <users href="#id6"/> </users> </multiRef> <multiRef id="id6" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:RemoteUser" xmlns:ns3="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <email xsi:type="xsd:string">rob.low@fakemail.com</email> <fullname xsi:type="xsd:string">Rob Low</fullname> <name xsi:type="xsd:string">roblow</name> </multiRef> <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:RemoteRoleActor" xmlns:ns4="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <descriptor xsi:type="xsd:string">Rob Low</descriptor> <parameter xsi:type="xsd:string">roblow</parameter> <projectRole href="#id2"/> <type xsi:type="xsd:string">atlassian-user-role-actor</type> <users soapenc:arrayType="ns4:RemoteUser[1]" xsi:type="soapenc:Array"> <users href="#id6"/> </users> </multiRef> <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns5:RemoteProjectRole" xmlns:ns5="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <description xsi:type="xsd:string" xsi:nil="true"/> <id xsi:type="xsd:long">10002</id> <name xsi:type="xsd:string">Administrators</name> </multiRef> <multiRef id="id4" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns6:RemoteRoleActor" xmlns:ns6="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <descriptor xsi:type="xsd:string">Kevin Bacon</descriptor> <parameter xsi:type="xsd:string">kevbac</parameter> <projectRole href="#id2"/> <type xsi:type="xsd:string">atlassian-user-role-actor</type> <users soapenc:arrayType="ns6:RemoteUser[1]" xsi:type="soapenc:Array"> <users href="#id5"/> </users> </multiRef> <multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns7:RemoteUser" xmlns:ns7="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <email xsi:type="xsd:string">kevin.bacon@fakemail.com</email> <fullname xsi:type="xsd:string">Kevin Bacon</fullname> <name xsi:type="xsd:string">kevbac</name> </multiRef> <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns8:RemoteProject" xmlns:ns8="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <description xsi:type="xsd:string" xsi:nil="true"/> <id xsi:type="xsd:string">10012</id> <issueSecurityScheme xsi:type="ns8:RemoteScheme" xsi:nil="true"/> <key xsi:type="xsd:string" xsi:nil="true"/> <lead xsi:type="xsd:string" xsi:nil="true"/> <name xsi:type="xsd:string">Product Catalog</name> <notificationScheme xsi:type="ns8:RemoteScheme" xsi:nil="true"/> <permissionScheme xsi:type="ns8:RemotePermissionScheme" xsi:nil="true"/> <projectUrl xsi:type="xsd:string" xsi:nil="true"/> <url xsi:type="xsd:string" xsi:nil="true"/> </multiRef> </soapenv:Body> </soapenv:Envelope>1.1KViews0likes0CommentsSpecific xsi:type=ns*:RemoteUser name values only needed
Hello, I have xml soapui reponse with many xsi:type returns, but I only response from one with particular type. For example, The xml data: ... <multiRef id="id5" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns7:RemoteUser" xmlns:ns7="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <email xsi:type="xsd:string">joe.smoo@fakemail.com</email> <fullname xsi:type="xsd:string">Joe Smoo</fullname> <name xsi:type="xsd:string">joesmoo</name> </multiRef> <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns8:RemoteProjectRole" xmlns:ns8="http://beans.soap.rpc.jira.atlassian.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> <description xsi:type="xsd:string" xsi:nil="true"/> <id xsi:type="xsd:long">10002</id> <name xsi:type="xsd:string">Administrators</name> </multiRef> ... I was using: def request = testRunner.testCase.getTestStepByName(teststep); def responseData = request.getProperty("Response"); def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ); def holder = groovyUtils.getXmlHolder( "getProjectRoleActors#Response" ); def x = holder.getNodeValues("//multiRef/name"); for (def part in x) { log.info part; } This returns all the name values even for the ones that are not listed with type RemoteUser. I wanted something regular repression like with getNodeValue or getNodeValues, but no luck. Things I tried with no success: def x = holder.getNodeValues("//multiRef/ns:RemoteUser/name"); # says it is not declared def x = holder.getNodeValues("//multiRef/RemoteUser/name"); # does not work def x = holder.getNodeValue("//multiRef /*RemoteUser*/name"); # does not work How can I get just the data with RemoteUser as the type?Solved6.9KViews0likes4CommentsHow to Capture errors?
I have a fairly simply script, but I want to improve it so that it shows the error seen in its testStep. I am not sure how to do this. I tried (see code below) to put result.error, but that does not work. Is there something like result.error or result.stderr or something? / Set the testcase name def testcase = "order"; def request = testRunner.testCase.getTestStepByName(testcase); def results = testRunner.results; //assert results.size() != 0, sendAlert('Results are missing from request for ' + testcase); def sendAlert(msg) { // codes sends an alert here } for (result in results) { if (result.testStep == request) { log.info("request status: " + result.status); // Set status that you want alert to go out on here if (!(result.status ==~ /OK/)) { [color=green]// Instead of putting result.status, I would like to put the error message[/color] sendAlert("Alert for " + testcase + ": " + [color=green]result.status[/color]); } } }15 years agoPlace ReadyAPI QuestionsReadyAPI Questions2KViews0likes1Comment