Announcing SudsLibrary, a new library for testing SOAP-based web services

2,169 views
Skip to first unread message

Kevin O.

unread,
Feb 22, 2013, 12:28:37 AM2/22/13
to robotframe...@googlegroups.com
I am pleased to announce the first release of SudsLibrary.
SudsLibrary is based on Suds, a dynamic SOAP 1.1 client.
Unlike many other testing solutions, SudsLibrary uses neither classes generated at build time or stored XML.

You can install SudsLibrary using pip, with the following command:
    pip install robotframework-sudslibrary
Binary installers are available on PyPI, but they do not include Suds, a required package.

The project is hosted on GitHub, where you can also see the library documentation and more information.
I welcome your feedback and hope you enjoy using it.

Cheers,
Kevin Ormbrek

Kevin Ormbrek

unread,
May 9, 2013, 9:53:23 PM5/9/13
to Hugo Reis, robotframe...@googlegroups.com
Adding RF user group.
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?

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}

Kevin


On Thu, May 9, 2013 at 10:00 AM, Hugo Reis <hugod...@gmail.com> wrote:
Hello Kevin.

Great work, this library is very useful in our tests.

In some of our tests the server response takes more that 90 seconds and the test fails before receiving the server response.
My suggestion would be to configure timeout on the Create SOAP Client or Call SOAP Method keyword.


BR,
Hugo


--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



Pekka Klärck

unread,
May 10, 2013, 3:38:01 AM5/10/13
to korm...@gmail.com, Hugo Reis, robotframe...@googlegroups.com
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

Kevin O.

unread,
May 14, 2013, 11:02:15 AM5/14/13
to robotframe...@googlegroups.com
Thank you for your thoughtful input.
I was a little hesitant to add another configuration keyword (there are 9 already), but I will at your suggestion.
Most of the configuration is done through separate keywords because I did not want to force users to pass in dictionaries or lists, so variable arguments are used.
I hadn't thought about having a combined configure keyword like that. That would be a great solution if the Suds settings were simpler/more linear.
I will definitely consider your solution for other libraries.

You have a point about library internals. This user keyword should actually be calling set_options() per the Suds documentation instead of using direct assignment.
_client(), however, is documented in the SudsLibrary documentation and marked # PyAPI in the source code as a way to show that although pseudo-private, the method is intended for outside usage when extending the library.

Cheers,
Kevin

Gaurav Deore

unread,
May 16, 2013, 6:09:49 AM5/16/13
to robotframe...@googlegroups.com
As I have installed SudsLibrary on Windows m/c, but getting problem to import it.

Issue is as -:
Traceback (most recent call last):
Importing test library 'SudsLibrary' failed: ImportError: No module named suds.sax.document
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\SudsLibrary\__init__.py", line 17, in <module>
    from .monkeypatches import *
  File "C:\Python27\lib\site-packages\SudsLibrary\monkeypatches.py", line 17, in <module>
    from suds.sax.document import Document


If any one have idea please know me soon.

can we possible to test Soap Request & Response testing without using the SudsLibrary please know me

Thanks,
Gaurav

Kevin O.

unread,
May 16, 2013, 8:55:30 AM5/16/13
to robotframe...@googlegroups.com
strange that you can successfully do this:
from suds.plugin import MessagePlugin
but
suds.sax.document import Document
fails

I would try re-installing suds. Someone people have had similar issues with selenium where it was only partially installed.
If you are using pip,
pip uninstall suds
pip install suds

You could call SOAP methods with the HTTP libraries but it would not be easy or recommended.

Gaurav Deore

unread,
May 16, 2013, 10:13:01 AM5/16/13
to robotframe...@googlegroups.com
Hi Kevin,

Even I tried to install using pip & its not get installed. Below is log while installation :-


