Gauge + Taiko – Automation Tools.

I was trying my hands on with Gauge framework and Taiko automation tool, and found that it was so easy to write and maintain tests using it.
Gauge helps you write the test specification in BDD manner and is quite easy to learn.

Taiko is just a charm, it requires less programming knowledge and is quick and easy to learn.
The most interesting part of Taiko was its smart locators, you dont have to dig into the DOM of the page to search for loactors, its locates the elements smartly.

Using Taiko alone, you can quickly write tests and run the smoke test round easily.

The only drawback I found in taiko was it just supports Chrome.

Overall, Gauge and Taiko are nice opensource automation tools, you should try your hands on!!

You can find the example code I created on github in the following link:

https://github.com/mfaisalkhatri/GaugeTaikoExample

#gauge #taiko #javascript #automationtesting #testing #opensource
#automation #softwaretesting #github #beginner #learning #knowledgesharing

REST-Assured or OkHttp??

I was learning and exploring the popular open source frameworks, “REST-Assured” and “OkHttp”. An idea just popped into my mind, why not save the code on github so it would serve as a learning material for a beginner.

So, I created and posted the code which I wrote, on github in the following repository:

https://github.com/mfaisalkhatri/OkHttpRestAssuredExamples

While I was running the tests, I found an interesting thing which caught my attention. The execution speed of OkHttp when compared to Rest-assured was far better.

The following image shows the Test execution time which a Get Request took.

GetTests

“2.002 seconds” was taken by OkHttp, however for executing the same API test using REST-assured, it took “3.131 seconds”. Similarly for running the next test, OkHttp took “0.124 seconds”, and REST-assured took “0.372 seconds”.

Now, lets jump to execution time taken for Post Request.

The following image shows the Test execution time which a Post Request took.

PostTests

“2.252 seconds” was taken by OkHttp, however for executing the same API test using REST-assured, it took “4.521 seconds”. Similarly for running the next test, OkHttp took “0.649 seconds”, and REST-assured took “0.72 seconds”.

Going further, lets check execution time taken for Put Request.

The following image shows the Test execution time which a Put Request took.

PutTests

“5.226 seconds” was taken by OkHttp, however for executing the same API test using REST-assured, it took “8.008 seconds”. Similarly for running the next test, OkHttp took “0.555 seconds”, and REST-assured took “0.77 seconds”.

Lets have a look at the Patch requests execution time.

The following image shows the Test execution time which a Patch Request took.

PatchTests

“2.171 seconds” was taken by OkHttp, however for executing the same API test using REST-assured, it took “4.268 seconds”. Similarly for running the next test, OkHttp took “0.623 seconds”, and REST-assured took “0.683 seconds”.

Lets have a look at the Delete requests execution time.

The following image shows the Test execution time which a Delete Request took.

DeleteTests

“0.718 seconds” was taken by OkHttp, however for executing the same API test using REST-assured, it took “7.353 seconds”.

Considering the facts written above, we can say that OkHttp is faster and better in terms of execution than REST-assured.

However, in terms of writing the tests, I enjoyed writing the tests using REST-Assured as it has the method chaining feature which allows to write tests efficiently and in one go. However, that is not the case with OkHttp. (You can check the github link I have mentioned above to check how to write tests using REST-Assured and OkHttp).

To conclude, I would mention that it all depends on the automation framework you choose for your test project, in my view, you should choose the one which you feel implementing and maintaining is easy. As tests would be executed only once the implementation part is completed.

 

 

Rules, Records, Change!!

You were asked not to break the rules.
You were taught to follow the education system blindly.
You were asked to ask the questions which were related to the subjects you had in your school/colleges.
You were told to learn and write the theory as explained in the books, any deviation from that would lead to marks being cut or you getting failed.
I believe, all of us did as we were told to.

Now, after following what we were told and what we were taught.
We are being asked to Change according to the ever demanding, ever changing society.

You are told in a quoted sentence, “Rules and Records are meant to be broken”.

So, you must accept the change, and to change you should initiate it.

Now, the question here is, Were we following a bogus system? OR
Were we taught just because the schools and colleges wanted to earn more money from the old dated education system?

If change is so important, why isn’t the education system and the out-dated theories are yet to be replaced?

Why does the student today too, has a doubt when he speaks these words, “It came out of the syllabus!”

Regards,

Faisal

My Website.

Hi all,

Have a look at my website, which has 2 lines couplets, Poetries and Short Story all written by me.

Also, dont forget to checkout my Facebook/Instagram and Twitter pages – Shayri’s – The Ghalibway.

Click here to checkout my website:

Shayri’s – The Ghalibway.

Facebook page:

Shayri’s – The Ghalibway

Twitter: @shayrighalibway

Regards,

Faisal Khatri.

Why is Maven more preferable than Simple Java project?

Hello Everyone,

Today we will be discussing about maven and java projects.

Many people are aware of Maven. But if I ask why would you prefer Maven based Java project over simple Java project?
Many may give just a normal answer like “Maven has the ability to download dependencies automatically based on the dependencies block you put in respective maven project’s pom.xml file”.

Yes, that’s true and its one of the major bonus point of maven based java project. But there are certain other benefits in maven which when utilized fully can help you a lot in managing and implementing your project.

Let me describe you all the benefits of using maven on by one.

So, let’s get started.

39111510-diversity-people-discussion-barinstorming-communication-concept

What is Maven?
Maven is a powerful project management tool that is based on POM(project object model). It is used for projects build, dependency and documentation.

How Maven solves the following problems we face in project management:
1. It adds all the necessary jars to the project as per the dependencies put by user in pom.xml file.
2. Automatically creates the right project structure.
3. It makes a project easy to build.
4. It provides project information like log document, cross references sources, mailing list, dependency list, unit test reports, etc.
5. Works with CLI(Command line interface).

