Vous êtes sur la page 1sur 9

**Selenium: click(locator) Arguments: locator : an element locator Clicks on a link, button, checkbox or radio button.

If the click action causes a new page to load (like a link usually does), call waitForPageToLoad. And : clickAt(locator, coordString) Arguments: locator : an element locator coordString : specifies the x,y position (i.e. - 10,20) of the mouse event relat ive to the element returned by the locator. Clicks on a link, button, checkbox or radio button. If the click action causes a new page to load (like a link usually does), call waitForPageToLoad. click is used when you just want to "click" on an element, like a button, a link , ... And clickAt is used when you want to "click" on a position designated by mouse c oordinates. XPath::::::::::::::::: selenium.click("xpath=(//input[@type='checkbox'])[last()]");

**Testing Concepts::::::::: Smoke testing is conducted to ensure whether the most crucial functions of a pro gram are working, but not bothering with finer details. (Such as build verificat ion). Sanity testing is to verify whether requirements are met or not, checking all fe atures breadth-first. System testing: System testing is performed on the entire system in the context of a Functional Requirement Specification(s) (FRS) and/or a System Requirement Specification (SR S). System testing tests not only the design, but also the behaviour and even th e believed expectations of the customer. It is also intended to test up to and b eyond the bounds defined in the software/hardware requirements specification(s). Examples: Graphical user interface testing, sability testing, Software performan ce testing, Compatibility testing, Exception handling, Load testing, Volume test ing, Stress testing, Security testing, Scalability testing, Sanity testing, Smok e testing, Exploratory testing, Ad hoc testing, Regression testing, Installation testing Maintenance testing, Recovery testing and failover testing, Accessibility testin

g, including compliance Re-testing: - Verifying defects fix/fixes - test cases that were failed Regression: - checking that fixes have not impact on some other components - Test cases that were passed earlier - it comes after re-testing Validation: Are we building the right product (testing) Verification: Are we building the product right (test cases) Test Strategy: A Test Strategy document is a high level document and normally developed by proj ect manager. This document defines Software Testing Approach to achieve testing ob jectives. The Test Strategy is normally derived from the Business Requirement Sp ecification document. Components of the Test Strategy document::: Scope and Objectives Business issues Roles and responsibilities Communication and status reporting Test deliverability Industry standards to follow Test automation and tools Testing measurements and metrices Risks and mitigation Defect reporting and tracking Change and configuration management Training plan Test Plan: The Test Plan document on the other hand, is derived from the Product Descriptio n, Software Requirement Specification SRS, or Use Case Documents. The Test Plan document is usually prepared by the Test Lead or Test Manager and the focus of the document is to describe what to test, how to test, when to test and who will do what test. Test Plan id Introduction Test items Features to be tested Features not to be tested Test techniques Testing tasks Suspension criteria Features pass or fail criteria Test environment (Entry criteria, Exit criteria) Test delivarables Staff and training needs Responsibilities Schedule Traceability Matrix : A requirements traceability matrix is a document that trac es and maps user requirements [requirement Ids from requirement specification do cument] with the test case ids. Purpose is to make sure that all the requirement

s are covered in test cases . types are Forward, Backward uirement) Requirement ID Requirement SR-1.1 User should be able

