Saturday, April 17, 2021

How to Fake or Mock an API with JSON Server : Simple and Easy steps




******************************************************************************
How to Fake or Mock an API with JSON Server
******************************************************************************

JSON Server is an easy and quick-to-set-up module that you can use to fake or mock an API.


Getting Started:

1. Install node.JS on your system
2. Exeute below command to install json-server globally 
     npm install -g json-server

3. Create the db.json file in folder
Eg. C://User/json-server/db.json

4. db.json file contains below simple json, you can have any complex json in db.json file.

4. Once the db.json file is created, navigate to the folder where the file is saved.
From the folder path, open a command widow and type the command

json-server --watch db.json

5. Now check if you can able to access json server and it is up and running by hitting 'http://localhost:3000'
6. Open POSTMAN, Create GET request with API 'http://localhost:3000/employees'
Hit Send button
You should be able to see the response
Now, you have successfully faked REST APIT with json server and you can play around with your json server with CRUD operations.
------------------------------------------------------------------------------

Friday, April 16, 2021

How to provide testng.xml file name at runtime

 






1. How to run testng tests from maven cmd


Prerequisite for Java
1. Java should be installed on your system.
2. Eclipse should be available.
3. Maven Java project should be created.

Prerequisite for TestNG
1. TestNG plugin should be added in eclipse IDE.
2. TestNG dependency should be added in pom.xml
3. TestNG tests should be created in your project.
4. testng.xml file should be created.

Prerequisite for Maven
1. Maven should be installed on your system.
2. Download maven https://maven.apache.org/download.cgi
3. Add maven to environment variables in your system.
4. Run the below command to check maven version

Command : mvn -version



How to provide testng.xml file name at runtime.

Step 1. In pom.xml in place of testng.xml file name give a reference
${fileName}

Step 2. In command add parameter
mvn clean test -DfileName=testng.xml

Run testng tests from maven cmd






1. How to run testng tests from maven cmd


Prerequisite for Java
1. Java should be installed on your system.
2. Eclipse should be available.
3. Maven Java project should be created.

Prerequisite for TestNG
1. TestNG plugin should be added in eclipse IDE.
2. TestNG dependency should be added in pom.xml
3. TestNG tests should be created in your project.
4. testng.xml file should be created.

Prerequisite for Maven
1. Maven should be installed on your system.
2. Download maven https://maven.apache.org/download.cgi
3. Add maven to environment variables in your system.
4. Run the below command to check maven version

Command : mvn -version



How to run testng from maven command line

Step 1. Add maven surefire plugin in pom.xml
https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-surefire-plugin/2.19.1

Step 2. Provide location of your testng.xml file
/ProjectName/testng.xml

Also you can provide complete path
C:\Users\Username\eclipse-workspace_API\projectName\testng.xml

Step 3. Open cmd and go to location of project

Step 4. Run commands
mvn clean
mvn install
mvn test
 or you can only run command 
mvn clean test

Step 4: It will start executing the maven command



How to provide testng.xml file name at runtime






















Wednesday, April 14, 2021

Top 10 agile interview Question and Answer Set 2

 



1. What are the disadvantages of the agile model?
 Some of the disadvantages of using an agile model are as follows:
a) Not easy to predict: When you encounter a large project, it is not easy to get an idea of how much effort will it need
b) If the guidelines given by the customers is not properly grasped, then the final outcome of the project is not customer satisfying
c) Sometimes focusing on design and documentation is not proper
d) High-level decisions are under the hand of Veterans, if not combined with non-experienced one, freshers have little scope to grasp proper knowledge.



2. What are the places where Scrum and Kanban are used?
 When there is a need for shifting towards appropriate and prominent process then you use Scrum. When you need to improve the process that is running provided that there are not many changes then Kanban is used.



3. What do you mean by planning poker or scrum poker technique?
 The technique which is a card-based estimation based on a general agreement is known as scrum poker or planning poker. Some features of it are:-
The first step is to story of the agile user is read by the customer or owner. Then the estimator understands the features.

There are different planning cards with a different number for each estimator. The different numbers are the story points.
Based on the estimation which is done by discussing features, the estimator will select a card.
When a common value is selected then it is considered to be an estimate otherwise there is a discussion on maximum and minimum estimation.
Until a general agreement is reached this process is repeated.