Downloading/unpacking suds

  Getting page https://pypi.python.org/simple/suds/
  Could not fetch URL https://pypi.python.org/simple/suds/: timed out
  Will skip URL https://pypi.python.org/simple/suds/ when looking for download links for suds
  Getting page https://pypi.python.org/simple/
  Could not fetch URL https://pypi.python.org/simple/: timed out
  Will skip URL https://pypi.python.org/simple/ when looking for download links for suds
  Cannot fetch index base URL https://pypi.python.org/simple/

  URLs to search for versions for suds:
  * https://pypi.python.org/simple/suds/
  Getting page https://pypi.python.org/simple/suds/
  Could not fetch URL https://pypi.python.org/simple/suds/: timed out
  Will skip URL https://pypi.python.org/simple/suds/ when looking for download links for suds
  Could not find any downloads that satisfy the requirement suds

No distributions at all found for suds

Exception information:

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\basecommand.py", line 139, in main
    status = self.run(options, args)
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\commands\install.py", line 266, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\req.py", line 1026, in prepare_files
    url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "C:\Python27\lib\site-packages\pip-1.3.1-py2.7.egg\pip\index.py", line 171, in find_requirement
    raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for suds
------------------------------------------------------------------------------------------------------------

so is there any other way to install it & consume API of Suds ? Its urgent to accomplish it.

I too don't have much info on "HTTP libraries" use for SOAP.

Thanks,
Gaurav

Kevin O.

unread,
May 16, 2013, 10:56:55 AM5/16/13
to robotframe...@googlegroups.com
You appear to have a network issue or a firewall blocking access to PyPI.
You could extract the tarball and do this:
python setup.py install

Get to a machine that has more access and use one of these URLs to get the suds tarball:

Good luck,
Kevin

Kevin O.

unread,
May 28, 2013, 10:03:36 AM5/28/13
to robotframe...@googlegroups.com
Suds does not do any validation when preparing the request, so that is likely incorrect argument type(s). All of the methods a service exposes have their own corresponding types which are not needed in the user code. This is likely to be caused by calling the method fetchRequest with the method's corresponding type, fetchRequest.
Double check the output of Create Soap Client, checking the type(s) of the arguments on the method you are trying to call.
An educated guess would be the method is expecting a fetch-type argument followed by a int and a Boolean rather than a single fetchRequest-type argument.
If you are still stuck please post the WSDL if possible.

Kevin

arub...@gmail.com

unread,
Sep 12, 2014, 3:51:27 AM9/12/14
to robotframe...@googlegroups.com
hello,

just FYI - current suds-jurko 0.6 does not export suds.sax.date.UTC - your library is failing with that version

Kevin O.

unread,
Sep 12, 2014, 1:13:29 PM9/12/14
to robotframe...@googlegroups.com
Thank you so much for reporting this. I created an issue for this.

https://github.com/ombre42/robotframework-sudslibrary/issues/17

alister darrel

unread,
Aug 27, 2016, 3:30:47 AM8/27/16
to robotframework-users
Hi,
Can some please help me,
I am not able to solve this issue

Importing test library "sudslibrary" failed
20160826 23:54:05.570 [INFO]: Found Robot Framework version 3.0 from 'C:\Python27\lib\site-packages\robot'.

20160826 23:54:05.570 [INFO]: Started RIDE 1.5.2.1 using python version 2.7.12 with wx version 2.8.12.1 in win32.

20160826 23:54:22.918 [WARN]: Importing test library "sudslibrary" failed

Traceback (most recent call last):
Importing test library 'sudslibrary' failed: ImportError: No module named sudslibrary
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 143, in _import
    return __import__(name, fromlist=fromlist)
PYTHONPATH:
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\Scripts
  C:\WINDOWS\SYSTEM32\python27.zip
  C:\Python27\DLLs
  C:\Python27\lib
  C:\Python27\lib\plat-win
  C:\Python27\lib\lib-tk
  C:\Python27
  C:\Python27\lib\site-packages
  C:\Python27\lib\site-packages\robotide\spec
  File "C:\Python27\lib\site-packages\robotide\spec\librarymanager.py", line 81, in _fetch_keywords
    return get_import_result(path, library_args)
  File "C:\Python27\lib\site-packages\robotide\spec\libraryfetcher.py", line 20, in get_import_result
    lib = robotapi.TestLibrary(path, args)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 46, in TestLibrary
    return_source=True)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 67, in import_class_or_module
    self._raise_import_failed(name, err)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 103, in _raise_import_failed
    raise DataError('\n'.join(msg))

