Tuesday 22 November 2016

Selenium Live project - Automation Testing

Selenium live project with example


Many times while pursuing graduation we are suppose to make a project with team members in final semester or in any semester where we have difficulties in building such project and we take help from our seniors or any one who can help us.Let see and learn with below selenium live project and practice selenium online with ease.for any selenium training go to the homepage and get good content for starting with selenium webdriver.

So i am sharing with you all this selenium live project which analyze website and provide the output to the user in the console.
There are many selenium projects example out there which can help in start with selenium webdriver. We came across with one of the project where the expectation was to write a program which will analyze the website and provide the category that site is dealing with. lets say if we open cricbuzz then it must show that this is a sport website and category is cricket.
Likewise, if we open football website it should display in console that this is football website similarly for other sports website out there.

Selenium Live project for practice

Test case: You will provided with URL'S of 25 websites in a text file each URL in a separate line. Most of the URLs will be sports specific and some are not. Your program will access the websites and for each URL provide a result saying which URL is specific to which sport and if it is not sport specific the result will say NA.



Below is the selenium test automation script for the above test cases:



import java.io.BufferedReader;

import java.io.FileReader;

import java.io.IOException;

import org.openqa.selenium.By;

import org.openqa.selenium.NoSuchElementException;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.chrome.ChromeDriver;

public class workingwithFiles {

 public static void main(String[] args) {

 WebDriver driver;

System.setProperty("webdriver.chrome.driver","d:/chromedriver.exe");

driver=new ChromeDriver();

 String s = "D:\\test.txt"; 

  

 FileReader f = null;

 BufferedReader br = null;

  

  try {

   String sCurrentLine;

   f = new FileReader(s);

   br = new BufferedReader(f);

   while ((sCurrentLine = br.readLine()) != null)

   {

     driver.get(sCurrentLine);

     String abc=driver.getPageSource();

     String bcd=driver.getTitle();

     String a=driver.findElement(By.xpath("//meta[@name='description']")).getAttribute("content");

     System.out.println(a);

     

     if(a.contains("cricket")||a.contains("Cricket")||bcd.contains("Cricket"))

    {

     System.out.println("Cricket");

     

     }

    if(a.contains("football")||a.contains("Football"))

    {

    System.out.println("football");

   

   

    }

   if(a.contains("tennis")||a.contains("Tennis")||bcd.contains("Tennis"))

    {

    System.out.println("tennis");

   

    }

    if(a.contains("archery")||a.contains("Archery")||bcd.contains("Archery"))

    {

    System.out.println("archery");

   

  

    }

   if(a.contains("hockey")||a.contains("Hockey")||bcd.contains("Hockey"))

    {

  

    System.out.println("hockey");

   }

   if(bcd.contains("HoopsHype")||a.contains("nba")||a.contains("wnba")||a.contains("Basketball")||a.contains("basketball")||bcd.contains("Basketball"))

    {

    System.out.println("Basketball");

   

    }

    if(a.contains("Rugby")||a.contains("rugby")||bcd.contains("Rubgy"))

    {

  

    System.out.println("Rugby");

   }

    if(a.contains("badminton")||a.contains("Badminton")||bcd.contains("badminton"))

    {

  

    System.out.println("badminton");

   }

   if(a.contains("cricket")!=true&&a.contains("Basketball")!=true&&a.contains("basketball")!=true&&a.contains("hockey")!=true&&a.contains("Hockey")!=true&&a.contains("archery")!=true&&a.contains("Archery")!=true

   &&a.contains("archery")!=true&&a.contains("Archery")!=true&&a.contains("tennis")!=true&&a.contains("Tennis")!=true&&bcd.contains("HoopsHype")!=true

   &&a.contains("football")!=true&&a.contains("Football")!=true&&a.contains("Cricket")!=true)

    {

    System.out.println("NA");

   

    }

   

   }

   driver.close();

   

   } catch (IOException e) {

     e.printStackTrace();

  }

  finally {

    try {

     if (txtReader != null)txtReader.close();

    } catch (IOException ex) {

     ex.printStackTrace();

    }

    }

  }

}