so that while testing no functionality can be missed & Bi Directional (mapping between test cases and req description TC 001 TC 002 TC 003 to do this x

Benefits of using Traceability Matrix :::: Make obvious to the client that the software is being developed as per the requi rements. To make sure that all requirements included in the test cases To make sure that developers are not creating features that no one has requested Easy to identify the missing functionalities. If there is a change request for a requirement, then we can easily find out whic h test cases need to update. The completed system may have Extra functionality that may have not been specified in the design specification, resulting in wastage of manpower, time and effort.

**SQL::::::::::::::::::::: CREATE DATABASE dbname; CREATE TABLE Persons ( PersonID int NOT NULL PRIMARY KEY, LastName varchar(255), FirstName varchar(255), Address varchar(255), City varchar(255) ); Select * from TBNAme Select <Colname> from TBNAME where EmpID = "1" (column_name operator value;) SELECT DISTINCT <Colname> FROM Customers; - returns only distinct (different) va lues. SELECT * FROM Customers WHERE Country='Germany' AND City='Berlin'; SELECT * FROM Customers WHERE Country='Germany' OR City='Berlin'; SELECT * FROM Customers WHERE Country='Germany' AND (City='Berlin' OR City='Mnche n'); SELECT * FROM Customers ORDER BY Country; SELECT * FROM Customers ORDER BY Country DESC; INSERT INTO Customers VALUES ('Cardinal','Tom B. Erichsen','Skagen 21','Stavange r','4006','Norway'); (inserts a new row in the "Customers" table.) INSERT INTO Customers (CustomerName, City, Country) VALUES ('Cardinal', 'Stavang er', 'Norway'); (Inserts Data Only in Specified Columns) UPDATE Customers SET ContactName='Alfred Schmidt', City='Hamburg' WHERE Customer Name='Alfreds Futterkiste'; (update the customer "Alfreds Futterkiste" with a ne w contact person and city.) DELETE * FROM table_name; (Delete all data) DELETE FROM Customers WHERE CustomerName='Alfreds Futterkiste' AND ContactName=' Maria Anders'; SELECT TOP 2 * FROM Customers; (selects the two first records from the "Customer s" table) SELECT TOP 50 PERCENT * FROM Customers; (selects the first 50% of the records fr om the "Customers" table) SELECT * FROM Customers WHERE Country LIKE '%land%'; (selects all customers with a Country containing the pattern "land") SELECT * FROM Customers WHERE City IN ('Paris','London'); (selects all customers

with a City of "Paris" or "London") SELECT * FROM Products WHERE Price NOT BETWEEN 10 AND 20; (selects all products with a price BETWEEN 10 and 20) SELECT column_name AS alias_name FROM table_name; (aliases are used to give a da tabase table, or a column in a table, a temporary name.) SELECT City FROM Customers UNION SELECT City FROM Suppliers ORDER BY City; (sele cts all the different cities (only distinct values) from the "Customers" and the "Suppliers" tables) SELECT * INTO CustomersBackup2013 FROM Customers; (Create a backup copy of Custo mers) INNER JOIN: Returns all rows when there is at least one match in BOTH tables SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate FROM Orders INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID; (returns OrderID CustomerName OrderDate columns from the 02 tables i.e. Orders and Customers) LEFT JOIN: Return all rows from the left table, and the matched rows from the ri ght table SELECT column_name(s) FROM table1 LEFT JOIN table2 ON table1.column_name=table2.column_name; SELECT Customers.CustomerName, Orders.OrderID FROM Customers LEFT JOIN Orders ON Customers.CustomerID=Orders.CustomerID ORDER BY Customers.CustomerName; (The LEFT JOIN keyword returns all the rows fro m the left table (Customers), even if there are no matches in the right table (O rders).) RIGHT JOIN: Return all rows from the right table, and the matched rows from the left table SELECT column_name(s) FROM table1 RIGHT JOIN table2 ON table1.column_name=table2.column_name; SELECT Customers.CustomerName, Orders.OrderID FROM Customers RIGHT JOIN Orders ON Customers.CustomerID=Orders.CustomerID ORDER BY Customers.CustomerName; FULL JOIN: Return all rows when there is a match in ONE of the tables SELECT column_name(s) FROM table1 FULL OUTER JOIN table2 ON table1.column_name=table2.column_name; SELECT Customers.CustomerName, Orders.OrderID FROM Customers FULL OUTER JOIN Orders ON Customers.CustomerID=Orders.CustomerID ORDER BY Customers.CustomerName; mysqldump database_name --user=root --password=root --host=egov031 --verbose -routines>e:\test.sql **Java:

OOPS Polymorphism difference between function overloading and overriding? **Different logics: Reading a line from a text file::::::::::: // Open the file FileInputStream fstream = new FileInputStream("textfile.txt"); BufferedReader br = new BufferedReader(new InputStreamReader(fstream)); String strLine; //Read File Line By Line while ((strLine = br.readLine()) != null) // Print the content on the console if (line.equals("Exception")) system.out.println ("Got it"); } br.close(); {

Change the PASSWORD:::::::: public void changePassword(String userId, String oldPassword, String password, C onnection conn) { StringBuilder str = new StringBuilder(); sbr.append("Update table set password = :pass where userId = :user and password = :oldPass"); PreparedStatement psmt = conn.prepareStatement("Update table set password = :pas s where userId = :user and password = :oldPass"); psmt.setString("pass",password); psmt.setString("user",userId); psmt.setString("oldPass",oldPassword); int out = psmt.executeUpdate(); if (out == 1) //successful else //unsuccessful } Write a function that counts the number of primes in the range [1-N]. Write test cases for this function.::::::::::::: static int getNumberOfPrime(int N) { int count = 0; for (int i=2; i<=N; i++) { int max = (int)Math.sqrt(i); boolean prime = true; for (int j=2; j<=max; j++) { if (i%j == 0 && i != j) { prime = false; break; } } if (prime) { count++; System.out.print(i + ",");

} } return count; } Without using loops, write a function to print 1 to 500 in serial order.:::::::: :::::::::::::::: public class Print1To500WithoutLoop { public static boolean printNums(int n) { System.out.println(n); n++; boolean a=n!=501 && printNums(n); return true; } public static void main(String[] args) { printNums(1); } } Java program to reverse a string:::::::::::::::::::::::::::::: import java.util.*; class ReverseString { public static void main(String args[]) { String original, reverse = ""; Scanner in = new Scanner(System.in); System.out.println("Enter a string to reverse"); original = in.nextLine(); int length = original.length(); for ( int i = length - 1 ; i >= 0 ; i-- ) reverse = reverse + original.charAt(i); System.out.println("Reverse of entered string is: "+reverse); } } Write a java program to count number of words in a file.:::::::::::::::::::::::: :::::::::: public static void countWords(String fileName) throws IOException{ BufferedReader br=new BufferedReader(new FileReader(fileName)); String line=null; int count=0; while((line=br.readLine())!=null){ count+=line.split(" ").length; } System.out.println(count); }