4. What is the role of the Scrum Master?
 Here’s how you can answer Scrum Master interview questions like this –
The scrum master is the leader as well as coach of the Scrum team. The scrum master is responsible to serve and protect his team from any kind of distractions that could affect their performance. The main role of the scrum master is to motivate his team to achieve the sprint goal. 

He is focused to build a self-organized and motivated team where each member is familiar with the implementation of Agile and Scrum principles and applications. The scrum master keeps a proper check on the scrum team if they are executing committed tasks properly. He is also responsible to increase the efficiency and productivity of the team so that they can achieve the sprint goal effectively.



5. What do you know about impediments in Scrum?
 Impediments are the obstacles or issues faced by the scrum team which slows down their speed of work. If something is trying to block the scrum team from their getting work “Done” then it is an impediment. Impediments can come in any form. Some of the impediments are given as

  • Resource missing or sick team member
  • Technical, operational, organizational problems
  • Lack of management supportive system
  • Business problems
  • External issues such as weather, war, etc
  • Lack of skill or knowledge

While answering impediments related agile scrum interview questions remember that you may be asked the way to remove any of the mentioned impediment.



6. How do you know if you are using agile development?
 Whenever you are using certain things like Test-driven development, time-boxed task board, class responsibilities collaborators, daily stand up meeting, pair programming, continuous integration, reviews and much more… you will get to know that you are using agile development.



7. What do you mean by sprint retrospective meeting?
 Sprint retrospective meeting is the last part of the sprint. It is probably done after the review meeting of a sprint. The whole teams along with scrum master participate in this discussion and it lasts for 2 to 3 hours.
Scrum master get the review on below question from the team.
a. What went well
b. What not went well
c. What can be better


8. What is the difference between the agile & traditional way of working?
 This question is to judge whether one is aware of the environment of the agile way of working. Here the answer is expected to cover few or all of below:
The traditional way is sequential where design-> Development-> Testing etc. happen one after another whereas in agile all of this is done in every iteration/sprint

Changes are welcomed in agile as Scope is flexible whereas in traditional manner scope is fixed in the beginning due to which changes have to follow change request path

Progress is measured with % completion traditionally whereas working software is the measure of progress in agile

Project Manager as a central controlling authority is traditionally driving the project whereas Self-motivated and self-organizing teams drive the projects in agile.



7. What are the responsibilities of a Scrum Master?
 Key responsibilities of a Scrum Master involves:

  • Tracking and monitoring
  • Understanding requirements properly
  • Work to reach the project goal
  • Process checking master and quality master
  • Protect the team from detachments
  • Improving the performance of the team
  • Lead the meetings and resolve issues
  • Resolution of conflicts and impediments
  • Communication and reporting



8. How much time should a person expect to spend on Scrum Master activities?
 A ScrumMaster should make this role their top priority to focus on the benefits of the overall team. Their load will vary from sprint to sprint depending on what impediments and issues the team are dealing with Newly formed teams typically take more ScrumMaster time; 50%-100%, while experienced ScrumMasters with established well functioning teams might spend 50% or less time on the ScrumMaster role.



9. What is the difference between the Sprint Planning Meeting and Sprint Retrospective Meeting?
 The difference between the Sprint Planning Meeting and Sprint Retrospective Meeting is as follows:

Sprint Planning Meeting – A meeting in which all the Scrum roles (product owner, scrum team, and scrum master) have a discussion about the team’s priority features and product backlog items is known as a sprint planning meeting. This meeting is held every week and lasts for almost 1 hour.

Sprint Retrospective Meeting – A meeting in which all the Scrum roles (product owner, scrum team, and scrum master) have a discussion about the good part of the sprint, the bad part of the sprint, and the sprint improvements is known as sprint retrospective meeting. This meeting that is held at the sprint review meeting or at the end of the sprint; it lasts for 2-3 hours.

This is one of the frequently asked Agile Scrum interview questions. You may be asked to define the above terms separately or the difference between these two.



10. What is the difference between Epic, User stories & Tasks?
 An epic is a group of related user stories.

