Testing

Writing test case in Selenium WebDriver with simple example

Writing test case in Selenium WebDriver with simple example
easy way to Writing test case in Selenium WebDriver with simple example
In the following post I will go step by step and explain how to write your first test case using Selenium Webdriver and execute it using TestNG.
1. Right click on the src folder ->New -> Package.

2. Provide package name something like com.stm.test and click “Finish”.

3. Right click on the newly created package – > New -> Class.

4. Provide class name as “RegistrationTest” and click Finish.
Writing test case in Selenium WebDriver with simple example

5. Write the code given below for your first test.
I am taking an example of automating register user functionality for demo sitehttp://newtours.demoaut.com
The code for the first test is as follows:

package com.stm.test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
import org.testng.annotations.Test;
public class RegistrationTest
{
@Test //This is TestNG annotation
public void testRegister()
{
WebDriver driver = new FirefoxDriver();
driver.get(“http://newtours.demoaut.com/”);
driver.findElement(By.linkText(“REGISTER”)).click();
driver.findElement(By.name(“firstName”)).sendKeys(“User1″);
driver.findElement(By.name(“lastName”)).sendKeys(“Surname1″);
driver.findElement(By.name(“phone”)).sendKeys(“123456789″);
driver.findElement(By.name(“userName”)).sendKeys(“user1@test.com”);
driver.findElement(By.name(“address1″)).sendKeys(“Test Address”);
driver.findElement(By.name(“city”)).sendKeys(“Test City”);
Select select = new Select(driver.findElement(By.name(“country”)));
       select.selectByVisibleText(“ANGOLA”);
driver.findElement(By.name(“email”)).sendKeys(“user1@test.com”);
driver.findElement(By.name(“password”)).sendKeys(“user1″);
driver.findElement(By.name(“confirmPassword”)).sendKeys(“user1″);
driver.findElement(By.name(“register”)).click();
driver.close();
driver.quit();
}
}
6. After finishing the test right click on the test and click on RunAs – >TestNG Test
Writing test case in Selenium WebDriver with simple example
7. After executing the test select the project and press F5 to refresh the project. A new folder “test-results” will get created which will show you the results for the execution. Right click on index.html->open with->web browser to see the execution report.
If you like this post hit like button for facebook and share it!!

Important Manual Testing interview Questions with answers

Important Manual Testing interview Questions with answers

Q1. What is Software Testing? 
Ans. Operation of a system or application under controlled conditions and evaluating the results. The controlled conditions must include both normal and abnormal conditions. It is oriented to detection.

Q2. What is Software Quality Assurance? 
Ans. Software QA involves the monitoring and improving the entire software development process, making sure that any agreed-upon standards and procedures are followed. It is oriented to prevention.


Q 3. What are the qualities of a good test engineer?
Ans.

A good test engineer has a test to break attitude.
An ability to take the point of view of the customer
a strong desire for quality
Tactful and diplomatic
Good communication skills
Previous software development experience can be helpful as it provides a deeper understanding of the software development process
Good judgment skills

Q4. What are the qualities of a good QA engineer?
Ans.

The same qualities a good tester
Additionally, they must be able to understand the entire software development process and how it can fit into the business approach and goals of the organization.
In organizations in the early stages of implementing QA processes, patience and diplomacy are especially needed.
An ability to find problems as well as to see 'what's missing' is important for inspections and reviews.

Q5. What are the qualities of a good QA or Test manager? 
Ans.

Must be familiar with the software development process
able to maintain enthusiasm of their team and promote a positive atmosphere
always looking for preventing problems
able to promote teamwork to increase productivity
able to promote cooperation between software, test, and QA engineers
have the skills needed to promote improvements in QA processes
have the ability to say 'no' to other managers when quality is insufficient or QA processes are not being adhered
have people judgement skills for hiring and keeping skilled personnel
be able to run meetings and keep them focused

Q6. What is the 'software life cycle'?
Ans. The life cycle begins when an application is first conceived and ends when it is no longer in use.

Q7. Tell us about some world famous bugs
Ans. 1. In December of 2007 an error occurred in a new ERP payroll system for a large urban school system. More than one third of employees had received incorrect paychecks that results in overpayments of $53 million. Inadequate testing reportedly contributed to the problems

2. A software error reportedly resulted in overbilling to 11,000 customers of a major telecommunications company in June of 2006. Making the corrections in the bills took a long time.

3. In March of 2002 it was reported that software bugs in Britain's national tax system resulted in more than 100,000 erroneous tax overcharges.

Q8. What are the common problems in the software development process?
Ans.

Poor requirements
Unrealistic schedule
Inadequate testing
A request to pile on new features after development is unnderway.
Miscommunication

Q9. What are the common solutions to software development problems?
Ans.

Solid requirements
Realistic schedules
Adequate testing
stick to initial requirements where feasible
require walkthroughs and inspections when appropriate

Q10. What is a Quality Software?
Ans. Quality software is reasonably bug-free, delivered on time and within budget, meets requirements and / or expectations, and is maintainable.

Q11. What is good code?
Ans. Good code is code that works, is reasonably bug free, and is readable and maintainable.

Q12. What is good design?
Ans. Good internal design is indicated by software code whose overall structure is clear, understandable, easily modifiable, and maintainable. It should also be robust with sufficient error-handling and status logging capability and work correctly when implemented. And, good functional design is indicated by an application whose functionality can be traced back to customer and end-user requirements.

Q13. What's the role of documentation in QA?
Ans. QA practices must be documented to enhance their repeatability. There should be a system for easily finding and obtaining information and determining what documentation will have a particular piece of information.

Q14. Which projects may not need independent test staff?
Ans. It depends on the size & nature of the project. Then, it depends on business risks, development methodology, the skills and experience of the developers.

Q15. Why does software have bugs?
Ans.

miscommunication or no communication
software complexity
programming errors
changing requirements
time pressures
poorly documented code
software development tools
egos - people prefer to say things like:
• 'no problem'
• 'piece of cake'
• 'I can whip that out in a few hours'

Q15. How QA processes can be introduced in an organization?
Ans. 1. It depends on the size of the organization and the risks involved. e.g. for large organizations with high-risk projects a formalized QA process is necessary.

2. If the risk is lower, management and organizational buy-in and QA implementation may be a slower.

3. The most value for effort will often be in

- Requirements management processes
- Design inspections and code inspections
- post-mortems / retrospectives


Q16. What are the steps to perform software testing?
Ans.

- Understand requirements and business logic
- Get budget and schedule requirements
- Determine required standards and processes
- Set priorities, and determine scope and limitations of tests
- Determine test approaches and methods
- Determine test environment, test ware, test input data requirements
- Set milestones and prepare test plan document
- Write test cases
- Have needed reviews/inspections/approvals of test cases
- Set up test environment
- Execute test cases
- Evaluate and report results
- Bug Tracking and fixing
- Retesting or regression testing if needed
- Update test plans, test cases, test results, traceability matrix etc.

Q17. What is a test plan?
Ans. A document that describes the objectives, scope, approach, and focus of a software testing effort.

Q18. What are the contents of test plan?
Ans.

- Title and identification of software including version etc.
- Revision history
- Table of Contents
- Purpose of document and intended audience
- Objective and software product overview
- Relevant related document list and standards or legal requirements
- Naming conventions
- Overview of software project organization
- Roles and responsibilities etc.
- Assumptions and dependencies
- Risk analysis
- Testing priorities
- Scope and limitations of testing effort
- Outline of testing effort and input data
- Test environment setup and configuration issues
- Configuration management processes
- Outline of bug tracking system
- Test automation if required
- Any tools to be used, including versions, patches, etc.
- Project test metrics to be calculated
- Testing deliverables
- Reporting plan
- Testing entrance and exit criteria
- Sanity testing period and criteria
- Test suspension and restart criteria
- Personnel pre-training needs
- Relevant proprietary, classified, security and licensing issues.
- Open issues if any
- Appendix

Q19. What is a test case?
Ans. A test case is a document that describes an input, action, or event and an expected response, to determine if a feature of a software application is working correctly.

Q20. What are the components of a bug report?
Ans.

- Application name
- The function, module, name
- Bug ID
- Bug reporting date
- Status
- Test case ID
- Bug description
- Steps needed to reproduce the bug
- Names and/or descriptions of file/data/messages/etc. used in test
- Snapshot that would be helpful in finding the cause of the problem
- Severity estimate
- Was the bug reproducible?
- Name of tester
- Description of problem cause (filled by developers)
- Description of fix (filled by developers)
- Code section/file/module/class/method that was fixed (filled by developers)
- Date of fix (filled by developers)
- Date of retest or regression testing
- Any remarks or comments

Q21. What is verification?
Ans. It involves reviews and meetings to evaluate documents, plans, code, requirements, and specifications. It can be done with checklists, issues lists, walkthroughs, and inspection meetings etc.

Q22. What is validation?
Ans. It involves actual testing and takes place after verifications are completed.

Q23. What is a walkthrough?
Ans. An informal meeting for evaluation or informational purposes.

Q24. What's an inspection?
Ans. It is more formalized than a 'walkthrough', typically with 3-8 people including a moderator, reader, and a recorder to take notes. The subject of the inspection is typically a document such as a requirements spec or a test plan, and the purpose is to find problems and see what's missing, not to fix anything.

Q25. What is configuration management?
Ans. It covers the processes used to control, coordinate, and track: code, requirements, documentation, problems, change requests, designs, tools / compilers / libraries / patches, changes made to them, and who makes the changes.

Q26. When you can stop testing?
Ans.

- Deadlines (release deadlines, testing deadlines, etc.)
- Test cases completed with certain percentage passed
- Test budget depleted
- Coverage of code/functionality/requirements reaches a specified point
- Bug rate falls below a certain level Beta or alpha testing period ends

Q27. What if there isn't enough time for thorough testing?
Ans. Consider the following scenarios:

- Which functionality is most important from business point of view?
- Which functionality is most visible to the user?
- Which functionality has the largest financial impact?
- Which aspects of the application are most important to the customer?
- Which parts of the code are most complex?
- Which parts of the application were developed in rush?
- Which aspects of similar/related previous projects caused problems?
- What do the developers think are the highest-risk aspects of the application?
- What kinds of problems would cause the worst publicity?
- What kinds of problems would cause the most customer service complaints?
- What kinds of tests could easily cover multiple functionalities?

Q28. What if the project isn't big enough to justify extensive testing?
Ans. Do risk analysis. See the impact of project errors, not the size of the project.

Q29. How can web based applications be tested?
Ans. Apart from functionality consider the following:

- What are the expected loads on the server and what kind of performance is expected on the client side?
- Who is the target audience?
- Will down time for server and content maintenance / upgrades be allowed?
- What kinds of security will be required and what is it expected to do?
- How reliable are the site's Internet / intranet connections required to be?
- How do the internet / intranet affect backup system or redundant connection requirements and testing?
- What variations will be allowed for targeted browsers?
- Will there be any standards or requirements for page appearance and / or graphics throughout a site or parts of a site?
- How will internal and external links be validated and updated?
- How are browser caching and variations in browser option settings?
- How are flash, applets, java scripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?
- From the usability point of view consider the following:

-- Pages should be 3-5 screens longer.
-- The page layouts and design elements should be consistent throughout the application / web site.
--Pages should be as browser-independent or generate based on the browser-type.
--There should be no dead-end pages. A link to a contact person or organization should be included on each page.

Q30. What is Extreme Programming?
Ans. Extreme Programming is a software development approach for risk-prone projects with unstable requirements. Unit testing is a core aspect of Extreme Programming. Programmers write unit and functional test code first - before writing the application code. Generally, customers are expected to be an integral part of the project team and to help create / design scenarios for acceptance testing.

Understanding Software Testing Life Cycle (STLC)



Software Testing Life Cycle explained in easy way.

This is excellent,short and easy way of understanding what exactly software testing life cycle is.
Software Testing Life Cycle (STLC) defines the steps/stages/phases in testing of software.
It contains the following phases.
Software Testing Life Cycle (STLC) defines the steps/stages/phases



Note:  Software Testing Life Cycle phases mentioned above do not necessarily have to be in the order listed; some phases can sometimes run in parallelly 

How to report a bug in small companies?

How to report a bug in small companies?

Bug is a mismatch between expected result and actual result. Hope as a tester you know regarding expected result and actual result.

As a tester whether you are working in small companies or in top MNC, when you detect the bug you have to report it.

But the pattern for reporting the bug differs from companies to companies like in top MNC’s tester’s always reporting the bug through bug reporting tools.

So various Open Source bug reporting tool available today but popular one is Bugzilla and Mantis, but Mantis is easier and user friendly than Bugzilla.

As people always knows that there are 1-2 testers in small companies so in these companies testers never report the bug through bug reporting tools. Testers just orally talk it to the development team that in this module we catch the bug so fixed it.

And similar thing happens it to the developers squad when they fixed the bug they just call the tester to his and her seat and said that check whether bug is fixed or not.

But you know this is not the appropriate or right way to communicate because we are working in a professional environment so we have to follow little documentation also.

Now the question arises in every people mind that how a tester report the bug in small companies without orally communicate with the developer.

Bug Report Sample - How to report a bug in small companies 

In small companies where testers not working on any bug reporting tool they can report the bug through Microsoft Word and Excel.


Bug Report Example

Considering example you are performing testing on login module and you find the bugs like when you login with xyz name so after login on home page it displayed the name as ABC.

Now you know it is Bug so how to report it through Microsoft word please sees it below.


Bug Report Sample


Summary: Wrong login name is displayed.

Description: Wrong login name is displayed on Home Page.

Steps to Follow or Chase:

1.      Enter the URL Http:// ----------------- in the address bar.
2.      Fill the username field in login form.
3.      Fill the password field in login form.
4.      Click on login button below the form.

Test data: Enter xyz on username field.

Environment: Window 7, Safari like that.

Actual Result: After login with xyz wrong login name is displayed on home page likes logged in as ABC.

Expected Result: Proper logged in name should be displayed on home page.

Screenshot:  Attach the screenshot here on where you detect the bug and save it in jpeg format.

Please note that summary should not be more than 10 words and description should not be more than 20 words.

CONCLUSION

In this way in small companies tester can report the bug to developers. And we always knows that small companies do not report the bug through bug reporting tools but this statement is not true in all small companies because even several small companies report the bug through bug reporting tool.

But those companies or organizations that are not following any tool they should have to report the bug through Microsoft Word and Microsoft Excel which I mentioned earlier.

Write Test Cases For Pen?

Write Test Cases of Pen?

Test cases of pen are given below: -

But keep one thing in mind that test cases for pen may vary if you have different requirements or set of requirements.

Below is given different test cases of pen which does not contain any requirements or specifications?

Test cases of pen are like that:

1. Verify the color of the pen.
2. Check GUI testing means logo of the pen maker.
3. Check Usability testing means grip of the pen.
4. Verify whether the pen is ballpoint pen or ink pen.
5. Check Integration testing means cap of the pen should easily fit beside the body of the pen.
6. Check pen should be continuously in writing mode.

Some Functional test cases for pen:

1. Check whether it writes on paper or not.

2. Verify whether the ink on the paper is belongs with the similar color as what we see in the refill.

Performance and load test cases for pen:

1. Verify how it performs when writing on wet paper.

2. Verify how it performs when writing on rough paper.

3. Verify how it performs when writing on hand because we occasionally do that

4. Check load test means when pen is pressed very hard against the tough surface then pen refill should not come out of the pen.

Negative test cases about pen:

1. Verify whether ink is available or not.

2. Check if ink is available, than the pen does not write on the paper.

3. Verify by bend the refill at multiple ends and then try to write with it.

4. Verify by dip the pen always in to the water and then write it again.

5. Check whether it write on leaves or not.

Additional test cases for pen:

1. Check usability testing means test by writing on a section of paper, Examine if you can write smoothly. It should not be writing and stopping among (with) breaks.

2. Check capability or reliability testing means Test the writing capacity (the amount of writing that is possible from a single refill) of the pen.

3. Check Robustness testing means Test wherever you can carry the pen in to your shirt and pent pocket using its cap. The cap distension should be solid enough to grip your pocket.

4. Check Compatibility testing means Test by writing on distinct types of surfaces like: rough paper, packing material, glass, leather, cotton, wood, plastic, metals like aluminum or iron, polythene sheet etc.

Conclusion
At end we conclude that apart from above mentioned test cases there are numerous test cases for pen but these above mentioned are the universal one.

Older Posts