Json Assertor Throwing an error in Bamboo execution

dyarramdyarram Posts: 6

I have some value assertions in json assertor tool and the test works on my local, but fails in Bamboo with below error. Can someone please help me understand what is missing?

An error occurred while processing an assertion: net.sf.saxon.trans.XPathException: Cannot convert XPath value to Java object: required class is org.w3c.dom.NodeList; supplied value has type xs:string

Comments

  • jakubiakjakubiak Posts: 598 admin

    There were two different issues that got fixed in SOAtest related to that error message - one was fixed in SOAtest 9.10.7 and the other in 9.10.8. What version of SOAtest are you using locally and on your Bamboo server?

    However, that still leaves the question of why the behavior is different between the two instances of SOAtest. It sounds like the call to your service is returning different data in the two environments. I would compare the traffic in both cases to understand what is different. In your local environment you can see the traffic in the Traffic Viewer, and in your Bamboo environment you can view the HTML report which should have the traffic saved in it since the test failed.

  • dyarramdyarram Posts: 6

    We are using 9.10.6 version in Bamboo and 9.10.8 locally. I didnt find any difference in traffic between both versions. I do get a response of 200 and content as well, but it fails at assertion

  • dyarramdyarram Posts: 6

    Can you please suggest an alternative or a workaround to have the tests pass in Bamboo? This is a simple fixed value assertion.

  • jakubiakjakubiak Posts: 598 admin

    It sounds like you are running into the one of the bugs we fixed in 9.10.7 or 9.10.8 when running on your Bamboo server, but you don't see those issues locally since you are running 9.10.8 there. I would suggest that you upgrade to version 9.10.8 on your Bamboo server.

  • dyarramdyarram Posts: 6

    Bamboo instance is shared across multiple teams and it is company approved version.It is not easy for me to upgrade Bamboo version.
    Looks like I may have to remove Json assertor from my tests or find a different assertion other than value assertion

  • jakubiakjakubiak Posts: 598 admin

    I understand. You should be aware, however, that the situation you are in where your server is older than your desktops is not guaranteed to work. Creating tests with a newer version of SOAtest than is on your Bamboo server can result in situations like this one where the tests will not run properly. If your test utilizes new functionality that was added in 9.10.8, it will not run properly or may not run at all on 9.10.6. So I would highly recommend you bring this to the attention of your company - your server really needs to be the same version or newer than what you are using to create the test cases.

    In this particular case, it may be possible to adjust the xpath so it will work in both 9.10.6 and 9.10.8. Can you tell us what the xpath of the failing assertion is and provide a JSON snippet that shows the element being validated?

  • dyarramdyarram Posts: 6

    Yes, I am aware of using an older version on Bamboo, but believe me it is not in my control. I just don't understand why I am not able to use this simple assertion even if it is an older version. Attaching the details . Please help me find a workaround

  • jakubiakjakubiak Posts: 598 admin

    There were a couple of bugs that were fixed and I am guessing you are running into one of them. Thanks for showing the xpath. Can you include a sample of what the JSON looks like?

  • dyarramdyarram Posts: 6

    Attaching Request / Response. We are just validating the last object called "States"

Sign In or Register to comment.