Posting a messag on a topic within servicebus


Not new to RF but for this issue I haven’t found a solution yet. We use a servicebus (azure) within our infrastructure for posting and receiving messages (JSON) on topics or queues and consuming them. Unfortunately, there not seems to be a rest endpoint to deliver the message via an API call. I can however use ServiceBusExplorer (tool) to deliver the messages I want onto any topic or queue.

With the RequestLibrary and Jsonlibrary I’m used to get, update and post JSON files by calling an API endpoint. Is there a way to make it possible to post the (updated) JSON files on the right topic or queue without a rest endpoint but using the same kind of method that the ServiceBusExplorer (tool) is doing?

It is the first time I read about ServiceBus Explorer. So I went searching the Internet and I found it is open source under MIT license.

In this case, you can study the code in .Net, and may find a solution.
Maybe the easier way is to create an interface to the tool that allows your Requests to transported. This is just me talking, I don’t even know if this is easy/doable.

Good luck!

1 Like

Hi Martin,

Like Hélio, It is the first time I read about ServiceBus Explorer. So I to did a little searching the Internet and I found there is a python module for interacting with the servicebus:

This is probably your best bet, you can create a small python library of RF keywords like, connect, send message, receive message, disconnect, etc and then you’ll have the keywords you need to to test your app.

Unfortunately I didn’t find any robot framework library for ServiceBus so you might be the first to need it?


1 Like

Thank you for the reply. Unfortunately, I’m but a humble tester so studying the .net code isn’t going to work for me; I wouldn’t know what to do with it. But thanks anyway for taking the time to respond to my question.

Thank you for your reply. I’ve installed the service bus on my env without a hitch. But now comes the suggestion to build my own RF library to connect, send, etc. That is precisely what I’m looking for but that is also precisely where I do not know what to do or how to set something like that up. I’m a tester and unfortunately not a developer. Is there a guide for dummies to do this?

Hi Martin,

There is some details about building RF python libraries in the documentation but really it’s be best for people with python experience, it’s not hard but not an ideal project to start python programming either.

Does your company/project have any python programmers who can help you? If not I’ll have a think about what else you can do.

To develop a library you’d ideally need access to a ServiceBus server to test the functions / keywords as you develop to make sure they work. Given there’s already a python module it shouldn’t be to hard to create one, it’s basically just wrapping the module functions.


Thnx again. Found a person within my organisation who seems to have some experience with Python but also this link which I’m going to try using:

Because Its using postman I suspect I could be using the JSONlibrary and the REQUESTLibrary to get what I want.

Hi Martin,

If you can do it with JsonLibrary or RequestsLibrary that would be great as it will remove your dependency on a python developer and let you keep everything in RF. It’s a pity that it’s not obvious from the links i found fro ServiceBus that it’s a web based protocol.

I had a quick look through that link, it looks like that should be easy to do with RequestsLibrary, they’ve given you the steps to authenticate and what headers you need to provide, I will say use the session keywords in RequestsLibrary as that will make your life easier and you won’t need to add the Authorization Bearer token on every request, once you have it in your session headers every request will get it, so that will save you some work.

Also It might be a good idea to create the session and do the authentication, and add the Authorization Bearer token to the session headers in your suite setup, then you can keep all your test cases nice and simple to just what’s related to that test.

Good luck, but don’t hesitate to ask if you get stuck,