alister darrel

unread,
Aug 31, 2016, 6:48:04 PM8/31/16
to robotframework-users

20160831 17:28:13.760 [WARN]: Importing test library "SudsLibrary" failed

Traceback (most recent call last):
Importing test library 'SudsLibrary' failed: ImportError: No module named suds.sax.document
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 143, in _import
    return __import__(name, fromlist=fromlist)
  File "C:\Python27\lib\site-packages\SudsLibrary\__init__.py", line 17, in <module>
    from .monkeypatches import *
  File "C:\Python27\lib\site-packages\SudsLibrary\monkeypatches.py", line 17, in <module>
    from suds.sax.document import Document
PYTHONPATH:
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\Scripts
  C:\WINDOWS\SYSTEM32\python27.zip
  C:\Python27\DLLs
  C:\Python27\lib
  C:\Python27\lib\plat-win
  C:\Python27\lib\lib-tk
  C:\Python27
  C:\Python27\lib\site-packages
  C:\Python27\lib\site-packages\robotide\spec
  File "C:\Python27\lib\site-packages\robotide\spec\librarymanager.py", line 81, in _fetch_keywords
    return get_import_result(path, library_args)
  File "C:\Python27\lib\site-packages\robotide\spec\libraryfetcher.py", line 20, in get_import_result
    lib = robotapi.TestLibrary(path, args)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 46, in TestLibrary
    return_source=True)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 67, in import_class_or_module
    self._raise_import_failed(name, err)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 103, in _raise_import_failed
    raise DataError('\n'.join(msg))


20160831 17:28:28.093 [WARN]: Importing test library "SudsLibrary" failed

Traceback (most recent call last):
Importing test library 'SudsLibrary' failed: ImportError: No module named suds.sax.document
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 143, in _import
    return __import__(name, fromlist=fromlist)
  File "C:\Python27\lib\site-packages\SudsLibrary\__init__.py", line 17, in <module>
    from .monkeypatches import *
  File "C:\Python27\lib\site-packages\SudsLibrary\monkeypatches.py", line 17, in <module>
    from suds.sax.document import Document
PYTHONPATH:
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\Scripts
  C:\WINDOWS\SYSTEM32\python27.zip
  C:\Python27\DLLs
  C:\Python27\lib
  C:\Python27\lib\plat-win
  C:\Python27\lib\lib-tk
  C:\Python27
  C:\Python27\lib\site-packages
  C:\Python27\lib\site-packages\robotide\spec
  File "C:\Python27\lib\site-packages\robotide\spec\librarymanager.py", line 81, in _fetch_keywords
    return get_import_result(path, library_args)
  File "C:\Python27\lib\site-packages\robotide\spec\libraryfetcher.py", line 20, in get_import_result
    lib = robotapi.TestLibrary(path, args)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\running\testlibraries.py", line 46, in TestLibrary
    return_source=True)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 67, in import_class_or_module
    self._raise_import_failed(name, err)
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", line 103, in _raise_import_failed
    raise DataError('\n'.join(msg))




Can someone pls fix this error ?

ani adhi

unread,
Dec 17, 2016, 10:48:02 AM12/17/16
to robotframework-users
Hi,

I am not enjoying working Soap call from Robert Framework.But I am enjoying working in rest call due to Jason.
Can you advice me something what I have to follow to have better response.
Since 2 months i am trying Soap call trying to get 200 response it don't give me where as in soap ui ican do easily.
I have tried following each and every thing like suds library, request library and xml as well. 

please help me out.

thankyou
Ani
Reply all
Reply to author
Forward
0 new messages