User Stories define the actual business requirement. Generally created by the business owner.
Task: To accomplish the business requirements, development team create tasks.



11. What is the difference between agile & scrum?
 This question will test whether you are aware of a broader picture of agile and its different frameworks or flavors. Below image will help you explain this answer where you can say agile is an umbrella of values and principles and under it, one of the lightweight frameworks is called Scrum.


Top 10 agile interview Question and Answer Set 1






1. What is a Sprint Retrospective meeting?

 This is mostly the last part of the sprint or may be done after the sprint review meeting. Scrum master and the whole team participate in it, they discuss ‘ What went well’,’ What did not went well’ and ’ what needs to be improved’. It generally lasts for 2-3 hrs.



2. Is it ever suggested to use waterfall over Scrum? If yes, explain when?
 Yes, sometimes it is suggested to use the waterfall model over Scrum. It is done when the customer requirements are simple, well-defined, fully understood, predictable, and are not subjected to change until the completion of the project.



3. What is a Daily Stand-up Meeting?
 Daily Stand-up Meeting is a daily routine meeting. It brings everyone up to date on the information and helps the team to stay organized.
Each team member reports to the peers the following:
1. What did he/she did yesterday
2. What are the impediments faced
3. What he/she will do today

In general, it’s not a recorded meeting. Reporting will be between peers not to Scrum Master or Product Owner. It is normally timeboxed to a maximum of 15 minutes.
It is 15 Minute Stand-up Meeting.



4. What is the lifespan of the scrum cycle?

 The project size and team size are the two main factors which determine the time length of the scrum cycle. The size of a team can be 3 to 9 members. Usually, it can be estimated that the time span of a scrum sprint of about 3 to 4 weeks on an average.


5. What are the main roles in the scrum?
Scrum team: – Scrum team is made by an individual person who works collectively to achieve a particular task. The team works in a bond to deliver committed and requested product
Scrum master: – scrum master is responsible for the proper execution or working of the scrum team. Being a servant – leader and a coach, he ensures the proper productivity of a team towards scrum a sprint goal.
Product owner: – product owner has the responsibility to deliver a complete picture of what to build and to convey that idea to the team



6. What are the places where Scrum and Kanban are used?
 When there is a need for shifting towards appropriate and prominent process then you use Scrum. When you need to improve the process that is running provided that there are not many changes then Kanban is used.



7. What does a scrum burndown chart comprise?
Answer: A scrum burndown chart should consist of
X-axis that displays working days
Y-axis that displays remaining effort
Ideal effort as a guideline
Real progress of the effort



8. What does the X and Y-axis of the burndown chart?
 In burn down, chart X-axis shows working days and Y-axis shows remaining efforts.
Project XYZ
Here, in the image blue line depicts the ideal time suggested for completing the project. For example in a project ideally, 28 tasks (efforts) are pending on the starting day of the project. And the project is scheduled to be completed in 20 days. So on the 20th day, zero tasks (efforts) should remain, which means the project should get completed.

On the other hand, the red line depicts the actual task (efforts) given with respect to the days. Here on day 5, 7 tasks need to be completed as per planning, however, in actual only 4 tasks were completed.
Thus, it provides proper tracking down of the progress of the project and thereby helps in improving the efficiency and on-time taken to deliver the project.



9. What are the artifacts of Scrum process?
Sprint backlog – The Sprint Backlog is the set of Product Backlog items selected for the Sprint, plus a plan for delivering the product Increment and realizing the Sprint Goal. The Sprint Backlog is a forecast by the Development Team about what functionality will be in the next Increment and the work needed to deliver that functionality into a “Done” Increment.
Product backlog – The Product Backlog is an ordered list of everything that might be needed in the product and is the single source of requirements for any changes to be made to the product. The Product Owner is responsible for the Product Backlog, including its content, availability, and ordering.
Velocity chart- A velocity chart shows the sum of estimates of the work delivered across all iterations. Typically, velocity will stabilize through the life of a project unless the project team make-up varies widely or the length of the iteration changes.
Burn-down chart – It is a chart that shows how quickly you and your team are burning through your customer’s user stories. It shows the total effort against the amount of work we deliver on each iteration.



