2013/5/10 Kevin Ormbrek <
korm...@gmail.com>:
> Thank you for reporting this and I'm sorry I missed the timeout. I am glad
> to hear the library is of use to you. The timeout can be set when the client
> is created or afterwards. Do you think adding an additional argument w/
> default to Create Soap Client would suffice, or would you rather have a
> keyword Set Soap Timeout?
With other libraries I have noticed that both configuration when
initializing something and having a separate keyword for configuration
are useful. The latter is more flexible and allows temporarily and
dynamically changing values, but the former makes the common case
easy.
If there are lot of values to configure, having separate keywords for
all of them can get a bit annoying. A good alternative solution that
I've started to use myself is having just one keyword that can be used
to configure all values. For example something like this:
def soap_configuration(timeout=None, conf2=None, conf3=None):
if timeout is not None:
# ....
It can then be used in the test data using named argument syntax like
below. If this one keyword handles all configuration, the keyword that
initializes the connection could also use it internally.
SOAP Configuration timeout=1 minute conf3=another value
I obviously don't know this particular library or the use case well
enough to know does anything above make sense in this context. Just
wanted to share what I have learned related to configuring internal
state of test libraries.
> In case you have need of it, here is a user keyword implementing the missing
> functionality:
> Set Suds Client Timeout
> [Arguments] ${timeout}
> [Documentation] Sets the `timeout` in seconds on the current Suds client using the value provided.
> ${timeout}= Convert To Number ${timeout}
> ${suds library}= Get Library Instance SudsLibrary
> ${suds library._client().options.timeout}= Set Variable ${timeout}
That's pretty clever way to configure a library externally! I hadn't
though about using Get Library Instance and the extended variable
assignment like this. Of course this is a hack and can easily break if
the library is changed internally, but it definitely is a good
workaround.
Cheers,
.peke
--
Agile Tester/Developer/Consultant ::
http://eliga.fi
Lead Developer of Robot Framework ::
http://robotframework.org