Archive for December, 2012

Different methods to locate UI Elements (WebElements) or Object Recognize Methods:

There are different methods to locate UI Elements (WebElements) or to recognize objects which are as follows:
· By ID
· By Tag Name
· By Class Name
· By Link Text
· By Name
· By Partial Link Text
· By XPATH

By ID:

This method is most efficient and mostly used to locate the elements. Every element has its unique id.

Let’s take the example for Google, suppose we have to find/locate the search box of goggle. Use firebug option of Mozilla Firefox with which you can easily locate the element in HTML format. Please refer following screenshot:

<td id=”gs_tti0″ class=”gsib_a”>

Id of Search box of goggle is gs_tti0.

Now Example for how to find an element via using ID:

WebElement element = driver.findElement(By.id(“gs_tti0”));

 By Tag Name:

To find tag name of a use fire bug.

Let’s take the example for Google, suppose we have to find/locate the “Google Search” button of goggle via tag name. Use firebug option of Mozilla Firefox with which you can easily locate the element in HTML format. Please refer following screenshot:

<input type=”submit” onclick=”this.checked=1″ name=”btnK” value=”Google Search”/>

Tag Name of Google Search” button of goggle is input here.

Now Example for how to find an element via using TagName:

WebElement element = driver.findElement(By.tagName("input"));

By Class Name:

There may be many elements that are associated with same class name so finding multiple elements becomes the more practical option over finding the first element.

Example of how to find an element that looks like this:

<div class=”tsf-p” style=”position:relative”>

Here tsf-p is classname.

List<WebElement> element = driver.findElements(By.className("tsf-p "))
Remember that use findElements method instead of findElement to find multiple elements.

 By Link Text:

By using By Link Text method of class “By “you can find link element with matching visible text.

Let’s take the example for Google, suppose you want to find/locate the “Advertising Programs” link of goggle via Link Text.

Now Example for how to find an element i.e. link via using linkText:

WebElement element = driver.findElement(By.linkText("Advertising Programs"));

By Name:

By using By Name method of class “By “you can find link element via name attribute of element.

Example of how to find an element that looks like this:

<input type=”submit” onclick=”this.checked=1″ name=”btnK” value=”Google Search”>

Here” btnK” is name.

List<WebElement> element = driver.findElements(By.name("btnK "))

By Partial Link Text:

By using “BypartialLinkText” method of class “By “you can find link element with Partial matching visible text.

Let’s take the example for Google, suppose you want to find/locate the “Advertising Programs” link of goggle via BypartialLinkText. For this you can use:

WebElement element = driver.findElement(By. partialLinkText ("Advertising"));

 By XPATH:

Xpath is a locator, it is an unique address which identifies each and every element.WebDriver uses a browser’s native XPath capabilities wherever possible. To find xpath of an element use firebug and fire path adons on Mozilla Firefox.

Let’s take the example for Google, suppose we have to find/locate the search box of goggle via using xpath. Use firebug option of Mozilla Firefox with which you can easily locate the element in HTML format and copy the xpath from xpath bar of firepath tab.Please refer following screenshot:

Now Example for how to find an element via using xpath:

WebElement element = driver.findElement(By.xpath("//*[@id='gs_tti0']"));
 Note: Don’t copy the dot from xpath bar.

 

English: System Life Cycle as taught in the AQ...

Systems Development Life Cycle (SDLC):

The systems development life cycle (SDLC) is a conceptual model used in project management that describes the stages involved in an information system development project. o manage this, a number of system development life cycle (SDLC) models have been created: waterfall, fountain, spiral, build and fix, rapid prototyping, incremental etc.

Stages or different phases of SDLC are mentioned below:

  • Project planning, feasibility study
  • Systems analysis, requirements definition
  • Systems design
  • Implementation
  • Integration and testing
  • Acceptance, installation, deployment
  • Maintenance

Project planning, feasibility study: Establishes a high-level view of the intended project and determines its goals.

Systems analysis, requirements definition: Refines project goals into defined functions and operation of the intended application. Analyzes end-user information needs.

Systems design: Describes desired features and operations in detail, including screen layouts, business rules, process diagrams, pseudo code and other documentation.

Implementation: Coding is written by developers in this phase.

Integration and testing: Brings all the pieces together into a special testing environment, then checks for errors, bugs and interoperability.

Acceptance, installation, deployment: The final stage of initial development, where the software is put into production and runs actual business.

Maintenance: What happens during the rest of the software’s life: changes, correction, additions, and moves to a different computing platform and more? This, the least glamorous and perhaps most important step of all, goes on seemingly forever.

Waterfall Model:

The waterfall model is a sequential software development model in which development is seen as flowing steadily downwards (like a waterfall) through several phases.

Waterfall model was meant to function in a systematic way that takes the production of the software from the basic step going downwards towards detailing just like a Waterfall which begins at the top of the cliff and goes downwards but not backwards.

Different Phases of Waterfall Model:

Definition Study / Analysis: During this phase research is being conducted which includes brainstorming about the software, what it is going to be and what purpose is it going to fulfill.

Basic Design: If the first phase gets successfully completed and a well thought out plan for the software development has been laid then the next step involves formulating the basic design of the software on paper.

Technical Design / Detail Design:  After the basic design gets approved, then a more elaborated technical design can be planned. Here the functions of each of the part are decided and the engineering units are placed for example modules, programs etc.

Construction / Implementation: In this phase the source code of the programs is written.Testing: At this phase, the whole design and its construction is put under a test to check its functionality. If there are any errors then they will surface at this point of the process.

Integration: in the phase of Integration, the company puts it in use after the system has been successfully tested.Management and Maintenance: Maintenance and management is needed to ensure that the system will continue to perform as desired.

Advantages of Waterfall Model:

  • Waterfall model is simple to implement and also the amount of resources required for it are minimal.
  • This methodology is preferred in projects where quality is more important as compared to schedule or cost.
  • Documentation is produced at every stage of the software’s development. This makes understanding the product designing procedure, simpler.
  • After every major stage of software coding, testing is done to check the correct running of the code.

 Disadvantages of Waterfall Iterative Model:

  •  Real projects rarely follow the sequential flow and iterations in this model are handled indirectly. These changes can cause confusion as the project proceeds.
  •  In this model we freeze software and hardware. But as technology changes at a rapid pace, such freezing is not advisable especially in long-term projects.
  • Even a small change in any previous stage can cause big problem for subsequent phases as all phases are dependent on each-other.
  • Going back a phase or two can be a costly affair.