10. What do you mean by the disadvantages of the agile model?
 There are certain disadvantages of the agile system which are discussed below.
It is not easy to predict. If a big project is assigned you will have a problem to estimate the effort you need to put into that.
Focusing on design and documentation is not always proper.
The final product will not satisfy the customers if the guidelines given by the client are not properly understood.
The high-level decision making is in the hands of the higher authorities which makes the fresher to have little knowledge.


Top 10 agile interview Question and Answer Set 2

Tuesday, April 13, 2021

Generate Cucumber JVM report by bat file/ without running project as Mvn clean install



Generate Cucumber JVM report without running project as Mvn clean install: 


Please refer previous post for generating Cucumber JVM report - Generate most preferred Cucumber JVM report
Here we will discuss about generating the Cucumber JVM report without running the project as Maven clean install.

It is not feasible every time running the test by specifying clean install on Run configuration.

So, I thought of creating the Cucumber JVM report by running the test runner.

Here we will create .bat file where we will specify the cucumber sandwich.jar file location and your Cucumber report location. In addition, we need to create the utility to read .bat file after the test execution so that .bat will read the jars and create the Cucumber JVM report.

We can achieve this using Cucumber Sandwich Jar.

Follow the below steps:
1. Go to the URL to download jar file https://mvnrepository.com/artifact/net.masterthought/cucumber-sandwich/3.7.0
2.   Download Cucumber sandwich Jar
3. Create generateReport.bat file under your project, provide your jar file and report location

For example : 4. Create the utility say “ReadbatFile” to read the .bat file
5. Call “ReadbatFile” in @BeforeClass so that this will call after your test execution.

5. Run the runner.java class, while finishing the execution your .bat file will execute and you will command prompt as below

6. Refresh the project
7. Go to the location where gets generated and there you will find Cucumber jvm report generated.

 

For more information – please go to official GIT Hub https://github.com/damianszczepanik/cucumber-sandwich

Saturday, April 10, 2021

Generate most preferred Cucumber JVM report

Today, We will see how to generate cucumber report using maven cucumber reporting plugins, So basically cucumber is very popular tool to do Behavioral-driven development. In cucumber there are number of plugins available for different reporting like Extent report, PDF report, and Cucumber json report etc.

To generate cucumber report from maven cucumber reporting plugins we need to make the necessary changes in POM.xml file. You can find out the cucumber plugins here https://cucumber.io/docs/cucumber/reporting/

To generate the cucumber report we need to generate JSON report from which cucumber reporting plugins read .json file and will generate the report.

So, basically we need to generate two report

a. JSON report
b. Cucumber JVM report

In order to generate cucumber JSON report we need to add below plugins in TestRunnner.java also we need to update the plugins in POM.xml file as shown below.class

Below is the code snipped of complete TestRunnerClass.java class POM.xml to be updated as below.
Now in order to run the project right click on project, select Run as Maven build and then click on maven build
Specify the maven goal as “clean install” as shown below

Once the execution is done, refresh the project and check if report generated you would see to two report generated shown as below.
Now right click on “feature-overview.html” and open with web browser.

You will see beautiful cucumber jvm report with all details.

Actually, There is a cucumber JVM report plugin which can be used to generate pretty HTML reports with charts showing the results of cucumber runs. This is mainly used to publish cucumber reports on the Jenkins build server. There is a maven plugin also to generate the same report in the local directory. We will see both here.
Here is the git hub project for the pretty cucumber HTML repor https://github.com/damianszczepanik/cucumber-reporting

 

Here is the detailed instruction on publishing the cucumber report on the Jenkins build server: https://github.com/jenkinsci/cucumber-reports-plugin/wiki/Detailed-Configuration

Tuesday, April 6, 2021

Must know about Agile



An Introduction to Scrum?
The Agile practices and patterns have evolved in many additional layers over the years, and the Scrum practice, which is a subset of Agile, has subsequently unfolded itself in multiple levels, to address the complexities that arise in product development.


What is Scrum?
Scrum is a simple, lightweight process framework designed to help small cross-functional and self-organized teams develop complex products.
Therefore, it is an agile process framework that can be applied to product development projects that:

