Forum Discussion

NickMitricka's avatar
NickMitricka
Occasional Contributor
5 years ago

ReadyAPI 3.1.0 - Property Transfer with xQuery throws issue

With the latest update to ReadyAPI 3.1.0, I am getting issues on property transfer steps that used the XQuery path language.

[java.lang.NoSuchMethodException: org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery.(java.lang.String,java.lang.String,java.lang.Integer,org.apache.xmlbeans.XmlOptions)]

This appears to be due to the change in the jar files. (removing xbean_xpath-2.4.0.jar and using xmlbeans-xpath-2.6.0.jar) 


Is there a way to continue using the XQuery with this release or are we being forced to now use XPath only?

  • nmrao's avatar
    nmrao
    Champion Level 3
    May be it would be good to open a support case to get a quicker response.
    • Nastya_Khovrina's avatar
      Nastya_Khovrina
      SmartBear Alumni (Retired)

      Hi NickMitricka,

       

      It seems that the issue depends on the XQuery that you use. I've tried with the sample project on my side and the Property Transfer test step works fine for me.

       

      Can you provide a screenshot of the Property Transfer test step settings and the XML content so that I could try to reproduce the issue?

      • NickMitricka's avatar
        NickMitricka
        Occasional Contributor

        Nastya_Khovrina 
        To give a little background, as I'm not sure that the screen shot will provide significant value.  We have a login page (html) that I am scraping to pull a URL that is needed for submitting a form.  The expression we are using is

        //form[1]/@action

        (technically more of an XPath expression); however, this worked in prior versions.

         



        A slightly different example that I'm seeing within assertions. We are making a call to an API and getting back data such as:

        <Response xmlns="[REDACTED]">
           <phoneNumbers>
              <e>
                 <display>555555555</display>
                 <type>work</type>
                 <value>5555555</value>
                 <primary>true</primary>
              </e>
              <e>
                 <display>123-555-9999</display>
                 <type>mobile</type>
                 <value>123-555-9999</value>
              </e>
           </phoneNumbers>
        </Response>

        Within this API the values can come back in either order, so we use xQuery assertion to check it:

        The XQuery Match assertion failed for the following path: [declare namespace ns1='[REDACTED]';
        
        <Response>
        	{
        
        	for $x in //ns1:phoneNumbers/ns1:e/ns1:type/text()
                                where $x='${#TestSuite#phoneNumberTypeWork}'
                                return  data($x)
        
        	}
        </Response>]. Class name: RuntimeException; Error Message: java.lang.NoSuchMethodException: org.apache.xmlbeans.impl.xquery.saxon.XBeansXQuery.<init>(java.lang.String,java.lang.String,java.lang.Integer,org.apache.xmlbeans.XmlOptions).