Skip to main content

Avoiding the self imposed proxy trap in SoapUI....

Very quick one to get me in the blogging mood.
 
So, you know when you work with API's across multiple environments using SoapUI. Depending on how your environments are structured you may need to switch proxies on or off.
 
After quite a while watching my tests fall over through no fault of their own I decided to solve this annoying problem. Use the following as either a setup script or a groovy step, combined with a project level property containing the URL you want to address:
 
import com.eviware.soapui.settings.*
import com.eviware.soapui.SoapUI
 
// set Proxy Dependent on Env
def aPI_URL = context.expand( '${#Project#API_URL}' )
if (aPI_URL.contains("dev")){
                SoapUI.settings.setBoolean(ProxySettings.ENABLE_PROXY,false);
} else {
                SoapUI.settings.setBoolean(ProxySettings.ENABLE_PROXY,true);
}
 
Really simple implementation shown here but it has changed the repeatibility of my tests completely. I have used similar implementations to switch within tests, dependant on which service I'm calling. You can use standard else if and switch statements with this approach too, which really changes how you can manage environments.
 
I find SoapUI is great for implementing really simple but flexible solutions to common environmental challenges, give it a whirl and see how manipulating your high level settings can really make your automation stand on its own two feet!
 
Right I'm off to see what else I can mess around with in SoapUI land.....
 

Comments

Popular posts from this blog

Wheel of Testing Part 2 - Content

Thank you Reddit, while attempting to find pictures of the earths core, you surpass yourself.
Turns out Steve Buscemi is the centre of the world.

Anyway. Lets start with something I hold to be true. My testing career is mine to shape, it has many influences but only one driver. No one will do it for me. Organisations that offer a career (or even a vocation) are offering something that is not theirs to give. Too much of their own needs get in the way, plus morphing into a badass question-asker, assumption-challenger, claim-demolisher and illusion-breaker is a bit terrifying for most organisations. Therefore, I hope the wheel is a tool for possibilities not definitive answers, otherwise it would just be another tool trying to provide a path which is yours to define.


In part one, I discussed why I had thought about the wheel of testing in terms of my own motivations for creating it, plus applying the reasoning of a career in testing to it. As in, coming up with a sensible reflection of real…

Getting started with testability

At TestBash Netherlands, I said that, in my experience, a lot of testers don't really get testability. I would feel bad if I didn't follow that up with a starting point for expanding your mindset and explicitly thinking about testability day to day, and making your testing lives better! 

In large scale, high transaction systems testability really is critical, as compared to the vastness and variability of the world, testing done within organisations, before deployment, is limited by comparison. We need ways to see and learn from the systems we test where it matters, in Production.
Being able to observe, control and understand is central to testing effectively, and there are loads of resources and experience reports out there to help. I was/am inspired by James Bach, Seth Eliot, Matt Skelton, Sally Goble, Martin Fowler and a little bit of PerfBytes/Logchat, so lets see if it works for you! 

Overall Model:

Heuristics of Software Testability by James Bach

http://www.satisfice.com/tool…

The Team Test for Testability

You know what I see quite a lot. Really long-winded test maturity models. 

You know what I love to see? Really fast, meaningful ways to build a picture of your teams current state and provoke a conversation about improvement. The excellent test improvement card game by Huib Schoots and Joep Schuurkes is a great example. I also really like 'The Joel Test' by Joel Spolsky, a number of questions you can answer yes or no to to gain insight into their effectiveness as a software development team.

I thought something like this for testability might an interesting experiment, so here goes:

If you ask the team to change their codebase do they react positively?Does each member of the team have access to the system source control?Does the team know which parts of the codebase are subject to the most change?Does the team collaborate regularly with teams that maintain their dependencies?Does the team have regular contact with the users of the system?Can you set your system into a given state…