1. stick to specified deadlines,
2. need complex requirements and
3. still retain a level of uniqueness.


Why Scrum?
Before delving deep into the concept and the functioning of the Scrum methodology in product development, it is crucial that we understand the benefits of this methodology. Here are a few ways in which Scrum assists in product development:

    Ã˜ With scrum, companies can build iteratively and incrementally and deliver products that Scrum allows to incorporate customer feedback at the end of every sprint (sprints are repeatable work cycles, also known as iterations; a sprint can be anywhere between a week to a month). This ensures that the products align with the needs of the customer and value to the user; rather than building products on assumptions.
    Ã˜ Scrum improves ROI by reducing costs. The Scrum methodology aides in eliminating wasteful procedures and skips unnecessary work that makes for a faster, leaner and cost- effective product development teams and processes.
    Ã˜ Scrum is therefore a methodology that helps in building products of value that find
relevance and use among customers, in short time; and thereby benefits businesses and engineers largely.


Scrum Roles
  • Product Owner
  • Development Team
  • Scrum Master

1. Product Owner
Product Owner is the single person responsible for managing the Product Backlog.
He / She is the key stakeholder in a product development project and is responsible
for maximizing the return on investment. This is usually someone who is from product
management or marketing, or a key user.

Responsibility
1. Controlling the priority of items in the team’s backlog
2. Directing the team towards valuable work and eliminating/reducing time on less
valuable work
3. Being the single authorizing body who allots the work or changes the priority of
items
4. Maximize team’s effort value by making sure the team understands the requirements
5. Representing the customers or the users of the product
6. Creating acceptance criteria for the product’s backlog items
7. Answering team members questions as and when required, and so on

2.  Development Team
Scrum teams are cross-functional, self-organizing teams, which means the team comprises a range of skills which in a traditional setup may be found in different departments. 
The scrum team usually consists of few people – five to ten members – but it can even expand to hundreds, as per demands

Responsibility
1. As Teams are cross-functional, all the skill-sets required to develop a shippable product is available in the same team and they work in a single room, thereby increasing the likeness at succeeding in a given project.
2. The Team is given autonomy in its functioning and is responsible for achieving the targets and the “done” status between the Sprint Planning and the Sprint Review meetings.
3. However, each member, beyond effectively contributing in their area of specialization,
is also expected to work outside their areas to best move backlog items.
4. The Scrum Teams, therefore, works with the motto of not restricting themselves to their area of specialization but “doing the job” and self-organizing to accomplish the task at hand.
5. It also creates and owns the estimates that are involved in a product development
project.
6. It is responsible for incorporating and completing user stories, in order to increase the
value of the product that is developed.

Scrum Master
The Scrum Master is the coach who maintains the productivity of the Scrum Team.

Responsibility
1. The Scrum Master expedites the Scrum process and keeps the Scrum artifacts visible.
2. The Scrum Master is responsible for coaching the Scrum Team into a high-performing,
self-organizing team.
3. The Scrum Master helps the team learn and apply scrum practices within the team.
4. The Scrum Master removes impediments that may hamper productivity in the team.
5. The Scrum Master does not hold an authoritative hand in the team and does not make
business or technical decisions, nor commit to work on behalf of the team.
6. On the other hand, the Scrum Master is the coach who guides the Scrum team with
the knowledge and the responsibilities that are expected of the role.
7. The Scrum Master also works with the Product Owner by often suggesting eective
Product backlog management, in order to maximize value.


Agile Ceremonies/Scrum Meetings
  • Sprint planning meeting
  • Daily Scrum
  • Sprint Review Meeting
  • Sprint Retrospective meeting
  • Backlog Refinement meeting

Sprint planning meeting
This meeting is conducted at the beginning of each iteration or Sprint. The Product Owner and the Scrum Development Team sit together and decide on the Product Backlog Item that is of most importance to business at the moment, and work on it at the particular Sprint.

    Later, the Team breaks down the Product Backlog Item into Sprint Tasks and decides on the work flow that needs to be followed to accomplish the task in the given time. In this meeting, the Team also defines the objective or the Sprint Goal. The Sprint Goal is the end product of the negotiation between the Product Owner and the Scrum Team while deciding on the Product Backlog Item. The Product Owner’s presence is not mandatory during this part of the meeting.

