Saturday 28 December 2013

QTP Debugging

Debugging Short cut Keys


F11 = Step Into
F10 = (Step over) Step into but not enter into Function
CTRL+F10 = Run Until Step complete

SHIFT+F11 = (Step out) Available only on Run mode. come to end of the method

step into

F11
its goes to each and every steps in scripts.
its goes into loop and loop the step.
its goes into each and every steps in function.
it always visible.

step over

F10
its goes into each every steps in scripts.
its goes into loop and loop the steps.
but its not goes into the function. its executed the function. but its not goes into the function.
its visible only it execution mode.

step out

Shift + F11
its visible only if its goes into the function while execution mode. otherwise its not visible.
its come to last line of the function. its executed the script in function.and come to last line of the function.
its not visible if we not in function while execution mode.

Monday 23 December 2013

Agile Methodolgy


We go for Agile mode while we face below scenario

-> unclear Requirements
-> Frequent requirement changes
-> want to release project Quickly output for partial requirements.
-> While implement new Tecnology in organization
-> New type of project implement in organization.


We dont have clear documents while implement new tchnology or new type of project implementation. so we can follow  below steps,

If raise Problems -> Take Discussion -> Find Solution -> Implementation


Drawback

Sometimes the Agile Model may deviate from objective or Planning of the project.



Agile Model

1) Requirements

2) Identify the scope and list out the Module from the requirements

3) Take the one module from list of module then do follow process
    i)  Planning
    ii) design
    iii)Implementation
    iv) Testing
    v)  iCAT / eCAT
    Vi) If the client satisfied by the product then move to next step (4). Otherwise loop continued from step (i).

4) Take next module from list of module and loop continued from step (3).

5) If all the module get completed then finally the project moved into Maintanance.







Agile Scrum

Agile Scrum used to organize the Agile model.

The drawback of Agile model is we may deviate from objective or Planning of the project because lot of discussion made for find solution. so we follow below steps for overcome this problem

1) Assign perticular person for monitor the process if any deviation  from plan  for Agile process.

2) And maintained seperate document for keep track the process if find any deviation  from plan  for Agile process.

If the above two process implement in Agile model then its called Agile Scrum.


Sprint

Project is divided into sprints

1) One module divide into many functionalities

2) Then each and every functionality divided into many sprint. Those all sprits are do some tasks for according functionality.

3) we can keep track for those sprints for every one week or max 30 days. And monitor we may deviated from planning or not.

4) Then finally we release the sprint into production.


Product backlog - Maintain list what are functionality left and need to implement.

Sprint Burndown Chart - Maintain list what are sprint left and need to implement.

Release Burndown Chart - Maintain list what are release left and need to implement.




who involve in the Agile Scrum

-> Product Master - He is client and define the requirements. From that we can identify the objective and planning.

-> Scrum Master-> He is intermediate from Product master and Team member. If team member have any doubts then scrum master clear those doubts after discuss with Product master if needed.

-> Team Member -> He is software engineer to implement the project.



Buisness alayst always should be present intermediate between Technical people and product master. becasue technical people speaks technically its not understand by product master.

Then finally the product master clear all doubts when its asked by technical people. so its better to analysis.

Automation Testing

Execute the test case suite (Test suite is the collection of all test cases which are tested  )

QTP tool itself enter the data into application under test then compare the result from expected result and Actual result. finally generate the detailed test reports.



Goal of Automation testing

Reduce number of test cases to be run manually and not eliminate manual testing.


why Automation testing?

Automation testing is important for following reasons.

-> Manual testing of all work flows, All fields, All negative scenarios is TIME AND COST CONSUMING.

-> It is difficult to test for all multilingual sites manually.

-> Automation does not require human interaction. we can run Automation test without human interaction, that means we can run over night only.

-> Automation increases speed of test execution and test coverage.




which testcases to Automated?

we can automated following testcases

-> testcases are needs to execute repeatedly.

-> Testcases are very tedious or difficult to perform manually

-> Testcases are very time consuming

-> HIGH RISK - Buisness critical test cases.



Which testcases are not suitable for Automated?

-> Testcases that are newly designed and not executed manually atleast once.

-> Testcases for which the requirements are changing frequently.

-> Testcases which are executed on AD HOC basis.



Automation Process

we Following below steps needs for automation process

1) Test tool selection

-> Test tool selection is based on which technology used in the application under test.

Ex: For instance QTP does not support informatica. so QTP cannot used for informatica based application

2) Scope Automation tool

-> scope of automation is area of your application under test which will be automated.

3) Planning, Design and development

During this phase we can create Automation strategy and plan.

4) Test Execution

Automation scripts are executed in this phase.

5) Maintenance

if the new functionality are added to the system under test, the automation scripts are need to be reviewed and maintained for each release cycle.

Maintanance becomes necessary to improve effectiveness if automation scripts.




How to choose automation tool?

-> Easy of use ( scripting language used)
-> support various type of test including functional,regression etc.
-> support fot multiple testing frameworks.


Type of Automation framework

1) Data Driven Automation framework
2) Keyword Automation framework
3) Modular Automation framework
4) Hybrid Automation framework


Use of Automation framework

-> Maintaining consistancy of testing
-> less maintenance of code
-> Improve re-usability


Automation best practice