Swaping 02 variables::::::::::::::::::::::::::::::::::: a=10; b=5; a=a+b; b=a-b; a=a-b;

**Jmeter: through put means number of hits per second sample rate defines the number of samples per unit of time (usually seconds) Load testing measuring system performance based on a volume of users. Stress testing measuring the breakpoint of a system. **Tomcat server: I have copied the sample.war file in webapps directory of tomcat. I can acess localhost:8080. open link http://localhost:8080/ in your web browser. Click Tomcat Manager then enter user name and password. usename- root , password-root (I think by default) . In next page you can see one option called "WAR file to deploy". Select your w ar file from there and click "deploy" button. To Start server: <Tomcat Root>/bin>startup.sh To Stop server: <Tomcat Root>/bin>shutdown.sh Unix Commands: (Command prompt in Windows and terminal in unix) ls-- list file ls -l long list file rm - Remove file cp f1 f2 - Copies file mv f1 f2 - Move file diff f1 f2 - Compare files and shows where they differ gzip f1 - compress file gunzip f1 - Uncompress mkdir dirname - Make a new dir cd dirname - Change Dir pwd - tells you where you currently are who - who are looged on the machine whoami - returns your username chmod - for changing permissions of file ps -u yourusername - lists process, also gives PID kill PID - Kills process (kill -9 <PID> Vi filename for opening file in editor top - Print system usage and top resource hogs (shift+P) - sort with High CPU Utilization Cygwin is used to run commands o windows

******************************************************************************** *********************************************** 10) Explain WCF and webservice? In what scenarios must WCF be used A secure service to process business transactions. A service that supplies current data to others, such as a traffic report or othe r monitoring service. A chat service that allows two people to communicate or exchange data in real ti me. A dashboard application that polls one or more services for data and presents it in a logical presentation. Exposing a workflow implemented using Windows Workflow Foundation as a WCF servi ce. A Silverlight application to poll a service for the latest data feeds. Features of WCF Service Orientation Interoperability Multiple Message Patterns Service Metadata Data Contracts Security Multiple Transports and Encodings Reliable and Queued Messages Durable Messages Transactions AJAX and REST Support Extensibility 12) What is SOAP Protocol? SOAP, originally defined as Simple Object Access Protocol, is a protocol specifi cation for exchanging structured information in the implementation of Web Servic es in computer networks. It relies on XML Information Set for its message format , and usually relies on other Application Layer protocols, most notably Hypertex t Transfer Protocol (HTTP) or Simple Mail Transfer Protocol (SMTP), for message negotiation and transmission. 13) Difference between HTTP and TCP? TCP provides the delivery of a stream of bytes from a program from one computer to another computer. TCP is also in charge of controlling size, flow control, th e rate of data exchange, and network traffic congestion. HTTP: Application layer protocol, It is a request/response standard that is comm only found in client server computing in which the web browsers or spiders serve as the clients and an application running on the computer and hosting the web si te serves as the actual server. 14) 15) 16) 17) 18) How you will create automation framework? Reverse a string and write test case? Get all Duplicates from Array, Optimize and Type of Data Structure. Sealed AccessSpecifier Complete Scrum Process

20) WCF Question, Test a WCF Services etc SoAP UI, Fiddler, WCFTestClient

REST API REST stands for Representational State Transfer, and it was proposed in a doctor ate dissertation. It uses the four HTTP methods GET, POST, PUT and DELETE to exe cute different operations. This in contrast to SOAP for example, which creates n ew arbitrary commands (verbs) like getAccounts() or applyDiscount() A REST API is a set of operations that can be invoked by means of any the four v erbs, using the actual URI as parameters for your operations. For example you ma y have a method to query all your accounts which can be called from /accounts/al l/ this invokes a HTTP GET and the 'all' parameter tells your application that i t shall return all accounts. UI Performance tool

******************************************************************************** ********************************************** How internet works HTTPS work?? Automating Webservices? Usability testing

1 Useful links::: http://www.careercup.com/page?pid=emc-interview-questions http://www.programmingsimplified.com/java/source-code/java-program-reverse-strin g http://automationtricks.blogspot.in/2010/09/how-to-use-functions-in-xpath-in.htm l http://www.seleniumwebdriver.com/selenium-webdriver-resources/how-to-identify-dy namic-objects/ Interview Guide History

Vous aimerez peut-être aussi