Ideally, the time spent on a Sprint Planning Meeting for a Sprint that would last two
weeks will round up to 4 hours.

Daily Scrum
This meeting is conducted every day, at the same time and place, before commencing on the tasks for the day and lasts around 15 minutes. The Scrum Team gathers and there is a discussion on the accomplishments of the previous day, what is to be accomplished over the present day and what are the impediments that are expected.

While doing so, the team will examine the current Sprint Task list, Sprint Burndown Chart, and impediments list. The Sprint Task list contains the list of fragmented work-units that are to be conducted in the given Sprint.

Sprint Review Meeting
This is the point at which the Scrum Team delivers the workable product to the Product Owner and the stakeholders. The Product Owner then decides on the “done” status for the tasks and incomplete tasks are sent back to the Product Backlog for
future Sprints.

One of the main advantage of conducting this meeting, is that it allows stakeholders and customers to provide feedbacks and inputs on the developed product. These feedbacks are added as new Product Backlog Items and incorporated during a different Sprint activity.

Sprint Retrospective meeting
This stage in product development occurs after the Sprint Review and before the next Sprint Planning. For a Sprint that is two weeks long, the Sprint Retrospective would usually be held for about 90 minutes. 
It is the responsibility of the Scrum Master to schedule a Sprint Retrospective and ensure all team members participate.
During this stage, the Team reflects and analyzes their activities during the last Sprint bases on two points

What went well?
What can be better/improved?


Backlog Refinement meeting 
The team splits large Product Backlog Items and gets issues relating to them clarified. New user
stories may be written by a part of the team, by including the notions laid out by the Product Owner and the stakeholders.
 Finally, the Product Owner prioritizes the effort on the Product Backlog items, before the next Sprint Planning Meeting.


Agile Artifacts
  • Product Backlog
  • Sprint Backlog
  • Burndown Chart

Product Backlog
The Product Backlog is a list of all the requirements needed in product development and is also the single source of requirement for changes to be made in the product.
The contents to the Product Backlog can be added by the stakeholders or the team members. Hence it is a list that constantly evolves and grows and changes to match the needs of the product.

The Product Backlog Items are the specific items in a Product Backlog. It is the unit of work to be completed by a Scrum Team in one Sprint iteration. The effort to be taken in a Product Backlog Item is estimated by the Team in the form of user stories.
However, the business value for this is decided by the Product Owner, in order to
prevent technical debt.

                                                                Product Backlog



Sprint Backlog
The Sprint Backlog encompasses the Product Backlog items for the Sprint, along with the plan that is devised to achieve a specific objective or the Sprint Goal. This is solely decided by the Development Team. 
The Sprint Backlog keeps changing and evolving during the Sprint activity – new requirements and changes relating to work are added, and unnecessary elements are deleted from the list, as and when required. 
In short, this is some kind of an “information radiator” that looks like a physical task-board.

Sprint Planning



Burndown Chart
A burn down chart is a graphical representation of work left to do versus time. It is often used in agile software development methodologies such as Scrum. However, burn down charts can be applied to any project containing measurable progress over time.

Typically, in a burn down chart, the outstanding work is often on the vertical axis, with time along the horizontal. It is useful for predicting when all of the work will be completed. In the Daily Scrum the Development Team updates the Sprint Burn Down and plots the remaining work of the day. A burndown chart is almost a “must” have tool for a Scrum team for the following main reasons:



                                                                Burndown Chart


Scrum Communication Model



Top 10 agile interview Question and Answer

Top Basic Selenium Interview Questions and Answers









1. What is Selenium?
Selenium is one of the most powerful open source automation tool for web application testing (even we can say acceptance testing for the web application) which lets you automate operations like type, click, the selection from a drop down etc of a web page. Primarily developed in Java Script and browser technologies such as DHTML and Frames and hence supports all the major browsers on all the platforms.


2. Who developed Selenium Tool and Why? 
Jason Huggins and team developed this tool in 2004 when they were working for Thought work (IT outsourcing company). They created this tool for the testing of an internal time & expenses application written in (python).


