My FAQ's
---------
* 1.
Overloading occurs when two or more methods in one class have the same method name but different parameters.
Overriding means having two methods with the same method name and parameters (i.e., method signature).
One of the methods is in the parent class and the other is in the child class.
Java Method Overloading example : (Interface ; create through the packages)
----------------------------------
class OverloadingExample{
static int add(int a,int b){return a+b;}
static int add(int a,int b,int c){return a+b+c;}
}
Java Method Overriding example :
-------------------------------
class Animal{
void eat(){System.out.println("eating...");}
}
class Dog extends Animal{
void eat(){System.out.println("eating bread...");}
}
* http://www.softwaretestinghelp.com/selenium-tutorial-1/
https://www.udemy.com/selenium-webdriver-with-java-testng-and-log4j/learn/v4/overview
aeiouMyUdemy2016123
ApowerSoft screen recorder:
http://filehippo.com/download_apowersoft_free_screen_recorder/
* Thread.sleep(2000);
What is Fluent wait and how it is different from implicit wait and explicit wait?
Implicit wait:
Implicit wait tells web driver to wait on every instance when try to find element. It is like global wait for all driver.
findelement instance. It will <<force web driver to wait until >> element is appeared on page or defined time whatever is earliest. Drawback is
it throws exception when element is not loaded on page even in defined time span.
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = driver.findElement(By.id("myDynamicElement"));
Explicit wait: Explicit wait is of two types:
WebDriver driver = new FirefoxDriver();
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(By.id("myDynamicElement")));
1) WebDriverWait
2) FluentWait
both are classes and implements Wait interface.
WebDriverWait is applied on certain element with defined expected condition and time. This wait is only applied to the specified element.
This wait can also throw exception when element is not found.
WebDriverWait wait = new WebDriverWait (driver, 20);
wait.until(ExpectedConditions.VisibilityofElementLocated(By.xpath(""//button[@value='Save Changes']"")));
Fluent wait:
Fluent wait is another type of Explicit wait and you can define polling ( Interval it try) and ignore the exception to continue with script execution in case
element is not found.
new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).pollingevery(10, TimeUnit.SECONDS).ignoring(NoSuchElementException.class);
Each FluentWait instance defines the maximum amount of time to wait for a condition, as well as the frequency with which to check the condition.
Wait wait = new FluentWait(driver)
.withTimeout(30, SECONDS)
.pollingEvery(5, SECONDS)
.ignoring(NoSuchElementException.class);
What is Absolute and relative path?
\ - Absolute Xpath: It uses Complete path from the Root Element to the desire element.
\\ - Relative Xpath: You can simply start by referencing the element you want and go from there.
Always Relative Xpaths are preferred as they are not the complete paths from the Root element. (//html//body) ..
Beacuse in future any of the webelement when added/Removed then Absolute Xpath changes. So Always use Relative Xpaths in your Automation.
// Absolute Path starts from root path, Relative Path starts from current path
//Selenium WebDriver - Absolute and Relative Path Examples
//Example Absolute and Relative Paths for Selenium WebDriver
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class AbsoluteRelativePaths {
@Test
public void absolutePath() throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "E:\\Selenium\\chromedriver_win32\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("E:\\Selenium\\absolute.html");
// Absolute Path starts from root path
WebElement link1 = driver.findElement(By.xpath("/html/body/li[@id='test']/a"));
// Relative Path starts from current path
WebElement link2 = driver.findElement(By.xpath(".//*[@id='test']/a"));
driver.quit();
}
}
* How to scroll the scroll ball in window with selenium - Java script
EventFiringWebDriver eventFiringWebDriver = newEventFiringWebDriver(webDriver);
eventFiringWebDriver.executeScript("scroll(0,4000)",args);
* How will you handle dynamic object - runtime objects in Selenium,
we can do through ID's, index and other CSS locators
* How will you handle dynamic object - runtime objects in Selenium,
we can do through ID's, index and other CSS locators
ANSWER:Xpath
http://www.testerlogic.com/handling-dynamic-elements-in-selenium-webdriver/
Code :
// Dynamic Element Locators
<button id="Submit-901" />
<button id="Submit-902" />
<button id="Submit-903" />
1. Absolute XPath
web_element_name=html/body/div[30]/div[2]/div[2]/div/div/div/div[1]/table/tbody/tr/td[2]/table/tbody/tr/td[1]/table/tbody/tr/td[1]/table/tbody/tr[2]/td[2]/em/button
//p[6]/label[2]/div/ins
2. Identify Element by starting Text
XPath: //button[starts-with(@id, 'Submit-')]
3. Identify Element by containing Text
<input class="new-userfield-001">
<input class="old-userfield-002">
XPath: //input[contains(@class, '-userfield-')].
4. Identify Element by Index
driver.findElements(By.xpath(“//*submit”)).get(0).click();
5. Identify Element with reference of a closest stable element
XPATH: //span1/../following-sibling::div//button1
6. Identify Element by stable preceding Text
//label2/following::input
* Exception handling can be done through try catch
* Window popups are handled through Robot scripting ins elenium
http://www.softwaretestinghelp.com/handle-alerts-popups-selenium-webdriver-selenium-tutorial-16/
There are two types of alerts that we would be focusing on majorly:
1.Windows based alert pop ups
2.Web based alert pop ups
* http://www.softwaretestinghelp.com/selenium-select-class-selenium-tutorial-13/
*$$$$$$*
* Java :-
Download and install - Java SE Development Kid ( JDK 8.0)
http://www.javatpoint.com/corejava-interview-questions
At command prompt
Check for JDK
javac -version
C:\Users\acerpraveen>javac -version
javac 1.8.0_112
If error: Set the JDK path : -
C:\Program Files\Java\jdk1.8.0_112\bin
Type Env and go the environment variables and do the settings;
Control Panel\System and Security\System - ( Edit environment variable - path)
For JRE :-
C:\Users\acerpraveen>java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
<<<<Eclipse IDE for Java Developer>>>>
https://www.udemy.com/selenium-webdriver-with-java-testng-and-log4j/learn/v4/t/lecture/1344972
3.
* Jenkins with maven continuous integration
* Use Git and GitHub to manage and share source code
Git hub we can do anything, we can manage or share source code with any one its
all matter of authorization permissions to any user
yes, SOAP UI with XML or WSDL file, it can be jason.xml file
* Angular JS, we use protractor framework in selenium this is part of security
Angular Js is used for open UI hat is free open software where developers use to build the web ui,a nd the protractor framework is used
to test that Angular Js layer
* Angular JS, we use protractor framework in selenium
* Simple Object Access Protocol (SOAP)
* Release Testing
After build release some of the companies do engineering prequal before giving the build to qa
there are different terms like, BVT, BFT, smoke test, We call it as RFB.
4.
* Perfecto mobile FAQ
Other Mobile tools - Seetest, Perfecto Mobile, BlazeMeter, AppThwack, Manymo, DeviceAnywhere
* Faq: http://interviewquestionsanswerspdf.com/2014/04/mobile-testing-interview-questions-and-answers/
* Knowledge of iOS and Android operating systems ( App Store iOS / Android Google Pay)
Android application package (.APK) file to be downloaded and installed in Android
.IPA files are Executable Files for iphone to install
* Use of private app store or OTA distribution
Use of private app store or OTA distribution -- this is more with IOS, Over the air enterprice distribution of the app.
5. * QTP\ HP UFT FAQ
http://www.guru99.com/qtp-interview-questions.html#50
* What is parameterization
http://www.softwaretestinghelp.com/qtp-tutorial-19-qtp-parameterization-part1/
Types of parameterization in QTP
The variable value can be or the parameter types can be:
1.Data Table parameters
2.Test/Action parameters
3.Environment variable parameters
4.Random number parameters
* What is ordinal identifier? (3) Index, location, creation time
* How the objects are identified in qtp ID, class name,
* What is assive property? and Mandatory property?
* How do you read objects (FSO) - File system objects.
* What is import \ export ( Excel sheet)
* What is global sheet and local sheet
* Identification of an Object in QTP/UFT :
1) Normal Identification
2) Smart Identification
3) Ordinal identification ( 3 Type Index based , Location based and Creation Time - value CreationTime=0 )
4) Visual Based Identification
5) Object identification based on CSS XPath
6) Image Based identification
7) VRI- Visual relation Identifier
* What is XPath?
XPath is a language used to get the information from an xml document.
XPath uses path expressions to navigate and identify the element in the xml document
The advantage of using XPath is to identify any object in the application easily without wasting much time looking for combination of properties to make it unique. If you are working on a commercial application, you would see code like this.
<form>
<label for="male">Male</label>
<input type="radio" name="sex" id="male"/><br/>
<label for="female">Female</label>
5.<input type="radio" name="sex" id="female"/>
</form>
*i.To identify the first input box copy and paste the following syntax into the Value edit box:
/html/body/form/input[1]
*ii. To identify the second input box copy and paste the following syntax into the Value edit box:
/html/body/form/input[2]
*$$$$$$*
* Experience with Quality Tools (Quality Center, Perfecto Mobile, Jira, Rally… Etc. )
1. Experience with .NET, XML and JSON web services
Experience with .NET, XML and JSON web services - this is more of restful web services testing, did you test Soap UI
* 5. Knowledge of Test-Driven Development principles and tools for mobile
BDD - Behavioural driven development - here we use cucumber - when, then and what
TDD - here the business are hidden not exposed to BA & product owner; mostly Dev & QA works hand-on-hand
and do testing and developement.
* 7. Vulnerable testing? ( Security Testing - will be done on all layers. )
Fishing - Creating junks email and hacking the Credcredential; blocking; decoding; Injections
* 7a.Python Tutorial for Beginners 1 - Getting Started and Installing Python (For Absolute Beginners) (1- 15)
https://www.youtube.com/watch?v=41qgdwd3zAg&list=PLS1QulWo1RIaJECMeUT4LFwJ-ghgoSH6n
Python 3.4.1
* 9. Soup UI
* 10. Postmaster
* 11. Hive
* 12 Impala
* Test Complete
* Vb Scripting
http://www.globalguideline.com/interview_questions/Questions.php?sc=VBScript_Interview_Questions_And_Answers
* 7a. Spring Tool Suite (STS):
The Spring Tool Suite is an Eclipse-based development environment that is customized for developing Spring applications.
It provides a ready-to-use environment to implement, debug, run, and deploy your Spring applications, including integrations
for Pivotal tc Server, Pivotal Cloud Foundry, Git, Maven, AspectJ, and comes on top of the latest Eclipse releases.
*$$$$$$*
* 2. Differencee between c, c++ and C#.
•Hardware device drivers
•Applications where access to old, stable code is required.
C,C++
•Application or Server development where memory management needs to be fine tuned (and can't be left to generic garbage collection solutions).
•Development environments that require access to libraries that do not interface well with more modern managed languages.
•Although managed C++ can be used to access the .NET framework, it is not a seamless transition.
C# provides a managed memory model that adds a higher level of abstraction again. This level of abstraction adds convenience and improves
development times, but complicates access to lower level APIs and makes specialized performance requirements problematic.
It is certainly possible to implement extremely high performance software in a managed memory environment, but awareness of the implications
is essential.
The syntax of C# is certainly less demanding (and error prone) than C/C++ and has, for the initiated programmer, a shallower learning curve.
C#
•Rapid client application development.
•High performance Server development (StackOverflow for example) that benefits from the .NET framework.
•Applications that require the benefits of the .NET framework in the language it was designed for.
* 3. Where is the Delphi Technique Used?
The Delphi Method is useful in 2 scenarios.
1. When there are many experts involved, and consensus is not likely to happen quickly.
2. When the experts are geographically spread out, and it is difficult to get them into a room to discuss,
brainstorm and come up with the best strategy.
Where is the Delphi Technique used for the PMP exam preparation?
The Delphi technique is actually one of the Group Decision-Making Techniques. It is used in
Time Management > Estimate Activity Duration
Cost Management > Estimate Costs
Risk Management > Identify Risks
* Oracle/Mongo DB
http://www.softwaretestinghelp.com/selenium-tutorial-1/
*$$$$$$*
* What is the Document Object Model?
The Document Object Model (DOM) is an application programming interface (API) for valid HTML and well-formed XML documents.
It defines the logical structure of documents and the way a document is accessed and manipulated. In the DOM specification, the term
"document" is used in the broad sense - increasingly, XML is being used as a way of representing many different kinds of information that
may be stored in diverse systems, and much of this would traditionally be seen as data rather than as documents. Nevertheless,
XML presents this data as documents, and the DOM may be used to manage this data.
With the Document Object Model, programmers can build documents, navigate their structure, and add, modify, or delete elements and content.
Anything found in an HTML or XML document can be accessed, changed, deleted, or added using the Document Object Model, with a few exceptions
- in particular, the DOM interfaces for the XML internal and external subsets have not yet been specified.
*$$$$$$*
* Process 1. Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle:
requirements are turned into very specific test cases, then the software is improved to pass the new tests, only.
This is opposed to software development that allows software to be added that is not proven to meet requirements.
Test-driven development (TDD) (Beck 2003; Astels 2003), is an evolutionary approach to development which combines test-first development
where you write a test before you write just enough production code to fulfill that test and refactoring.
What is the primary goal of TDD? One view is the goal of TDD is specification and not validation (Martin, Newkirk, and Kess 2003).
In other words, it’s one way to think through your requirements or design before your write your functional code (implying that
TDD is both an importantagile requirements and agile design technique). Another view is that TDD is a programming technique.
As Ron Jeffries likes to say, the goal of TDD is to write clean code that works. I think that there is merit in both arguments,
although I lean towards the specification view, but I leave it for you to decide.
http://agiledata.org/essays/tdd.html
Nice articel about TDD
Acceptance test–driven development (ATDD) is a development methodology based on communication between the business customers, the developers,
and the testers.[1] ATDD encompasses many of the same practices as specification by example,[2][3] behavior-driven development (BDD),
[4] example-driven development (EDD),[5] and story test–driven development (SDD).[6]
All these processes aid developers and testers in understanding the customer's needs prior to implementation and allow customers
to be able to converse in their own domain language.
Acceptance critirial - as per the check list all test cases are passed.
Excel - keyword. ( Similar to Tracibility martics).
* Based on your experience how will you implement Acceptance test–driven development (ATDD) in AGILE?
*$$$$$$*
* What is QA & QC?
http://www.diffen.com/difference/Quality_Assurance_vs_Quality_Control
Answer:
Quality Assurance is <<<<process oriented and focuses on defect <<<<prevention, while
Quality control is <<<<product oriented and focuses on defect <<<<<identification.
Quality Assurance Vs Quality Control
Definition
QA is a set of activities for ensuring quality in the processes by which products are developed.
QC is a set of activities for ensuring quality in products. The activities focus on identifying defects in the actual products produced.
Focus on
QA aims to prevent defects with a focus on the process used to make the product. It is a proactive quality process.
QC aims to identify (and correct) defects in the finished product. Quality control, therefore, is a reactive process.
Goal
The goal of QA is to improve development and test processes so that defects do not arise when the product is being developed.
The goal of QC is to identify defects after a product is developed and before it's released.
How
QA Establish a good quality management system and the assessment of its adequacy. Periodic conformance audits of the operations of the system.
QC Finding & eliminating sources of quality problems through tools & equipment so that customer's requirements are continually met.
What
QA Prevention of quality problems through planned and systematic activities including documentation.
Qc The activities or techniques used to achieve and maintain the product quality, process and service.
Responsibility
Everyone on the team involved in developing the product is responsible for quality assurance.
Quality control is usually the responsibility of a specific team that tests the product for defects.
Example
Verification is an example of QA
Validation/Software Testing is an example of QC
Statistical Techniques
Statistical Tools & Techniques can be applied in both QA & QC. When they are applied to processes (process inputs & operational parameters),
they are called Statistical Process Control (SPC); & it becomes the part of QA.
QC When statistical tools & techniques are applied to finished products (process outputs), they are called as Statistical Quality Control (SQC)
& comes under QC.
As a tool
QA is a managerial tool
QC is a corrective tool
Orientation
QA is process oriented
QC is product oriented
* What is verification and validation?
--------------------------------------
ANSWER:
http://softwaretestingfundamentals.com/verification-vs-validation/
VERIFICATION vs VALIDATION
Criteria Verification Validation
Definition :
Ver : The process of evaluating work-products (not the actual final product) of a development phase to determine whether they
meet the specified requirements for that phase.
Val : The process of evaluating software during or at the end of the development
process to determine whether it satisfies specified business requirements.
Objective :
Ver : To ensure that the product is being built according to the requirements and design specifications.
In other words, to ensure that work products meet their specified requirements.
Val : To ensure that the product actually meets the user’s needs, and that the specifications were correct in the first place.
In other words, to demonstrate that the product fulfills its intended use when placed in its intended environment.
Question :
Ver : Are we building the product right?
Val : Are we building the right product?
Evaluation Items :
Ver : Plans, Requirement Specs, Design Specs, Code, Test Cases
Val : The actual product/software.
Activities:
Ver : • Reviews
• Walkthroughs
• Inspections
Val :
• Testing
* What is SDLC ?
----------------
ANSWER:
https://www.tutorialspoint.com/sdlc/sdlc_overview.htm
SDLC, Software Development Life Cycle is a process used by software industry to design, develop and test high quality softwares.
The SDLC aims to produce a high quality software that meets or exceeds customer expectations, reaches completion within times
and cost estimates.
SDLC is a process followed for a software project, within a software organization. It consists of a detailed plan describing how to develop,
maintain, replace and alter or enhance specific software. The life cycle defines a methodology for improving the quality of software
and the overall development process.
The following figure is a graphical representation of the various stages of a typical SDLC.
Stage 1: Planning & Requirement Analysis
Stage 2: Defining Requirement
Stage 3: Designing the product architecture
Stage 4: Building or Developing the Product
Stage 5: Testing the Product
Stage 6: Deployment in the Market and Maintenance
SDLC models followed in the industry:
------------------------------------
Waterfall Model
Iterative Model
Spiral Model
V-Model
Big Bang Model
The other related methodologies are Agile Model, RAD Model, Rapid Application Development and Prototyping Models.
* What is TDLC ?
----------------
ANSWER:
* What is defect life cycle?
----------------------------
ANSWER:
What is the compentency (Efficiency)of the tester?
----------------------------
ANSWER:
Find the defect at the earliy stage of developement.
ER==AR to stop testing.
Where do the tester play the role in developement stage and Testing stage?
----------------------------
ANSWER:
What is test strategy?
----------------------------
ANSWER:
What is test Plan?
----------------------------
ANSWER:
What is Estimation?
----------------------------
ANSWER:
When to start testing?
----------------------------
ANSWER:
CUSTOMER SERVICE Service Requests Generate Debit Card PIN
* How to selecet the application for testing?
----------------------------------------------
ANSWER:
https://www.tutorialspoint.com/qtp/qtp_test_automation_process.htm
Answer:
Automated Testing Process:
For any automated tool implementation, the following are the phases/stages of it. Each one of the stages corresponds to a particular activity
and each phase has a definite outcome.
1. Test Automation Feasibility Analysis - First step is to check if the application can be automated or not. Not all applications can be
automated due to its limitations.
2. Appropriate Tool Selection - The Next most important step is the selection of tools. It depends on the technology in which the application
is built, its features and usage.
3. Evaluate the suitable framework - Upon selecting the tool the next activity is to select a suitable framework. There are various kinds
of frameworks and each framework has its own significance. We will deal with frameworks in detail later this chapter.
4. Build the Proof of Concept - Proof of Concept(POC) is developed with an end to end scenario to evaluate if the tool can support the automation
of the application. As it is performed with an end to end scenario which will ensure that the major functionalities can be automated.
5. Develop Automation Framework - After building the POC, framework development is carried out, which is a crucial step for the success of any
test automation project. Framework should be build after diligent analysis of the technology used by the application and also its key features.
6. Develop Test Script, Execute and Analyze - Once Script development is completed, the scripts are executed, results are analyzed and defects are logged, if any. The Test Scripts are usually version controlled.
* What is Application Server Vs Web Server?
* ANSWER:
---------
* What is web server?
o http://whatis.techtarget.com/definition/Web-server
A Web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users, in response to their
requests, which are forwarded by their computers' HTTP clients. Dedicated computers and appliances may be referred to as Web servers as well.
The process is an example of the client/server model. All computers that host Web sites must have Web server programs. Leading Web servers include
Apache (the most widely-installed Web server), Microsoft's Internet Information Server (IIS) and nginx (pronounced engine X) from NGNIX.
*What is Application Server?
An application server is a server program in a computer in a distributed network that provides the business logic for an application program.
The application server is frequently viewed as part of a three-tier application, consisting of a graphical user interface (GUI) server,
an application (business logic) server, and a database and transaction server. More descriptively, it can be viewed as dividing
an application into:
A first-tier, front-end, Web browser-based graphical user interface, usually at a personal computer or workstation
A middle-tier business logic application or set of applications, possibly on a local area network or intranet server
A third-tier, back-end, database and transaction server, sometimes on a mainframe or large server
* ANSWER :
----------
Comparison chart
Application Server versus Web Server comparison chart
Comparison chart
Application Server Vs Web Server
o http://www.diffen.com/difference/Application_Server_vs_Web_Server
What is it? :
A server that <<exposes business logic to client applications>> through various protocols including HTTP.
o A server that <<handles HTTP protocol>>.
Job :
Application server is used to serve web based applications and enterprise based applications(i.e servlets, jsps and ejbs...). Application
servers may contain a web server internally.
o Web server is used to serve web based applications.(i.e servlets and jsps)
Functions :
To deliver various applications to another device, it allows everyone in the network to run software off of the same machine.
o Keeping HTML, PHP, ASP, etc files available for the web browsers to view when a user accesses the site on the web,
handles HTTP requests from clients.
Supports :
Distributed transaction and EJB's ( Enterpises Java Bean)
Servlets and JSP ( Java server page)
Resource utilization : ( Display memory)
High
Low
* what is arcamai?
ANSWER :
---------
3. How to do clear browser cache? and Amazon case memory of the items?
ANSWER :
---------
Online Exam:
http://www.javatpoint.com/result.jsp
FAQ
http://www.javatpoint.com/corejava-interview-questions
----------------------------------------------------------
Dt: 11/26/2016
http://www.javatpoint.com/features-of-java
* Features of Java
There is given many features of java. They are also known as java buzzwords. The Java Features given below are simple and easy to understand.
Simple
Object-Oriented
Platform independent
Secured
Robust
Architecture neutral
Portable
Dynamic
Interpreted
High Performance
Multithreaded
Distributed
* Object-oriented
Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behaviour.
Object-oriented programming(OOPs) is a methodology that simplify software development and maintenance by providing some rules.
Basic concepts of OOPs are:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation
Eg. Java Code:-
---------------
package UsJavaPkg;
public class HelloWord {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.print("Hello World");
}
}
Understanding first java program
---------------------------------
Let's see what is the meaning of class, public, static, void, main, String[], System.out.println().
* Class keyword is used to declare a class in java.
* Public keyword is an access modifier which represents visibility, it means it is visible to all.
* Static is a keyword, if we declare any method as static, it is known as static method.
The core advantage of static method is that there is no need to create object to invoke the static method.
The main method is executed by the JVM, so it doesn't require to create object to invoke the main method. So it saves memory.
* Void is the return type of the method, it means it doesn't return any value.
* Main represents startup of the program.
* String[] args is used for command line argument. We will learn it later.
* System.out.println() is used print statement. We will learn about the internal working of System.out.println statement later.
----------------------------------------------------------
* What is the Difference between Static and non-static method in Java
Difference between Static and non-static method in Java
In case of non-static method memory is allocated multiple time whenever method is calling. But memory for static method is allocated
only once at the time of class loading. Method of a class can be declared in two different ways
Non-static methods
Static methods
Difference between non-static and static Method
Non-Static method
1 These method never be preceded by static keyword
Static method
These method always preceded by static keyword
Example:
1. Non Static method
Example:
void fun1()
{
......
......
} These method always preceded by static keyword
Static method
Example:
static void fun2()
{
......
......
}
2 Memory is allocated multiple time whenever method is calling.
Static method - Memory is allocated only once at the time of class loading.
3 It is specific to an object so that these are also known as instance method.
Static method These are common to every object so that it is also known as member method or class method.
4 These methods always access with object reference
Syntax:
Objref.methodname();
Static method - These property always access with class reference
Syntax:
className.methodname();
5 If any method wants to be execute multiple time that can be declare as non static.
Static method - If any method wants to be execute only once in the program that can be declare as static.
Note: In some cases static methods not only can access with class reference but also can access with object reference.
Example of Static and non-Static Method
Example
class A
{
void fun1()
{
System.out.println("Hello I am Non-Static");
}
static void fun2()
{
System.out.println("Hello I am Static");
}
}
class Person
{
public static void main(String args[])
{
A oa=new A();
oa.fun1(); // non static method
A.fun2(); // static method
}
}
Output
Hello I am Non-Static
Hello I am Static
I think you have using Selenium WebDriver 3.x version.
Please watch lectures 46, 47 and 49.
* TCS - Upcasting and downcasting in Java
http://javainsimpleway.com/upcasting-and-downcasting-in-java/
Casting : taking an object of one type and assigning it to reference variable of another type.
Upcasting : Object of child class is assigned to reference varibale of parent type.
Ex: class A{}
class B extend A{}
A a1 = new B();
this operation is a upcasting. and it happens automatically.no need to do anything explicitly.
package com.kb.casting;
class Parent{
int x=10;
void show(){
System.out.println("parent-show");
}
void OnlyParentShow(){
System.out.println("OnlyParentShow");
}
}
class Child extends Parent{
int x=20;
void show(){
System.out.println("child-show");
}
void OnlyChildShow(){
System.out.println("OnlyChildShow");
}
}
public class ParentChild {
public static void main(String[] args) {
Parent p = new Child();
p.show();
p.OnlyParentShow();
System.out.println(p.x);
}
}
Output is
---------
child-show
OnlyParentShow
show() is a method and overridden in child so child’s method is called.
OnlyParentShow() is a method not overridden but inherited to child and called as it is.
* How many catch blocks can be there for a single try block?
There can be any number of catch block for a single try
block.
However only the catch block encountered first on the call
stack that satisfies the condition for the exception will
be executed for that particular exception, rest will be
ingnored.
class multicatch
{
public static void main(String[] args)
{
int[] c={1};
String s="this is a false integer";
try
{
int x=5/args.length;
c[10]=12;
int y=Integer.parseInt(s);
}
catch(ArithmeticException ae)
{
System.out.println("Cannot divide a number by zero.");
}
catch(ArrayIndexOutOfBoundsException abe)
{
System.out.println("This array index is not accessible.");
}
catch(NumberFormatException nfe)
{
System.out.println("Cannot parse a non-integer string.");
}
}
}
* Multiple buttons with same type and id (3 Button) - Dynamic
Normal code : <input type="submit" id="button" value="Edit"/>
Code 1. selenium.click("xpath=//input[1][@id='button' and @value='Edit']"); i have tried this is not working.
Code 2. selenium.click("//input[@id='button' and @value='Edit'][1]");
Code 3.
String cssSelectorOfSameElements="input[type='submit'][id='button']";
List<WebElement> a=driver.findElements(By.cssSelector(cssSelectorOfSameElements)) ;
a.get(0).click();
//a.get(1).click();
//a.get(2).click();
* Sendkey() Replacement\ Alternate
Code - Way default \ 0
public void loginTestCase() {
driver.navigate().to(URL);
driver.findElement(By.name("signIn")).click();
driver.findElement(By.id("username")).sendKeys("testuser");
driver.findElement(By.id("password")).sendKeys("testpassword");
driver.findElement(By.name("loginbtn")).click();
Ex2:
System.setProperty("webdriver.chrome.driver", "C:\\selenium-java-2.35.0\\chromedriver_win32_2.2\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("Cheese!");
element.submit();
* Code - Way 1 to Execute Script
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
JavascriptExecutor myExecutor = ((JavascriptExecutor) driver);
myExecutor.executeScript("document.getElementsByName('q')[0].value='Kirtesh'", seachbox);
driver.quit();
* Code - Way 2 to Execute Script
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchbox = driver.findElement(By.xpath("//input[@name='q']"));
JavascriptExecutor myExecutor = ((JavascriptExecutor) driver);
myExecutor.executeScript("arguments[0].value='Kirtesh';", searchbox);
driver.quit();
* When does finally block execute? ( try.... catch...)
Yes, it will. No matter what happens in your try or catch block unless otherwise System.exit()
called or JVM crashed. if there is any return statement in the block(s),finally will be
executed prior to that return statement. finally block execute always, no matter exception
object occur or not.
* What is Page Facotry?
Page Object Model is an Object repository design pattern in Selenium WebDriver. POM creates our
testing code maintainable, reusable. Page Factory is an optimized way to create object
repository in POM concept.
http://www.guru99.com/page-object-model-pom-page-factory-in-selenium-ultimate-guide.html
* What is Data Provider?
TestNG Data Providers. When you need to pass complex parameters or parameters that need to be
created from Java (complex objects, objects read from a property file or a database, etc…), in
such cases parameters can be passed using Dataproviders. A Data Provider is a method annotated
with @DataProvider.
* Parameterization using XML and DataProviders: Selenium
As we create software we always wish it should work differently with a different set of data.
When it comes to testing the same piece of software, we can't be unfair to test it with just
one set of data. Here again, we need to verify that our system is taking all set of combinations
which it expected to support.
Type of Parameterization in TestNG-
To make parameterization more clear, we will go through the parameterization options in one the
most popular framework for Selenium Webdriver - TestNG.
There are two ways by which we can achieve parameterization in TestNG
1. With the help of Parameters annotation and TestNG XML file.
@Parameters({"name","searchKey"})
2. With the help of DataProvider annotation.
@DataProvider(name="SearchProvider")
* Sikuli is user to test Adope / Compare Images. ( Instead of Selenium validations)
-----------------------
* What is the difference between final finally and finalize in Java?
Final class can't be inherited, final method can't be overridden and final variable value can't be changed.
Finally is used to place important code, it will be executed whether exception is handled or not.
Finalize is used to perform clean up processing just before object is garbage collected.
-----------------------
* What is the Difference between Static and public
The static keyword can be used in 4 scenarios
static variables
static methods
static blocks of code.
static nested class
Lets look at static variables and static methods first.
static variable
---------------
It is a variable which belongs to the class and not to object(instance)
Static variables are initialized only once , at the start of the execution . These variables will be initialized first, before the initialization of any instance variables
A single copy to be shared by all instances of the class
A static variable can be accessed directly by the class name and doesn’t need any object
Syntax : Class.variable
static method
-------------
It is a method which belongs to the class and not to the object(instance)
A static method can access only static data. It can not access non-static data (instance variables) unless it has/creates an instance of the class.
A static method can call only other static methods and can not call a non-static method from it unless it has/creates an instance of the class.
A static method can be accessed directly by the class name and doesn’t need any object
Syntax : Class.methodName()
A static method cannot refer to this or super keywords in anyway
static class
Java also has "static nested classes",A static nested class is just one which doesn't implicitly have a reference to an instance of the outer class.
Static nested classes can have instance methods and static methods.
public>>> is a Java keyword which declares a member's access as public. Public members are visible to all other classes. This means that any other class
can access a public field or method. Further, other classes can modify public fields unless the field is declared as final .
----------------------------
---------
* 1.
Overloading occurs when two or more methods in one class have the same method name but different parameters.
Overriding means having two methods with the same method name and parameters (i.e., method signature).
One of the methods is in the parent class and the other is in the child class.
Java Method Overloading example : (Interface ; create through the packages)
----------------------------------
class OverloadingExample{
static int add(int a,int b){return a+b;}
static int add(int a,int b,int c){return a+b+c;}
}
Java Method Overriding example :
-------------------------------
class Animal{
void eat(){System.out.println("eating...");}
}
class Dog extends Animal{
void eat(){System.out.println("eating bread...");}
}
* http://www.softwaretestinghelp.com/selenium-tutorial-1/
https://www.udemy.com/selenium-webdriver-with-java-testng-and-log4j/learn/v4/overview
aeiouMyUdemy2016123
ApowerSoft screen recorder:
http://filehippo.com/download_apowersoft_free_screen_recorder/
* Thread.sleep(2000);
What is Fluent wait and how it is different from implicit wait and explicit wait?
Implicit wait:
Implicit wait tells web driver to wait on every instance when try to find element. It is like global wait for all driver.
findelement instance. It will <<force web driver to wait until >> element is appeared on page or defined time whatever is earliest. Drawback is
it throws exception when element is not loaded on page even in defined time span.
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = driver.findElement(By.id("myDynamicElement"));
Explicit wait: Explicit wait is of two types:
WebDriver driver = new FirefoxDriver();
driver.get("http://somedomain/url_that_delays_loading");
WebElement myDynamicElement = (new WebDriverWait(driver, 10))
.until(ExpectedConditions.presenceOfElementLocated(By.id("myDynamicElement")));
1) WebDriverWait
2) FluentWait
both are classes and implements Wait interface.
WebDriverWait is applied on certain element with defined expected condition and time. This wait is only applied to the specified element.
This wait can also throw exception when element is not found.
WebDriverWait wait = new WebDriverWait (driver, 20);
wait.until(ExpectedConditions.VisibilityofElementLocated(By.xpath(""//button[@value='Save Changes']"")));
Fluent wait:
Fluent wait is another type of Explicit wait and you can define polling ( Interval it try) and ignore the exception to continue with script execution in case
element is not found.
new FluentWait<WebDriver>(driver).withTimeout(30, TimeUnit.SECONDS).pollingevery(10, TimeUnit.SECONDS).ignoring(NoSuchElementException.class);
Each FluentWait instance defines the maximum amount of time to wait for a condition, as well as the frequency with which to check the condition.
Wait wait = new FluentWait(driver)
.withTimeout(30, SECONDS)
.pollingEvery(5, SECONDS)
.ignoring(NoSuchElementException.class);
What is Absolute and relative path?
\ - Absolute Xpath: It uses Complete path from the Root Element to the desire element.
\\ - Relative Xpath: You can simply start by referencing the element you want and go from there.
Always Relative Xpaths are preferred as they are not the complete paths from the Root element. (//html//body) ..
Beacuse in future any of the webelement when added/Removed then Absolute Xpath changes. So Always use Relative Xpaths in your Automation.
// Absolute Path starts from root path, Relative Path starts from current path
//Selenium WebDriver - Absolute and Relative Path Examples
//Example Absolute and Relative Paths for Selenium WebDriver
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
public class AbsoluteRelativePaths {
@Test
public void absolutePath() throws InterruptedException {
System.setProperty("webdriver.chrome.driver", "E:\\Selenium\\chromedriver_win32\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("E:\\Selenium\\absolute.html");
// Absolute Path starts from root path
WebElement link1 = driver.findElement(By.xpath("/html/body/li[@id='test']/a"));
// Relative Path starts from current path
WebElement link2 = driver.findElement(By.xpath(".//*[@id='test']/a"));
driver.quit();
}
}
* How to scroll the scroll ball in window with selenium - Java script
EventFiringWebDriver eventFiringWebDriver = newEventFiringWebDriver(webDriver);
eventFiringWebDriver.executeScript("scroll(0,4000)",args);
* How will you handle dynamic object - runtime objects in Selenium,
we can do through ID's, index and other CSS locators
* How will you handle dynamic object - runtime objects in Selenium,
we can do through ID's, index and other CSS locators
ANSWER:Xpath
http://www.testerlogic.com/handling-dynamic-elements-in-selenium-webdriver/
Code :
// Dynamic Element Locators
<button id="Submit-901" />
<button id="Submit-902" />
<button id="Submit-903" />
1. Absolute XPath
web_element_name=html/body/div[30]/div[2]/div[2]/div/div/div/div[1]/table/tbody/tr/td[2]/table/tbody/tr/td[1]/table/tbody/tr/td[1]/table/tbody/tr[2]/td[2]/em/button
//p[6]/label[2]/div/ins
2. Identify Element by starting Text
XPath: //button[starts-with(@id, 'Submit-')]
3. Identify Element by containing Text
<input class="new-userfield-001">
<input class="old-userfield-002">
XPath: //input[contains(@class, '-userfield-')].
4. Identify Element by Index
driver.findElements(By.xpath(“//*submit”)).get(0).click();
5. Identify Element with reference of a closest stable element
XPATH: //span1/../following-sibling::div//button1
6. Identify Element by stable preceding Text
//label2/following::input
* Exception handling can be done through try catch
* Window popups are handled through Robot scripting ins elenium
http://www.softwaretestinghelp.com/handle-alerts-popups-selenium-webdriver-selenium-tutorial-16/
There are two types of alerts that we would be focusing on majorly:
1.Windows based alert pop ups
2.Web based alert pop ups
* http://www.softwaretestinghelp.com/selenium-select-class-selenium-tutorial-13/
*$$$$$$*
* Java :-
Download and install - Java SE Development Kid ( JDK 8.0)
http://www.javatpoint.com/corejava-interview-questions
At command prompt
Check for JDK
javac -version
C:\Users\acerpraveen>javac -version
javac 1.8.0_112
If error: Set the JDK path : -
C:\Program Files\Java\jdk1.8.0_112\bin
Type Env and go the environment variables and do the settings;
Control Panel\System and Security\System - ( Edit environment variable - path)
For JRE :-
C:\Users\acerpraveen>java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
<<<<Eclipse IDE for Java Developer>>>>
https://www.udemy.com/selenium-webdriver-with-java-testng-and-log4j/learn/v4/t/lecture/1344972
3.
* Jenkins with maven continuous integration
* Use Git and GitHub to manage and share source code
Git hub we can do anything, we can manage or share source code with any one its
all matter of authorization permissions to any user
yes, SOAP UI with XML or WSDL file, it can be jason.xml file
* Angular JS, we use protractor framework in selenium this is part of security
Angular Js is used for open UI hat is free open software where developers use to build the web ui,a nd the protractor framework is used
to test that Angular Js layer
* Angular JS, we use protractor framework in selenium
* Simple Object Access Protocol (SOAP)
* Release Testing
After build release some of the companies do engineering prequal before giving the build to qa
there are different terms like, BVT, BFT, smoke test, We call it as RFB.
4.
* Perfecto mobile FAQ
Other Mobile tools - Seetest, Perfecto Mobile, BlazeMeter, AppThwack, Manymo, DeviceAnywhere
* Faq: http://interviewquestionsanswerspdf.com/2014/04/mobile-testing-interview-questions-and-answers/
* Knowledge of iOS and Android operating systems ( App Store iOS / Android Google Pay)
Android application package (.APK) file to be downloaded and installed in Android
.IPA files are Executable Files for iphone to install
* Use of private app store or OTA distribution
Use of private app store or OTA distribution -- this is more with IOS, Over the air enterprice distribution of the app.
5. * QTP\ HP UFT FAQ
http://www.guru99.com/qtp-interview-questions.html#50
* What is parameterization
http://www.softwaretestinghelp.com/qtp-tutorial-19-qtp-parameterization-part1/
Types of parameterization in QTP
The variable value can be or the parameter types can be:
1.Data Table parameters
2.Test/Action parameters
3.Environment variable parameters
4.Random number parameters
* What is ordinal identifier? (3) Index, location, creation time
* How the objects are identified in qtp ID, class name,
* What is assive property? and Mandatory property?
* How do you read objects (FSO) - File system objects.
* What is import \ export ( Excel sheet)
* What is global sheet and local sheet
* Identification of an Object in QTP/UFT :
1) Normal Identification
2) Smart Identification
3) Ordinal identification ( 3 Type Index based , Location based and Creation Time - value CreationTime=0 )
4) Visual Based Identification
5) Object identification based on CSS XPath
6) Image Based identification
7) VRI- Visual relation Identifier
* What is XPath?
XPath is a language used to get the information from an xml document.
XPath uses path expressions to navigate and identify the element in the xml document
The advantage of using XPath is to identify any object in the application easily without wasting much time looking for combination of properties to make it unique. If you are working on a commercial application, you would see code like this.
<form>
<label for="male">Male</label>
<input type="radio" name="sex" id="male"/><br/>
<label for="female">Female</label>
5.<input type="radio" name="sex" id="female"/>
</form>
*i.To identify the first input box copy and paste the following syntax into the Value edit box:
/html/body/form/input[1]
*ii. To identify the second input box copy and paste the following syntax into the Value edit box:
/html/body/form/input[2]
*$$$$$$*
* Experience with Quality Tools (Quality Center, Perfecto Mobile, Jira, Rally… Etc. )
1. Experience with .NET, XML and JSON web services
Experience with .NET, XML and JSON web services - this is more of restful web services testing, did you test Soap UI
* 5. Knowledge of Test-Driven Development principles and tools for mobile
BDD - Behavioural driven development - here we use cucumber - when, then and what
TDD - here the business are hidden not exposed to BA & product owner; mostly Dev & QA works hand-on-hand
and do testing and developement.
* 7. Vulnerable testing? ( Security Testing - will be done on all layers. )
Fishing - Creating junks email and hacking the Credcredential; blocking; decoding; Injections
* 7a.Python Tutorial for Beginners 1 - Getting Started and Installing Python (For Absolute Beginners) (1- 15)
https://www.youtube.com/watch?v=41qgdwd3zAg&list=PLS1QulWo1RIaJECMeUT4LFwJ-ghgoSH6n
Python 3.4.1
* 9. Soup UI
* 10. Postmaster
* 11. Hive
* 12 Impala
* Test Complete
* Vb Scripting
http://www.globalguideline.com/interview_questions/Questions.php?sc=VBScript_Interview_Questions_And_Answers
* 7a. Spring Tool Suite (STS):
The Spring Tool Suite is an Eclipse-based development environment that is customized for developing Spring applications.
It provides a ready-to-use environment to implement, debug, run, and deploy your Spring applications, including integrations
for Pivotal tc Server, Pivotal Cloud Foundry, Git, Maven, AspectJ, and comes on top of the latest Eclipse releases.
*$$$$$$*
* 2. Differencee between c, c++ and C#.
•Hardware device drivers
•Applications where access to old, stable code is required.
C,C++
•Application or Server development where memory management needs to be fine tuned (and can't be left to generic garbage collection solutions).
•Development environments that require access to libraries that do not interface well with more modern managed languages.
•Although managed C++ can be used to access the .NET framework, it is not a seamless transition.
C# provides a managed memory model that adds a higher level of abstraction again. This level of abstraction adds convenience and improves
development times, but complicates access to lower level APIs and makes specialized performance requirements problematic.
It is certainly possible to implement extremely high performance software in a managed memory environment, but awareness of the implications
is essential.
The syntax of C# is certainly less demanding (and error prone) than C/C++ and has, for the initiated programmer, a shallower learning curve.
C#
•Rapid client application development.
•High performance Server development (StackOverflow for example) that benefits from the .NET framework.
•Applications that require the benefits of the .NET framework in the language it was designed for.
* 3. Where is the Delphi Technique Used?
The Delphi Method is useful in 2 scenarios.
1. When there are many experts involved, and consensus is not likely to happen quickly.
2. When the experts are geographically spread out, and it is difficult to get them into a room to discuss,
brainstorm and come up with the best strategy.
Where is the Delphi Technique used for the PMP exam preparation?
The Delphi technique is actually one of the Group Decision-Making Techniques. It is used in
Time Management > Estimate Activity Duration
Cost Management > Estimate Costs
Risk Management > Identify Risks
* Oracle/Mongo DB
http://www.softwaretestinghelp.com/selenium-tutorial-1/
*$$$$$$*
* What is the Document Object Model?
The Document Object Model (DOM) is an application programming interface (API) for valid HTML and well-formed XML documents.
It defines the logical structure of documents and the way a document is accessed and manipulated. In the DOM specification, the term
"document" is used in the broad sense - increasingly, XML is being used as a way of representing many different kinds of information that
may be stored in diverse systems, and much of this would traditionally be seen as data rather than as documents. Nevertheless,
XML presents this data as documents, and the DOM may be used to manage this data.
With the Document Object Model, programmers can build documents, navigate their structure, and add, modify, or delete elements and content.
Anything found in an HTML or XML document can be accessed, changed, deleted, or added using the Document Object Model, with a few exceptions
- in particular, the DOM interfaces for the XML internal and external subsets have not yet been specified.
*$$$$$$*
* Process 1. Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle:
requirements are turned into very specific test cases, then the software is improved to pass the new tests, only.
This is opposed to software development that allows software to be added that is not proven to meet requirements.
Test-driven development (TDD) (Beck 2003; Astels 2003), is an evolutionary approach to development which combines test-first development
where you write a test before you write just enough production code to fulfill that test and refactoring.
What is the primary goal of TDD? One view is the goal of TDD is specification and not validation (Martin, Newkirk, and Kess 2003).
In other words, it’s one way to think through your requirements or design before your write your functional code (implying that
TDD is both an importantagile requirements and agile design technique). Another view is that TDD is a programming technique.
As Ron Jeffries likes to say, the goal of TDD is to write clean code that works. I think that there is merit in both arguments,
although I lean towards the specification view, but I leave it for you to decide.
http://agiledata.org/essays/tdd.html
Nice articel about TDD
Acceptance test–driven development (ATDD) is a development methodology based on communication between the business customers, the developers,
and the testers.[1] ATDD encompasses many of the same practices as specification by example,[2][3] behavior-driven development (BDD),
[4] example-driven development (EDD),[5] and story test–driven development (SDD).[6]
All these processes aid developers and testers in understanding the customer's needs prior to implementation and allow customers
to be able to converse in their own domain language.
Acceptance critirial - as per the check list all test cases are passed.
Excel - keyword. ( Similar to Tracibility martics).
* Based on your experience how will you implement Acceptance test–driven development (ATDD) in AGILE?
*$$$$$$*
* What is QA & QC?
http://www.diffen.com/difference/Quality_Assurance_vs_Quality_Control
Answer:
Quality Assurance is <<<<process oriented and focuses on defect <<<<prevention, while
Quality control is <<<<product oriented and focuses on defect <<<<<identification.
Quality Assurance Vs Quality Control
Definition
QA is a set of activities for ensuring quality in the processes by which products are developed.
QC is a set of activities for ensuring quality in products. The activities focus on identifying defects in the actual products produced.
Focus on
QA aims to prevent defects with a focus on the process used to make the product. It is a proactive quality process.
QC aims to identify (and correct) defects in the finished product. Quality control, therefore, is a reactive process.
Goal
The goal of QA is to improve development and test processes so that defects do not arise when the product is being developed.
The goal of QC is to identify defects after a product is developed and before it's released.
How
QA Establish a good quality management system and the assessment of its adequacy. Periodic conformance audits of the operations of the system.
QC Finding & eliminating sources of quality problems through tools & equipment so that customer's requirements are continually met.
What
QA Prevention of quality problems through planned and systematic activities including documentation.
Qc The activities or techniques used to achieve and maintain the product quality, process and service.
Responsibility
Everyone on the team involved in developing the product is responsible for quality assurance.
Quality control is usually the responsibility of a specific team that tests the product for defects.
Example
Verification is an example of QA
Validation/Software Testing is an example of QC
Statistical Techniques
Statistical Tools & Techniques can be applied in both QA & QC. When they are applied to processes (process inputs & operational parameters),
they are called Statistical Process Control (SPC); & it becomes the part of QA.
QC When statistical tools & techniques are applied to finished products (process outputs), they are called as Statistical Quality Control (SQC)
& comes under QC.
As a tool
QA is a managerial tool
QC is a corrective tool
Orientation
QA is process oriented
QC is product oriented
* What is verification and validation?
--------------------------------------
ANSWER:
http://softwaretestingfundamentals.com/verification-vs-validation/
VERIFICATION vs VALIDATION
Criteria Verification Validation
Definition :
Ver : The process of evaluating work-products (not the actual final product) of a development phase to determine whether they
meet the specified requirements for that phase.
Val : The process of evaluating software during or at the end of the development
process to determine whether it satisfies specified business requirements.
Objective :
Ver : To ensure that the product is being built according to the requirements and design specifications.
In other words, to ensure that work products meet their specified requirements.
Val : To ensure that the product actually meets the user’s needs, and that the specifications were correct in the first place.
In other words, to demonstrate that the product fulfills its intended use when placed in its intended environment.
Question :
Ver : Are we building the product right?
Val : Are we building the right product?
Evaluation Items :
Ver : Plans, Requirement Specs, Design Specs, Code, Test Cases
Val : The actual product/software.
Activities:
Ver : • Reviews
• Walkthroughs
• Inspections
Val :
• Testing
* What is SDLC ?
----------------
ANSWER:
https://www.tutorialspoint.com/sdlc/sdlc_overview.htm
SDLC, Software Development Life Cycle is a process used by software industry to design, develop and test high quality softwares.
The SDLC aims to produce a high quality software that meets or exceeds customer expectations, reaches completion within times
and cost estimates.
SDLC is a process followed for a software project, within a software organization. It consists of a detailed plan describing how to develop,
maintain, replace and alter or enhance specific software. The life cycle defines a methodology for improving the quality of software
and the overall development process.
The following figure is a graphical representation of the various stages of a typical SDLC.
Stage 1: Planning & Requirement Analysis
Stage 2: Defining Requirement
Stage 3: Designing the product architecture
Stage 4: Building or Developing the Product
Stage 5: Testing the Product
Stage 6: Deployment in the Market and Maintenance
SDLC models followed in the industry:
------------------------------------
Waterfall Model
Iterative Model
Spiral Model
V-Model
Big Bang Model
The other related methodologies are Agile Model, RAD Model, Rapid Application Development and Prototyping Models.
* What is TDLC ?
----------------
ANSWER:
* What is defect life cycle?
----------------------------
ANSWER:
What is the compentency (Efficiency)of the tester?
----------------------------
ANSWER:
Find the defect at the earliy stage of developement.
ER==AR to stop testing.
Where do the tester play the role in developement stage and Testing stage?
----------------------------
ANSWER:
What is test strategy?
----------------------------
ANSWER:
What is test Plan?
----------------------------
ANSWER:
What is Estimation?
----------------------------
ANSWER:
When to start testing?
----------------------------
ANSWER:
CUSTOMER SERVICE Service Requests Generate Debit Card PIN
* How to selecet the application for testing?
----------------------------------------------
ANSWER:
https://www.tutorialspoint.com/qtp/qtp_test_automation_process.htm
Answer:
Automated Testing Process:
For any automated tool implementation, the following are the phases/stages of it. Each one of the stages corresponds to a particular activity
and each phase has a definite outcome.
1. Test Automation Feasibility Analysis - First step is to check if the application can be automated or not. Not all applications can be
automated due to its limitations.
2. Appropriate Tool Selection - The Next most important step is the selection of tools. It depends on the technology in which the application
is built, its features and usage.
3. Evaluate the suitable framework - Upon selecting the tool the next activity is to select a suitable framework. There are various kinds
of frameworks and each framework has its own significance. We will deal with frameworks in detail later this chapter.
4. Build the Proof of Concept - Proof of Concept(POC) is developed with an end to end scenario to evaluate if the tool can support the automation
of the application. As it is performed with an end to end scenario which will ensure that the major functionalities can be automated.
5. Develop Automation Framework - After building the POC, framework development is carried out, which is a crucial step for the success of any
test automation project. Framework should be build after diligent analysis of the technology used by the application and also its key features.
6. Develop Test Script, Execute and Analyze - Once Script development is completed, the scripts are executed, results are analyzed and defects are logged, if any. The Test Scripts are usually version controlled.
* What is Application Server Vs Web Server?
* ANSWER:
---------
* What is web server?
o http://whatis.techtarget.com/definition/Web-server
A Web server is a program that uses HTTP (Hypertext Transfer Protocol) to serve the files that form Web pages to users, in response to their
requests, which are forwarded by their computers' HTTP clients. Dedicated computers and appliances may be referred to as Web servers as well.
The process is an example of the client/server model. All computers that host Web sites must have Web server programs. Leading Web servers include
Apache (the most widely-installed Web server), Microsoft's Internet Information Server (IIS) and nginx (pronounced engine X) from NGNIX.
*What is Application Server?
An application server is a server program in a computer in a distributed network that provides the business logic for an application program.
The application server is frequently viewed as part of a three-tier application, consisting of a graphical user interface (GUI) server,
an application (business logic) server, and a database and transaction server. More descriptively, it can be viewed as dividing
an application into:
A first-tier, front-end, Web browser-based graphical user interface, usually at a personal computer or workstation
A middle-tier business logic application or set of applications, possibly on a local area network or intranet server
A third-tier, back-end, database and transaction server, sometimes on a mainframe or large server
* ANSWER :
----------
Comparison chart
Application Server versus Web Server comparison chart
Comparison chart
Application Server Vs Web Server
o http://www.diffen.com/difference/Application_Server_vs_Web_Server
What is it? :
A server that <<exposes business logic to client applications>> through various protocols including HTTP.
o A server that <<handles HTTP protocol>>.
Job :
Application server is used to serve web based applications and enterprise based applications(i.e servlets, jsps and ejbs...). Application
servers may contain a web server internally.
o Web server is used to serve web based applications.(i.e servlets and jsps)
Functions :
To deliver various applications to another device, it allows everyone in the network to run software off of the same machine.
o Keeping HTML, PHP, ASP, etc files available for the web browsers to view when a user accesses the site on the web,
handles HTTP requests from clients.
Supports :
Distributed transaction and EJB's ( Enterpises Java Bean)
Servlets and JSP ( Java server page)
Resource utilization : ( Display memory)
High
Low
* what is arcamai?
ANSWER :
---------
3. How to do clear browser cache? and Amazon case memory of the items?
ANSWER :
---------
Online Exam:
http://www.javatpoint.com/result.jsp
FAQ
http://www.javatpoint.com/corejava-interview-questions
----------------------------------------------------------
Dt: 11/26/2016
http://www.javatpoint.com/features-of-java
* Features of Java
There is given many features of java. They are also known as java buzzwords. The Java Features given below are simple and easy to understand.
Simple
Object-Oriented
Platform independent
Secured
Robust
Architecture neutral
Portable
Dynamic
Interpreted
High Performance
Multithreaded
Distributed
* Object-oriented
Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behaviour.
Object-oriented programming(OOPs) is a methodology that simplify software development and maintenance by providing some rules.
Basic concepts of OOPs are:
Object
Class
Inheritance
Polymorphism
Abstraction
Encapsulation
Eg. Java Code:-
---------------
package UsJavaPkg;
public class HelloWord {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.print("Hello World");
}
}
Understanding first java program
---------------------------------
Let's see what is the meaning of class, public, static, void, main, String[], System.out.println().
* Class keyword is used to declare a class in java.
* Public keyword is an access modifier which represents visibility, it means it is visible to all.
* Static is a keyword, if we declare any method as static, it is known as static method.
The core advantage of static method is that there is no need to create object to invoke the static method.
The main method is executed by the JVM, so it doesn't require to create object to invoke the main method. So it saves memory.
* Void is the return type of the method, it means it doesn't return any value.
* Main represents startup of the program.
* String[] args is used for command line argument. We will learn it later.
* System.out.println() is used print statement. We will learn about the internal working of System.out.println statement later.
----------------------------------------------------------
* What is the Difference between Static and non-static method in Java
Difference between Static and non-static method in Java
In case of non-static method memory is allocated multiple time whenever method is calling. But memory for static method is allocated
only once at the time of class loading. Method of a class can be declared in two different ways
Non-static methods
Static methods
Difference between non-static and static Method
Non-Static method
1 These method never be preceded by static keyword
Static method
These method always preceded by static keyword
Example:
1. Non Static method
Example:
void fun1()
{
......
......
} These method always preceded by static keyword
Static method
Example:
static void fun2()
{
......
......
}
2 Memory is allocated multiple time whenever method is calling.
Static method - Memory is allocated only once at the time of class loading.
3 It is specific to an object so that these are also known as instance method.
Static method These are common to every object so that it is also known as member method or class method.
4 These methods always access with object reference
Syntax:
Objref.methodname();
Static method - These property always access with class reference
Syntax:
className.methodname();
5 If any method wants to be execute multiple time that can be declare as non static.
Static method - If any method wants to be execute only once in the program that can be declare as static.
Note: In some cases static methods not only can access with class reference but also can access with object reference.
Example of Static and non-Static Method
Example
class A
{
void fun1()
{
System.out.println("Hello I am Non-Static");
}
static void fun2()
{
System.out.println("Hello I am Static");
}
}
class Person
{
public static void main(String args[])
{
A oa=new A();
oa.fun1(); // non static method
A.fun2(); // static method
}
}
Output
Hello I am Non-Static
Hello I am Static
I think you have using Selenium WebDriver 3.x version.
Please watch lectures 46, 47 and 49.
* TCS - Upcasting and downcasting in Java
http://javainsimpleway.com/upcasting-and-downcasting-in-java/
Casting : taking an object of one type and assigning it to reference variable of another type.
Upcasting : Object of child class is assigned to reference varibale of parent type.
Ex: class A{}
class B extend A{}
A a1 = new B();
this operation is a upcasting. and it happens automatically.no need to do anything explicitly.
package com.kb.casting;
class Parent{
int x=10;
void show(){
System.out.println("parent-show");
}
void OnlyParentShow(){
System.out.println("OnlyParentShow");
}
}
class Child extends Parent{
int x=20;
void show(){
System.out.println("child-show");
}
void OnlyChildShow(){
System.out.println("OnlyChildShow");
}
}
public class ParentChild {
public static void main(String[] args) {
Parent p = new Child();
p.show();
p.OnlyParentShow();
System.out.println(p.x);
}
}
Output is
---------
child-show
OnlyParentShow
show() is a method and overridden in child so child’s method is called.
OnlyParentShow() is a method not overridden but inherited to child and called as it is.
* How many catch blocks can be there for a single try block?
There can be any number of catch block for a single try
block.
However only the catch block encountered first on the call
stack that satisfies the condition for the exception will
be executed for that particular exception, rest will be
ingnored.
class multicatch
{
public static void main(String[] args)
{
int[] c={1};
String s="this is a false integer";
try
{
int x=5/args.length;
c[10]=12;
int y=Integer.parseInt(s);
}
catch(ArithmeticException ae)
{
System.out.println("Cannot divide a number by zero.");
}
catch(ArrayIndexOutOfBoundsException abe)
{
System.out.println("This array index is not accessible.");
}
catch(NumberFormatException nfe)
{
System.out.println("Cannot parse a non-integer string.");
}
}
}
* Multiple buttons with same type and id (3 Button) - Dynamic
Normal code : <input type="submit" id="button" value="Edit"/>
Code 1. selenium.click("xpath=//input[1][@id='button' and @value='Edit']"); i have tried this is not working.
Code 2. selenium.click("//input[@id='button' and @value='Edit'][1]");
Code 3.
String cssSelectorOfSameElements="input[type='submit'][id='button']";
List<WebElement> a=driver.findElements(By.cssSelector(cssSelectorOfSameElements)) ;
a.get(0).click();
//a.get(1).click();
//a.get(2).click();
* Sendkey() Replacement\ Alternate
Code - Way default \ 0
public void loginTestCase() {
driver.navigate().to(URL);
driver.findElement(By.name("signIn")).click();
driver.findElement(By.id("username")).sendKeys("testuser");
driver.findElement(By.id("password")).sendKeys("testpassword");
driver.findElement(By.name("loginbtn")).click();
Ex2:
System.setProperty("webdriver.chrome.driver", "C:\\selenium-java-2.35.0\\chromedriver_win32_2.2\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
WebElement element = driver.findElement(By.name("q"));
element.sendKeys("Cheese!");
element.submit();
* Code - Way 1 to Execute Script
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
JavascriptExecutor myExecutor = ((JavascriptExecutor) driver);
myExecutor.executeScript("document.getElementsByName('q')[0].value='Kirtesh'", seachbox);
driver.quit();
* Code - Way 2 to Execute Script
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
WebElement searchbox = driver.findElement(By.xpath("//input[@name='q']"));
JavascriptExecutor myExecutor = ((JavascriptExecutor) driver);
myExecutor.executeScript("arguments[0].value='Kirtesh';", searchbox);
driver.quit();
* When does finally block execute? ( try.... catch...)
Yes, it will. No matter what happens in your try or catch block unless otherwise System.exit()
called or JVM crashed. if there is any return statement in the block(s),finally will be
executed prior to that return statement. finally block execute always, no matter exception
object occur or not.
* What is Page Facotry?
Page Object Model is an Object repository design pattern in Selenium WebDriver. POM creates our
testing code maintainable, reusable. Page Factory is an optimized way to create object
repository in POM concept.
http://www.guru99.com/page-object-model-pom-page-factory-in-selenium-ultimate-guide.html
* What is Data Provider?
TestNG Data Providers. When you need to pass complex parameters or parameters that need to be
created from Java (complex objects, objects read from a property file or a database, etc…), in
such cases parameters can be passed using Dataproviders. A Data Provider is a method annotated
with @DataProvider.
* Parameterization using XML and DataProviders: Selenium
As we create software we always wish it should work differently with a different set of data.
When it comes to testing the same piece of software, we can't be unfair to test it with just
one set of data. Here again, we need to verify that our system is taking all set of combinations
which it expected to support.
Type of Parameterization in TestNG-
To make parameterization more clear, we will go through the parameterization options in one the
most popular framework for Selenium Webdriver - TestNG.
There are two ways by which we can achieve parameterization in TestNG
1. With the help of Parameters annotation and TestNG XML file.
@Parameters({"name","searchKey"})
2. With the help of DataProvider annotation.
@DataProvider(name="SearchProvider")
* Sikuli is user to test Adope / Compare Images. ( Instead of Selenium validations)
-----------------------
* What is the difference between final finally and finalize in Java?
Final class can't be inherited, final method can't be overridden and final variable value can't be changed.
Finally is used to place important code, it will be executed whether exception is handled or not.
Finalize is used to perform clean up processing just before object is garbage collected.
-----------------------
* What is the Difference between Static and public
The static keyword can be used in 4 scenarios
static variables
static methods
static blocks of code.
static nested class
Lets look at static variables and static methods first.
static variable
---------------
It is a variable which belongs to the class and not to object(instance)
Static variables are initialized only once , at the start of the execution . These variables will be initialized first, before the initialization of any instance variables
A single copy to be shared by all instances of the class
A static variable can be accessed directly by the class name and doesn’t need any object
Syntax : Class.variable
static method
-------------
It is a method which belongs to the class and not to the object(instance)
A static method can access only static data. It can not access non-static data (instance variables) unless it has/creates an instance of the class.
A static method can call only other static methods and can not call a non-static method from it unless it has/creates an instance of the class.
A static method can be accessed directly by the class name and doesn’t need any object
Syntax : Class.methodName()
A static method cannot refer to this or super keywords in anyway
static class
Java also has "static nested classes",A static nested class is just one which doesn't implicitly have a reference to an instance of the outer class.
Static nested classes can have instance methods and static methods.
public>>> is a Java keyword which declares a member's access as public. Public members are visible to all other classes. This means that any other class
can access a public field or method. Further, other classes can modify public fields unless the field is declared as final .
----------------------------
This is really a nice and informative, containing all information and also has a great impact on the new technology.
ReplyDeleteSelenium Course in Chennai
Selenium Courses in Chennai
try this....Java Interview Questions
ReplyDelete