USSD app automation testing - java

I am very new to automation and API testing. My current project is USSD based for banking. I am currently testing manually by giving inputs on browser simulator and reading the console output (ssh into the server). The basic function of the API is to generate POST requests with all the parameters and send it to respective bank. I am looking to to automate this process and validate the request sent and the response received. I was thinking of using Selenium for browser automation but I have no idea how would I extract the response from the terminal to validate.
Please suggest as how I should go about this and if this is the right process. If there is any other way to handle this please suggest.

If you're testing REST API You should use REST Assured for automated testing (postman tool) for manual testing. If You should test end to end - then Selenium is the right tool.

Related

How to get the response of an intermediate API call?

I am currently trying developing some API tests using rest-assured. More specifically, I am trying to test Stripe's payment gateway (3DS). The way it works is that I subscribe a user using our API endpoint, which has a response including an external link to Stripe's website where the user fills out a form for their payment details.
This part is fine and dandy.
The problem lies ahead. I need to be able to send a POST call to this form with the payload of the form. However, the POST payload that Stripe is expecting includes other elements that are not part of the form such as muid, guid, sid, key, and payment-user-agent. After doing some research, I see that these elements are given when the user first loads the form. However, they are given are given at an intermediate API call during the loading of the page. Meaning, if I try to call a GET on the form page, I will not retrieve these elements. The loading of the page calls other endpoints sequentially, where at some point, it makes a call to another endpoint with an encrypted request payload, which I cannot reproduce for my automated tests, which returns the muid, guid, and others.
I was wondering if it were possible to get the response of the intermediate API call somehow?
I tried doing research of methods that can possibly achieve this, but I have yet to come up with something that is API testing related.
I cannot do a Selenium script to push the form for me, as I need it to be API testing related, and with no GUI browser included. I could potentially run Selenium in headless maybe, but I was wondering if there was anything more lightweight or a simple way to retrieve the response of the intermediate api call before I proceed with that solution.

Sending Dynamic Emails through a Java Cron Job using Microsoft Graph

I have a java (Spring boot) web service which does not have any UI.
I want to send a dynamic Email (created using Thymeleaf and injecting values from a database) using my web service on a daily Cron schedule, using Microsoft Graph and O365 APIs.
Right now I use SMTP to send emails, but I cannot use it anymore as that is no longer going to be supported by the O365 account that I am using.
I found the SendMail APIs on the Graph Documentation which looks pretty straightforward.
But, using the Graph AIPs requires you to create an Azure AD project first and use their Microsoft Identity platform - which I created.
Now, the problem is that most of the flows also require a user to manually login from a login window.
This is where things get complicated.
I do not have a place to show a Login window to any user from my web service, because it is just a backend service there is no UI. I intend to use a service account for sending the emails through the Application.
I found a Daemon support as well, but it seems to only support Python or .Net code.
Migrating my code from Java to either of those platforms just to be able to send emails
does not feel like a good solution.
And, I'm not even sure if they even offer similar capabilities of sending dynamic emails like Java+Thylemeaf do?
Is there a way to be able to continue doing this using my existing code in Java?
If not, then as the worst case scenario, are there any libraries in Python which can allow me to send dynamic emails like thymeleaf does in Java?
As you don't want to manually login from a login window, you can use the client credential flow.
Here is the guide regarding how to access graph api without user.
Reference:
msgraph-sdk-java-auth (You can choose to use Client credential provider)

Capture request & response from charles proxy using selenium webdriver

I am trying to automate a Video stream player application something like netflix.
What i do now:
I have to tune to a couple of programs / channels manually and check the response in charles proxy to verify if the streaming comes from the right source and validate bitrate, response time and manifest information etc.
What i need to do:
I want to automate the above process. I have searched in the web where people have mentioned about getting the responses for certain browsers ( Firefox / chrome). We can get the responses from firefox using the web console i guess.
I want to write an automation script that is generic enough, so that i can run the tests on different web browsers and compare the responses to one source i.e charles proxy.
Below is what i am thinking of.
cucumber (my test cases) + selenium Web driver (automate things) + Charles proxy ( to validate responses)
Kindly help me if anyone has done this before. Sort of interesting and challenging. Your help is highly appreciated.

Java Webservices Load testing using JMeter

I am trying to test our Corebank system developed in Java-Wicket framework.
MY requirement is to call direct server URLs and perform operations. It is a secured application, so an authentication is needed first (Basic authentication - Username and password).
I am getting an error for authorization header in the start.
After login I need to create saving accounts and fetching info related to saving accounts like account balance and all.
So I wanted to know that is JMeter testing feasible for this webservice testing .
Any help will be highly appreciated.
JMeter is an EXCELLENT tool to test a webservice - both funational & performance testing - which i have done in my project. Both SOAP & REST.
Actually it is much better than SoapUI because with JMeter you can easily read the data from CSV and Parameterize it. SoapUI free version does not provide the option.
To pass authentication
Enable this in jmeter.properties
httpclient.parameters.file=httpclient.parameters
Enable this in httpclient.parameters
http.authentication.preemptive$Boolean=true

Catch-all SMTP server + GUI

I was reading this post about a NetBeans plugin which intercepts all SMTP traffic and stores it for display.
screenshot http://img216.imageshack.us/img216/4733/picture1ezb.png
I find it a great tool for developing locally when you have lots of email interaction and don't want to create {x} accounts.
Is there any such cross-platform tool available outside of NetBeans?
For JUnit testing I like to use Dumbster. It sets up a nice little server in your unit tests that holds the messages you send so you can then use JUnit assertions to validate your code is sending the right thing.
MailSnag is an Eclipse plugin that acts as a dummy SMTP server to capture and inspect emails sent out from an application during development. Each email can be viewed in a multi-tab editor displaying Text, HTML or raw format. A tab listing attachments is also displayed.

Categories

Resources