Following is the project structure of maven project, created in Eclipse IDE:

2019-02-24 21_47_36-Window

What is pom.xml?
POM is an acronym for Project Object Model. It contains information about project and configuration of the project such as dependencies, build directory, source directory, test source directory, plugins, goal, etc.
Maven reads pom.xml and then executes goal.

Following is the sample of pom.xml file:

<groupId>com.mfaisalkhatri</groupId>
<artifactId>cucumberpractice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<dependencies>
	<dependency>
	   <groupId>junit</groupId>
	   <artifactId>junit</artifactId>
           <version>4.12</version>
	   <scope>test</scope>
        </dependency>
	     <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
	          <dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-java</artifactId>
			<version>3.14.0</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>3.7.0</version>
				<configuration>
					<encoding>UTF-8</encoding>
					<source>1.8</source>
					<target>1.8</target>
					<compilerArgument>-Werror</compilerArgument>
				</configuration>
			</plugin>
		</plugins>
	</build>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
</project>

Once you put dependencies inside the file and save it, maven searches for dependency in maven central repository and downloads the jar files accordingly for your project.

Maven CLI Commands:
1. mvn validate : Validate the project is correct and all necessary information is available.
2. mvn compile : Compile the source code of the project.
3. mvn test : Test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.
4. mvn package : Take the compiled code and package it in its distributable format, such as a JAR.
5. mvn integration-test : Process and deploy the package if necessary into an environment where integration tests can be run.
6. mvn verify : Run any checks to verify the package is valid and meets quality criteria.
7. mvn install : Install the package into the local repository, for use as a dependency in other projects locally.
8. mvn deploy : Done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

There are two other Maven life cycles of note beyond the default list above. They are as follows:

1. mvn clean : Cleans up artifacts created by prior builds.
2. mvn site : Generates site documentation for this project.

Phases are actually mapped to underlying goals. The specific goals executed per phase is dependent upon the packaging type of the project.

You can also run the above commands using life cycles commands for e.g.
1. mvn clean install.
2. mvn clean test
3. mvn clean verify, etc..

The other major flaw in simple java project is that you cannot run it from CLI also, all the packaging and deploying tasks needs to be taken care manually which is a very tedious task.

Hope, you have got the basic knowledge of how maven works and why it would be more preferable than the simple java project where you have to do everything manually.

Keep watching this site for more such interesting blogs.

Regards,

Faisal Khatri.

(Maven commands have been taken from https://maven.apache.org).

Interview Tips – Software Testing.

Recently, I was waiting for my round of interview at a company. I noticed a girl sitting on the corner of sofa on the other side of the room with a book in her hand continuously reading something from it. I had a look at her and understood that she might be waiting for her turn of interview.

Further, some of the guys sitting around had their turn and one by one went in and came out, some were asked to leave, some were told to hold for next round.

I saw the girl, she was getting nervous as and when anyone went in and came out and again started revising the notes she had.

I became a bit anxious as what was she referring to and what danger she was suffering from, hence I moved around and took a seat beside her and greeted here, “Hello!” She smiled and greeted me back and started reading the notes again. I asked her, “Interview??”, She nodded, “Yes”.
I again asked, “For which position?” She answered, “I am a Fresher applying for QA Engineer”.

To calm down my curiosity, I told her that I have been noticing her since last half hour and asked here what was she reading so attentively.
She smiled and in a nervous look told that as she is a fresher and this is her first interview and didn’t have any idea how interview is being taken, hence she is revising the notes she got from an institute where she completed her software testing course.

This instance gave me an idea that I should write a few tips for such people who are facing the interview for first time. So lets begin with this, here are a few tips which might help you in future whenever you go for an interview.
Know Yourself Well: The most important question is they will ask about yourself, so be selective in words as how you define yourself, what you are, what you do, your organisation experience(if any), your educational qualifications, your family background and your hobbies.
Be Confident: This is the most important part for preparation, your body language should speak that you are confident about what you are saying.
Don’t Revise till last minute: Be prepared well in advance, do not take your notes with you to the interview venue, this shows you are not confident and you lack knowledge.

Listen to the Interviewer and then Act: This is another important part in interview. You should be a good listener, listen what the interviewer is telling, let him finish with this part and then when you are given your time, answer and be specific to the topic to what is being asked.

Your Answer is their Question: Yes, you read it correctly. Think twice before speaking or giving any statement. Don’t give vague answers, if you already tried things in the past or have hands-on experience, than only mention those points, else it’s better to quietly say, that you don’t know anything about it.
Read your Resume/CV well: Whatever you have written in the resume/CV you should know it well and whenever the case comes, you should be able to make them understand those points well.
Make it a discussion rather than interrogation: A successful interview is that from which both the parties have good experience, and experience comes when it is a discussion, don’t just answer in mere “Yes” and “No”.
Revise your basic technical knowledge: I visit the following websites for reading and knowing the technical terms/interview Q&A.
https://www.softwaretestinghelp.com/qa-interview-questions/
https://www.guru99.com/qa-interview-questions-answers.html.
Domain Knowledge: Though this is of least important, but many companies prefer candidates who have knowledge of domains in which they do business. You don’t have to be a domain expert for this, but you should have a basic understanding of the domain. Like for example, in case of capital markets, you should know what are equity shares? How trading takes place? what is a stock exchange? what is equity and derivatives market?, etc..
Hope you have got basic idea of what to do and what not to in while appearing for an interview.
Do visit this blog here, for more such informative posts.
Regards,
Faisal Khatri.