1) scope of automation
2) select right automation tool
3) choose appropriate framework
4) scripting standared
5) measure matrics 
  -> Percent of defects found
  -> Productivity improvement etc.

Sunday 8 December 2013

Servlet - introduction


Servlet is J2EE server driven technology to create web applications in java. The javax.servlet and javax.servlet.http packages provide interfaces and classes for writing our own servlets.


The HttpServlet class provides methods, such as doGet() and doPost(), for handling HTTP-specific services


#
CGI vs Servlet

Earilier we have the CGI (Common Gateway Interface), but its have some drwback. Its create a new seperate process for each an every request.so its hgh weight componanent. So its get slow performance.

This drwaback overcome by servlet. because for each and every request its create seperate thread. So all thread running under same process. so we no need to create seperate process for each and every request.so its ligh weight and provide fast performance.



Servlet technology was introduced to overcome the shortcomings of CGI technology.

    * Servlets provide better performance that CGI in terms of processing time, memory utilization because servlets uses benefits of multithreading and for each request a new thread is created, that is faster than loading creating new Object for each request with CGI.
    * Servlets and platform and system independent, the web application developed with Servlet can be run on any standard web container such as Tomcat, JBoss, Glassfish servers and on operating systems such as Windows, Linux, Unix, Solaris, Mac etc.
    * Servlets are robust because container takes care of life cycle of servlet and we don’t need to worry about memory leaks, security, garbage collection etc.
    * Servlets are maintainable and learning curve is small because all we need to take care is business logic for our application.





Client - Its request something request. That request called HTTP request. HTTP is protocol. everything via web. So this request called HTTP request. Ex: Web Browser

Server= Its a machine serve the request which made by client. its responsible for response.The server search the request page stored in repository. Then server picks one of the static page from repository and provide the reponse to the client. This is called HTTP response. Everything via web so its called HTTP response.


Key elements of HTTP Request

-> HTTP Method (Action to be performed) ( Get() or Post())
-> The Page to access(a URL) (Ex. gmail.com)
-> Form Parameters -> what ever you send across server along with request is called Form Parameters.(Ex; user name and password)


Key elements of HTTP Response

-> Status code( whether the request success or not. ex Status code 200- sucessful, 401 - unsuccessful)
-> Content type (this for what kind of content type (type of file)server respond to client. so that client working accordingly. if content type is .jar, so browser (client) says to save the file to user)
-> content (server sent actual content file. Ex: .Jar file)



when the servlet comes into picture?

-> Normally web server provide the reponse only form of static page. its not in dynamic page.
(Login yahoo page is static page for all user. so this is static page. But we have inbox page differently for every users.so this is dynamic page.
-> client need dynamic content always. so servlet handle this request.Servlet is form of java class, but without main()


what is Web container (serve Engine)?

-> The web server always provide the static page. Its not have the capable to provide the response for dynamic pages. So web server provide the dynamic web pages with help of the servlet. So we need communication between web browser and servlet. The web container(Web Engine) provide interface between and provide the communication between web browser and servlet.


Client --> Get(request) -> Web Browser -> <- Web container -> <- servlet

-> The servlet lives in web container always. Web container is responsible for invoking methods in servlet.

-> Normally the client send the request to web browser -> wen browser send request to web container -> the web container is decide which servlet needs to be invoked to provide the response.



How the web container handle a request?

-> The client send the HTTP request to the web browser then the web browser send HTTP request to the web container.
-> Here the web container should not send same HTTP request to servlet. Becasue the sevlet is java program. its understand only object, not HTTP request.
-> so web container change the HTTP request to request object and responnse object and form the seperate thread for each and every HTTP request.
-> Then web container is responsible for which method we need to invoke in the servlet. its may doGet() or doPost().
-> we write the code and all buisness logic in doPost and doGet() for create the dynamic web pages. sevlet the prcoess according to create the code in doPost() and doGet() to create dynamic webpage.
-> Then finally the servlet send the response object into the web container. Then web container change the response object into HTTP request and send to the web browser.
-> So web container is have below two responsible    
    a) invoke the method in servlet
    b) provide communication between server and servlet.


Roles of web container:

Jsp and servlets ar live and die with in web container.


-> Communication Support - provide communication between server and servelt
-> lifecycle management -> its call method in servelt (init(), destroy())
-> Multi threading support - > For every request its form as thread to servlet.
-> Security-> client cannot contact with servelt deirectly. we can give number of security in web container.So valid request only goes to servlet.
-> JSP support


How container knows which servlets needs to be invoked

-> We hav the file web.xml is called web container. This is also called Deployment Descriptor.
-> The all servlet should have entry in this web.xml file. its have below format

<web-app>
    <servlet>
        <servlet-name>login_serv</servlet-name>
        <servlet-class>com.login</servlet-class>
    </servlet>
   
    <servlet-mapping>
        <servlet-name>login_serv</servlet-name>
        <url-pattern>/logon</url-pattern>
    </servlet-mapping>
</web-app>

-> its identify the servlet by using below method
  a) client send the URL pattern for all page. Ex:gmil/logon. here /logon is url pattern send by client.
  b) using <servlet-mapping> tag its identify the servlet name with match with url pattern.
  c) Then its find the servlet name in <servlet> and execute the mehod present in servlets.