We will bring more selenium live projects to the website for automation testing



selenium live project 2019, selenium project

Sunday 20 November 2016

ISTQB Dumps/Mock

ISTQB Dumps:


Q. 1: Error guessing is:

A. An appropriate way of deriving system tests.
B. Only used if good requirements are not available.
C. Only used when good requirements are available.
D. The most appropriate way of deriving system tests.

Q. 2: Amount of testing performed will not depend on

A. Risks involved
B. Contractual requirements
C. Legal requirements
D. Test data.

Q. 3: For software to be reliable it must:

A. Be easy to maintain.
B. Be unlikely to cause a failure.
C. Never fail under any circumstances.
D. Be written according to coding standards

Q. 4: Faults found by users are due to:

A. Poor quality software
B. Poor software and poor testing
C. Bad luck
D. Insufficient time for testing


Q. 5: An incident logging system

A. Only records defects
B. Is of limited value
C. Is a valuable source of project information during testing if it contains all incidents
D. Should be used only by the test team.

Q. 6: In which order should tests be run?

A. The most important tests first
B. The most difficult tests first(to allow maximum time for fixing)
C. The easiest tests first (to give initial confidence)
D. The order they are thought of




Q. 7: A program validates a numeric field as follows:
Values less than 10 are rejected, values between 10 and 21 are accepted, values greater than or equal to 22 are rejected. Which of the following covers the MOST b
oundary values?

A. 9,10,11,22
B. 9,10,21,22
C. 10,11,21,22
D. 10,11,20,21


Q. 8: Which of the following is not the integration strategy?

A. Design based
B. Big-bang
C. Bottom-up
D. Top-down


Q. 9: Which of the following tools would you use to detect a memory leak?

A. State analysis
B. Coverage analysis
C. Dynamic analysis
D. Memory analysis


Q. 10: Which of the following statements are true?

A. Faults in program specifications are the most expensive to fix.
B. Faults in code are the most expensive to fix.
C. Faults in requirements are the most expensive to fix
D. Faults in designs are the most expensive to fix.


Q. 11: Increasing the quality of the software, by better development methods, will
affect the time needed for testing (the test phases) by:

A. Reducing test time
B. No change
C. Increasing test time
D. Can’t say


Q. 12: Which of the following is a black box design technique?

A. Statement testing
B. Equivalence partitioning
C. Error-guessing
D. Usability testing


Q. 13: When reporting faults found to developers, testers should be:

A. As polite, constructive and helpful as possible
B. Firm about insisting that a bug is not a "feature" if it should be fixed
C. Diplomatic, sensitive to the way they may react to criticism
D. All of the above


Q. 14: Which of the following statements is not true

A. Performance testing can be done during unit testing as well as during the testing of whole system
B. The acceptance test does not necessarily include a regression test
C. Verification activities should not involve testers (reviews, inspections etc)
D. Test environments should be as similar to production environments as possible


Q. 15: What is the important criterion in deciding what testing technique to use?

A. How well you know a particular technique
B. The objective of the test
C. How appropriate the technique is for testing the application
D. Whether there is a tool to support the technique


These are few of the Important ISTQB Dumps and ISTQB material for ISTQB preparation. Stay tuned for more ISTQB mock.









Saturday 19 November 2016

ISTQB Dumps foundation level

ISTQB Dumps

Below are few more mock question which is important for preparation of ISTQB foundation level.


1:How many more test cases are required?

A. One more test case will be required for 100 % decision coverage.
B. Two more test cases will be required for 100 % statement coverage, one of
which will be used to provide 100% decision coverage.
C. None, existing test cases can be used.
D. One more test case will be required for 100" statement coverage.

2: A thermometer measures temperature in whole degrees only. If the temperature falls below 18 degrees, the heating is switched off. It is switched on again when the temperature reaches 21 degrees. What are the best values in degrees to cover all equivalence partitions?

