Forum Discussion
skillsoft
16 years agoFrequent Contributor
Hi,
Sorry to bother you again. If you could point me in the correct direction that would be great. The last thing you had me add to the handler works great for most of the responses, but broke a few responses that were previously working (with issues). These particular responses have strings with html text in them (title="",style=""). I've tried playing around with the replaceall using different regular expressions but had no luck. Here is my event handler now:
if( submit.response == null )
return
def content = submit.response.responseContent
content = content.replaceAll( """, "\"" )
if (content.contains ("=\"<"))
{
// do nothing
}
else
{
content = content.replaceAll( "<", "<" )
content = content.replaceAll( ">", ">" )
}
content = content.replaceAll("", "" )
//log.info content
submit.response.responseContent = content
Here is the error I'm getting:
com.eviware.soapui.impl.wsdl.teststeps.assertions.soap.SoapResponseAssertion@469d4f
line -1: error: Unexpected character encountered (lex state 13): '"'
line 4: Unexpected character encountered (lex state 13): '"'
com.eviware.soapui.impl.wsdl.teststeps.assertions.ProXPathContainsAssertion@a49c85
XPathContains assertion failed for path [declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
//soapenv:Envelope[1]] : NullPointerException:null
This is the content:
Wed Oct 14 01:30:02 EDT 2009:INFO:
and here is the raw xml:
<?xml version="1.0" encoding="UTF-8"?><SkillPort><BaseSite><HomePage EnableGraphic="1" EnableWelcomeText="1" GraphicURL="/resources/default/images/billboard_img_04.jpg" WelcomeText=""/></BaseSite><AdvancedGroup Name="AGHapi" Orgcode="AGHapi"><HomePage EnableGraphic="1" EnableWelcomeText="1" GraphicURL="/resources/default/images/billboard_img_04.jpg" WelcomeText="<div><div style="color:#000000; font-size: 8pt;"><b>Knowledge at your fingertips &mdash; Anytime &mdash; Anywhere</b></div><div style="color:#000000; font-size: 8pt; margin-top: 5px;">Welcome to SkillPort, your online learning portal to training and on-the-job support tools that enhance your business and technical skills. Accelerate your career with e-Learning any time of the day or night. Leverage the different features of SkillPort to find the resources you need and to create a customized learning plan:</div><div><ul style="list-style:disc; margin-left: 15px; margin-top: 5px; font-size: 8pt;"><li style="color:#000000; margin-bottom: 5px;"><b>SEARCH & LEARN<sup>TM</sup></b><br/>Perform searches across your full library of resources, and be directed to the specific book page, course topic, or other tool you need for instant and relevant answers. A powerful search engine allows you to use complex search expressions. Results are ranked by relevancy so you can quickly find what you need.<br/></li><li style="color:#000000; margin-bottom: 5px;"><b>Catalog</b><br/>Browse the SkillPort catalog to see what resources are available to you. Add learning assets from the catalog to your learning plan, or launch them directly from the catalog. The catalog is organized by subject matter and by related professional certification for easy navigation.<br/></li><li style="color:#000000; margin-bottom: 5px;"><b>My Plan</b><br/>Create a customized learning plan to address specific development goals and keep track of frequently accessed learning assets. You can quickly return to them in My Plan with a single click. Organize and view your learning assets according to your preference: by due date, by type of asset, or in custom folders.</li><li style="color:#000000; margin-bottom: 5px;"><b>My Progress</b><br/>Review both completed and in-progress learning assets in My Progress. Quickly create print-friendly reports on your learning history and certificates of completion.</li></ul></div></div>"/></AdvancedGroup></SkillPort>
Thanks,
Mary
Sorry to bother you again. If you could point me in the correct direction that would be great. The last thing you had me add to the handler works great for most of the responses, but broke a few responses that were previously working (with issues). These particular responses have strings with html text in them (title="",style=""). I've tried playing around with the replaceall using different regular expressions but had no luck. Here is my event handler now:
if( submit.response == null )
return
def content = submit.response.responseContent
content = content.replaceAll( """, "\"" )
if (content.contains ("=\"<"))
{
// do nothing
}
else
{
content = content.replaceAll( "<", "<" )
content = content.replaceAll( ">", ">" )
}
content = content.replaceAll("", "" )
//log.info content
submit.response.responseContent = content
Here is the error I'm getting:
com.eviware.soapui.impl.wsdl.teststeps.assertions.soap.SoapResponseAssertion@469d4f
line -1: error: Unexpected character encountered (lex state 13): '"'
line 4: Unexpected character encountered (lex state 13): '"'
com.eviware.soapui.impl.wsdl.teststeps.assertions.ProXPathContainsAssertion@a49c85
XPathContains assertion failed for path [declare namespace soapenv='http://schemas.xmlsoap.org/soap/envelope/';
//soapenv:Envelope[1]] : NullPointerException:null
This is the content:
Wed Oct 14 01:30:02 EDT 2009:INFO:
and here is the raw xml:
Thanks,
Mary
Related Content
- 11 years ago
Recent Discussions
- 9 days ago