Contributions
Re: Launch browser with specific URL and return text back into Soap UI
Hello, Thanks for asking. When I browse thru the Rest Server (looks like a Web page actually), I'm been asked to authenticate myself,and a popup screen displays asking for the corresponding username and password. After that, I get immediate access to the web pages and can navigate thru them. When I try the same from SoapUI using Groovy, I get the following: Exception thrown: Server returned HTTP response code: 401 for URL: http://domain.mycompany.com:8085/v1/years/ java.io.IOException: Server returned HTTP response code: 401 for URL: http://domain.mycompany.com:8085/v1/years/ Don't know if this info is enough to get my self understood. If I put my username and passord on the URL command as follows: URL url = new URL("http://user:pwd@domain.mycompany.com:8085/v1/years/"); I get exactly the same error message: Exception thrown: Server returned HTTP response code: 401 for URL: http://user:pwd@domain.mycompany.com:8085/v1/years/ java.io.IOException: Server returned HTTP response code: 401 for URL: http://user:pwd@domain.mycompany.com:8085/v1/years/ Thanks in advance, Igor7.2KViews0likes0CommentsRe: Launch browser with specific URL and return text back into Soap UI
Hello, When using the url command in groovy to get the content of a web page for which a username and password is required, noticed that I need to pass credentials somehow in here url = new URL("http://user:pwd@server.domain.com:3000/v1/carids/38155/components/1/") I have the same problem with HTTPTestRequest, If anyone can provide me with a hint on how to solve this problem, I'd really appreciate it thanks in advance7.2KViews0likes0CommentsRe: Launch browser with specific URL and return text back into Soap UI
Hi Dain, I knew it was supposed to work with HTTPTestRequest but could not make it work and found no real examples of that. If you can provide me with a brief, real example, I'd appreciate it. In the mean time, I used Groovy to solve my problem using logic including: url = new URL("http://www.mywebsite.com") def output = url.getText() Best regards, Igor7.2KViews1like1CommentRe: Property Transfer based on a particular value.
Hi Dain, Thanks a lot, I tried it and it worked just fine. Amazing. thanks for your support. I developed an alternative solution using XmlSlurper from Groovy and it worked as well just fine, but hey, I now have 2 different approaches. Thanks again! Igor647Views0likes0CommentsRe: Property Transfer based on a particular value.
Hi, I developed a solution but not sure if it's the most correct one, using string funtions. Any advice would be greatly appreciated. Thanks import com.eviware.soapui.support.*; def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def _xmlUtil = new com.eviware.soapui.support.xml.XmlUtils(); def holder = groovyUtils.getXmlHolder( "Navigate01 - Start#Response" ) def response = context.expand( '${Navigate01 - Start#Response#//ns:NavigateResponse[1]/ns1:NavigationResults[1]/ns1:NavigationList[1]}' ) IndexFound = response.indexOf('ServerItemId', response.indexOf('1998', 1)) + 13 def ResultServerItemIdFor1998 =response.getAt(IndexFound..IndexFound+3)646Views0likes0CommentsRe: Property Transfer based on a particular value.
You could try using groovyutils and xpath. http://www.soapui.org/userguide/functio ... ystep.html Hello, Regarding this topic of "Property Transfer based on a particular value", considering the example given a reply up above, it says: >> For example, >> def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context); >> def holder = groovyUtils.getXmlHolder( "YOUR RESPONSE" ); >> def nodeValueStringArray = holder.getNodeValues("/GetMyResult/MyResult >> [ResultSource='ProductionSource']/ResultKey"); >> Loop through nodeValueStringArray and get your values for ResultKey. I'm new to SoapUI and need to evaluate some requirements as part of our Web Services Automation tool. I need something similar: on the following response: My Vehicle Year List http://x.y.z.w:3000/v1/years/ 2006 1000 2005 1001 2004 1002 OK I need to find for the ServerItemId associated to year 2004 and pass it over as a property value in a subsequent test script. So need to loop thru the response (how do I do it?), search for Text 2004 and return, via groovy, the value of the corresponding ServerItemId: 1002 Can anyone help me please? or provide me with a link where I can find out more about how to do this, I'd really appreciate it Best regards and thanks in advance, Igor1.7KViews0likes0Comments