3. What is Selenium IDE? 
Selenium IDE is a Firefox plug-in which is (by and large) used to record and replay test is Firefox browser. Selenium IDE can be used only with Firefox browser.


4. Which language is used in Selenium IDE? 
Selenium IDE uses html sort of language called Selenese. Though other languages (Java, c#, php etc) cannot be used with Selenium IDE, Selenium IDE lets you convert test in these languages so that they could be used with Selenium 1.0 or Selenium 2.0


5. There is id, name, XPath, CSS locator, which one should I use? 
If there are constant name/id available than they should be used instead of XPath and CSS locators. If not then CSS locators should be given preference as their evaluation is faster than XPath in most modern browsers.


6. I want to generate random numbers, dates as my test data, how do I do this in Selenium IDE? This can be achieved by executing javascript in Selenium. Javascript can be executed using the following syntax 1 Type – css=input#s– javascript{Math.random()}


7. What is Automation Testing? 
Automation testing is the process of testing a software or application using an automation testing tool to find the defects. In this process, executing the test scripts and generating the results are performed automatically by automation tools. It is required when we have huge amount of regression test cases. Some most popular tools to do automation testing are HP QTP/UFT, Selenium WebDriver, etc


8. What type of tests have you automated? 
Our main focus is to automate test cases to do Regression testing, Smoke testing, and Sanity testing. Sometimes based on the project and the test time estimation, we do focus on End to End testing.


9. How many test cases you have automated per day? 
Actually it depends on Test case scenario complexity and length. I did automate 2-5 test scenarios per day when the complexity is limited. Sometimes just 1 or fewer test scenarios in a day when the complexity is high.


10. Is Selenium 2.0 different from Selenium 3.0?
If so, how? Selenium RC is called Selenium 2.0, and the integration of Selenium RC and WebDriver as a single tool has formed Selenium 3.0.


11. Mention some of the popular tools used for Automation Testing. 
a. Selenium 
b. Rational Robot 
c. HP Unified Functional Testing (UFT) 
d. IBM Rational Functional Tester



12. What is an object repository? 
An object repository allows testers to accumulate web elements of the application under test (AUT), along with their locator values, in one or more centralized locations as restricted to hardcoding them within the test scripts.


13. What are the four elements that you have to pass in Selenium? 
Four parameters that need to be passed in Selenium are: 
a. Host 
b. Port number 
c. Browser 
d. URL


14. What is an ‘element’?
Every single object that is present on the webpage is called an element.


15. What operating systems support Selenium?
All three of the main operating systems – Windows, Apple and Linux.


16. What’s the difference between soft and hard asserts? 
A soft assert will run the test and not throw an exception if the assert failed, while a hard assert will throw the exception immediately, and then continue with the testing process. 


17. Name the different types of locators in Selenium. 
There are many different locators used within the Selenium training framework, but just to name a few of the main ones: ID, Name, Xpath, LinkText, DOM, etc.


18. How would you scroll down the page using JavaScript?
To do so, you would have to execute the window.scrollBy() function. 

Example: ((JavascriptExecutor) driver).executeScript("window.scrollBy(0,750)"); 


19. How would you take a screenshot with Selenium Webdriver? 
Yet another one of the Selenium interview questions – you are more than likely to get quite a few of these. To take a screenshot, you would have to use the TakeScreenshot function. After that, you can save the screenshot by using the getScreenshotAs() command.

Example: from selenium import 
                webdriver browser = webdriver.Firefox();
                browser.get('http://www.bitdegree.org/');
                browser.save_screenshot('courses.png');
                browser.quit()


20. How would you upload a file via Selenium Webdriver?
An example of how you could do it is provided below. Keep in mind that you have to include input and file tags. 
element = driver.find_element_by_id(”uploaded_file") element.send_keys("C:\pictures.png")


21. What’s Junit? 
Even though it’s classified as one of the more advanced questions, the answer is pretty simple and straightforward. It is considered to be advanced mainly because not a lot of people know about it.
Junit is a Java-based framework designed for unit testing.


22. What is Selenese? 
Selenese is the language which is used to write test scripts in Selenium IDE.  

How to install Java on EC2

***************************************** How to install Java on EC2 ***************************************** To be continued, In this post...

All Time Popular Post