I really don’t know what, where or how to start with? For eons I wanted to start my own tech blog where I can share my experiences, code snippets etc but never got around to doing so. I just want this blog to be like a reference note book that we write notes in in school and college and then refer at a later time or share with anyone who is facing same struggles that I had. I want to catalog everything that I have picked from trillion different sources, and this is an effort to collate all of that at one place.
As a starting point, I created this blog to share my handiwork with anyone who might want to use it as a reference. Ofcourse there is scope to optimize these pieces of codes, but not everyone needs the most optimal or THE best. Some (like me) need a starting point and get the work done. All my code is Java based using open-source free tool like Eclipse, Postman, Selenium, etc.:
1. Automate DB testing: Using JDBC
a. User stores DB information, SQL queries and test data in XL (in the project resource folder)
b. Code reads DB information and establishes the connection
c. It then iterates thru the SQL query and collects the column names and writes them as headers in dynamically created XL book.
d. The code then iterates thru the test data and collects the DB response and write back in the workbook creating a test repository that can be used as expected data (in my case) or as result XL.
2. Automate API testing: Using a JSONSimple (can be done with Jackson as well)
a. User stores test URLs and test data in XL (in the project resource folder)
b. Code reads those URLs, collects keynames and writes them as headers in dynamically created results XL workbook.
c. After readying the workbook with headers, the code then iterates thru the test data and runs API URL with unique data, collects the values and writes them in the results workbook.
3. Automate Front-end testing: Using Selenium Webdriver
a. I have not been able to think of a logic to make dynamic frontend testing. Yes you can collect all xPathes etc, but how do we figure out what data user wants to collect … oh well one thing at a time.
b. For now this selenium code will have to be written by the user and the response collected into XL dynamically
4. Creating and propagating the report:
a. The code now compares the all 3 results XLs (from DB, API and Frontend testing) and compares them. If any mis-match is found, the cell is highlighted in the results workbook (any workbook can be designated as final results workbook)
b. The code then emails the people on the user defined list with results workbook as attachment.
c. Other twist is to create custom Junit report and email the report either in the body of email or as downloadable html file.
5. In case of continuous integration with Jenkins, project can be built with either Maven or ANT. I will share both codes here.
6. I will also add lot of small misc. stuff related to random issues I encountered during my tech journey.
Everything I have in my blog is from my own experiences, github, API Java docs, tutorials, Stackoverflow or other similar online sources