API-Call Example with Postman or Fiddler - kiwi-tcms

I tried the installation with Docker and Kiwi TCMS and it worked wonderfully. Unfortunately, I have a lot of trouble with API calls. I tried several times without success to import the example Perl script from the documentation (https://gist.github.com/atodorov/f5aed028b6f254d97bcaf93453abe8d2).
Does an example(API-Call) exist without a Perl script (for Postman or Fiddler)? I would like to permanently update existing data with .NET environment.
Thanks :-)

The script in the gist is Python, not Perl.
For .NET I can't help you because I've never written a single line of code in .NET. Maybe somebody else can.
See if you have ready libraries for making XML-RPC calls or JSON-RPC calls. This is very common so I imagine there are such libraries. Then you will need to execute the method names described in out API docs.
In any case if someone is using .NET, or any other language for that matter please contribute your scripts/snippets to https://github.com/kiwitcms/api-scripts so we can build a shared knowledge base.

Related

How do I save a screenshot when an MSpec/Selenium test fails?

I'm using MSpec to drive some automated UI tests using Selenium WebDriver. Much like the examples I found online. I'm having problems getting it to take screenshot when the test fails.
I saw a comment on another issue where it works because they have a ResultSupplementer in the sample web specs. However, ResultSupplementer does not seem to exist in the latest version of Mspec (0.9.1).
Is there a different way to do this in the latest version of mspec? Ultimately, I'm going to generate HTML reports as TeamCity artifacts and include the screenshot on any failing specs.
I've updated the samples for the latest version of MSpec (in short, you need to implement ISupplementSpecificationResults yourself).
I've also merged the solutions and converted the MVC project to Nancy. You'll find that there's a bit more infrastructure-related code that grew over the last couple of years and works around various things, like
status codes 4xx and 5xx logged by IIS Express
IIS and Chrome Driver ports bound by other processes
page objects access the web driver with a high-level API
I use Paket for dependency management because it's far more powerful than plain NuGet
All that said, you need to run msbuild.exe mspec-samples.sln and then All-Specs.cmd. I've also checked that a TeamCity build creates screenshots.

Run system tests against deployed app with Nancy.Testing

I've successfully set up some tests that run complete use cases against our code base using nancy.testing.
Now I'd like to use the same tests for what we call release tests: We deploy the complete application to a staging server and run the system tests against it. We already use that approach successfully with a WCF application.
Is there an easy way to make this work? I've noticed that Browser and BrowserResponse do not use any abstractions, so I cannot replace them with a SystemTestBrowser or similar.
I could of course abstract the whole nancy.testing package away, but I thought I ask here first if someone knows a simpler approach.
Nancy.Testing does not use any network communication at all. If you can think of a nice abstract then please let us know and we can talk and see if it's something we'd like to get into the package!

What file is always loaded with starting app engine instance?

I want to define some globals and load some modules (i.e. valid version of django) before any code is executed in app engine.
Is it any file in app engine where I can define startup code/configuration?
I think about Python language but other languages suggestion is also welcome.
Have a look at this doc. https://developers.google.com/appengine/docs/python/tools/appengineconfig appengine_config.py is loaded before any of your code.
In addition to what the docs say, you can pretty much do anything. Manipulate sys.path, import, monkey patch stuff.
For Python 2.7, if you want to load a specific version of Django, call that version out in app.yaml as noted here Django is one of the many supported third-party libraries.
An other way might be to use warmup requests. This is run on the request made in order to initialize a new server. It could be useful if you have a lot of thing to do and don't want the first request on a new server to stall... On the other hand, warmup requests can be sent even without finally using the new instance, so if you do have a lot of things to do you might end up using more instance hours. Check the documentation for more info.

Libcurl using C

I have created a database using Berkeley DB in C. Now I want to use a libcurl function to send the entries in the database to a server. Can anyone suggest me good examples to read which address somewhat similar scenarios or any other material. I researched a bit and the libcurl homepage has some examples, but I am not able to understand them properly, how to use it in my context. I need examples only for "C" language. thanks in advance.
See the libcurl tutorial for a overview of libcurl, You may also want to look at the easy api reference, as that's what you'll most likely be using

How to wrap a C library so that it can be called from a web service

We have a library with very complex logic implemented in C. It has a command line interface with not too complex string-based arguments. In order to access this, we would like to wrap the library so that it can be accessed with simple XML RPC or even straightforward HTTP POST calls.
Having some experience with Java, my first idea would be
Wrap the library in JNI/JNA
Use a thin WS stack and a servlet engine
Proxy requests through Apache to the servlet engine
I believe there should already be something simple that could be used, so I am posting this question here. A solution has the following requirements
It should be deployable to a current linux distribution, preferrably already available via package management
It should integrate with a standard web server (as in my example Apache)
Small changes to the library's interface should be manageable
End-to-end (HTTP-WS-library-WS-HTTP) the solution should not incur too much overhead, but reliability is very important
Alternatively to the JNI/JNA proposal, I think in the C# world it should not be too difficult to write a web service and call this unmanaged code module, but I hope someone can give me some pointers that are feasible in regards to the requirements.
If you're going with web services, perhaps Soaplab would be useful. It's basically a tool to wrap existing command line applications in SOAP web services. The web services it generates look a bit weird but it is quite a popular way to make something like this work.
Creating an apache module is quite easy and since your familiar with xmlrpc you should check out mod-xmlrpc2. You can easily add your C code to this apache module and have a running xmlrpc server in minutes
I think you may also publish it as a SOAP based web service. gSoap can be used to provide the service interface out of the library. Have you explored gSOAP? See http://www.cs.fsu.edu/~engelen/soap.html
Regards,
Kangkan
Depends what technology you're comfortable with, what you already have installed and working on your servers, and what your load requirements are.
How about raw CGI? Assuming the C code is stateless between requests, you can do this without modifying the library at all. Write a simple script which pulls the request parameters out of the CGI environment, perhaps sanitises the input, calls the library via the command-line interface, and packages the result into whatever HTTP response you want. Then configure Apache to dispatch the relevant URL(s) to this script. Python, for example, has library support for XML-RPC, and so does every other scripting language used on the web.
Servlets sound like overkill, but for instance if you want multiple requests per CGI process instantiation, and don't feel like getting involved in Apache configuration, then it might be easiest to stick with what you know.
I'm doing a similar thing with C++ at the moment. In my case, I'm writing a PHP module to allow PHP scripts to access the logic in my C++ library.
I can then use whatever format I want to allow the rest of the world to see it - initially it will just be through a PHP web application but I'll also be developing an XML-RPC interface.
If you're going down the JNI route, check out SWIG.
http://www.swig.org/Doc1.3/Java.html
Assuming you have headers to project bindings with, swig is pretty easy to work with.

Resources