A. 15, 19and 25.
B. 17, 18and 19.
C. 18, 20 and 22.
D. 16, 26 and 32.

3: Which activity in the fundamental test process creates test suites for efficient 
test execution?

A. Implementation and execution.
B. Planning and control.
C. Analysis and design.
D. Test closure.


4: Which of the following is TRUE?

A. Confirmation testing is testing fixes to a set of defects and Regression testing is testing to establish whether any defects have been introduced as a result of changes.
B. Confirmation testing is testing to establish whether any defects have been introduced as a result of changes and Regression testing is testing fixes to a set of defects.
C. Confirmation testing and Regression testing are both testing to establish whether any 
defects have been introduced as a result of changes.
D. Confirmation testing and Regression testing are both testing fixes to a set of defects

5: What is the MAIN benefit of designing tests early in the life cycle?

A. It is cheaper than designing tests during the test phases.
B. It helps prevent defects from being introduced into the code.
C. Tests designed early are more effective than tests designed later.
D. It saves time during the testing phases when testers are busy.


6: Which of the following benefits are MOST likely to be achieved by using test 
tools?

i) Easy to access information about tests and testing.
ii) Reduced maintenance of
testware.
iii) Easy and cheap to implement.
iv) Greater consistency of tests.
Options:
A. ii and iv
B. ii and iii
C. i and iv
D. i and iii


7: What is the KEY difference between preventative and reactive approaches to 
testing?

A. Preventative tests and reactive tests are designed as early as possible.
B. Preventative tests are designed early; reactive tests are designed after the software has been produced.
C. Preventative testing is always analytical; reactive testing is always heuristic.
D. Preventative tests are designed after the software has been produced; reactive tests are designed early in response to review comments.


8: What is the purpose of exit criteria?

A. To define when a test level is complete.
B. To determine when a test ha
s completed.
C. To identify when a software system should be retired.
D. To determine whether a test has passed.


9: What determines the level of risk?

A. The cost of dealing with an adverse event if it occurs.
B. The probability that an adverse event will occur.
C. The amount of testing planned before release of a system.
D. The likelihood of an adverse event and the impact of the event.

10: With which of the following categories is a test comparator tool USUALLY 
associated?

A. Tool support for performance and monitoring.
B. Tool support for static testing.
C. Tool support for test execution and logging.
D. Tool support for the management of testing and tests.

11: Which activities form part of test planning?

i) Developing test cases.
ii) Defining the overall approach to testing.
iii) Assigning resources.
iv) Building the test environment
v) Writing test conditions.
A. i, ii & iv are true, iii & v are false.
B. ii & iii are true, i, iv & v are false.
C. iv & v are true, i, ii & iii are false.
D. i, ii & iii are true iv & v are false.

12: Match the following terms and statements.

1.Decision Table Testing
2.Decision Testing
3.State Transition Testing
4.Exploratory Testing

W. Testing carried out w boxes to achieve specific test objectives, possibly to complement structured testing.
X. A test technique used which may be used to verify different system re depending on current conditions or previous history.
Y. A test technique which combines combinations of inputs that might not otherwise have been exercised during testing.
Z. A form of control flow testing based on decision outcomes.

Options:
A. 1Y, 2Z, 3X, 4W.
B. 1X ,2W, 3Z, 4Y.
C. 1Z, 2X, 3W, 4Y.
D. 1Z, 2Y, 3X, 4W.

13: Which type of test design techniques does the following statement best describe a procedure to derive test cases based on the specification of a component?

A. Black Box Techniques.
B. White Box Techniques.
C. Glass Box Techniques.
D. Experience Based Techniques

14: Which is not a testing principle

A. Early testing
B. Defect clustering
C. Pesticide paradox
D. Exhaustive testing

15: The ___________ Testing will be performed by the people at client own 
Locations

A. Alpha testing
B. Field testing
C. Performance testing
D. System testing


Stay tuned for more ISTQB dumps and mock questions,


ISTQB dumps, ISTQB mock, ISTQB foundation level, ISTQB Preparations