keskiviikko 29. lokakuuta 2014

Selenium Web Browser Automation

"Selenium automates browsers. That's it! What you do with that power is entirely up to you. Primarily, it is for automating web applications for testing purposes, but is certainly not limited to just that. Boring web-based administration tasks can (and should!) also be automated as well."


1. Go to http://www.seleniumhq.org/download/ and Download latest released version .XPI file.
2. Run it
3. To open selenium in Firefox click this icon

 
4. Navigate to the site you want to automate.
5. To start recording click the red recording button.


6. Complete required test steps in browser and finally stop recording by pressing the same button again.
7. Save your selenium case.


sunnuntai 5. lokakuuta 2014

We needed a test case form in a school case because we don't have any testing program. I designed this test case form quickly. This can be used in software testing.

Testcase
UsecaseUC01UserSoda buyer
PreconditionUser has found vending machinePost-conditionCoca-cola achieved
Automatedyes/noTest case statusReady
Test designernameDate15.9.2014
Test namenameTest ID
PriorityHigh / middle / lowTester namename
ApplicationFor example java classTest case statusnot completed
Description
General description what will be tested. In this example test case user buys coca-cola from vending machine.
Job phaseDescriptionExpected outcomeTest report
1Walk to soda machineSoda machine foundOK/Fail/not completed
2Insert money to vending machineMoney inserted and vending machine accepted moneyOK
3Select product and press buttonCoca-cola falls to slotFail
jneGrab coca-colaCoca-cola achievecNot completed
DefectDescriptionComments
Job phase3
Coca-cola didn't drop to slot
I smashed the whole wending machine
Noticed byname
SeverityHigh/Middle/low
Datedate
Tester namename
StatusNew/Fixed
PriorityHigh/Middle/Low

keskiviikko 24. syyskuuta 2014

Read MySQL with graphical user interface (Windows, Linux) HeidiSQL

In this post we are going to read database with graphical user interface from my personal server which is running MySQL. I need to connect through ssh because the server doesn't accept root login. Tool used is called HeidiSQL. 

HeidiSQL is a useful and reliable tool designed for web developers using the popular MySQL server, Microsoft SQLdatabases and PostgreSQL. It enables you to browse and edit data, create and edit tables, views, procedures, triggers and scheduled events.

Download HeidiSQL from http://www.heidisql.com/download.php (works with Windows, Linux and Mac)

Install it and then download "PLINK.EXE" from: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

Open HeidiSQL and click new session button.

Set plink.exe location where you downloaded it. 

If connecting over ssh (no root access for example) set ssh host address and port, username and password.


In settings tab put hostname as localhost, user root and MySQL password. Port is the SQL port. 3306 should be default. 


Now save and connect. If you see your MySQL tables connection is successful.


If you server permits root login, then you can skip ssh tab and enter information straight to the connection tab.

UPDATE:

For Linux users I recommend workbench over heidisql: https://www.mysql.com/products/workbench/ 

tiistai 13. toukokuuta 2014

Software developing - Sequence diagram

I don't know much about PHP programming, but this sequence diagram is very high level and demonstrates how data is fetched from MySQL database to front end. The main idea for this diagram is to show how simple it is to create sequence diagram. (I may be wrong) More from wikipedia: http://en.wikipedia.org/wiki/Sequence_diagram


tiistai 6. toukokuuta 2014

Software developing - Definition

Software developing process always starts from business persons view. Business person first defines how the program should work and what they want it to do. After that use cases are identified. Use case describes step by step how process should work. It can also describe data flow between system without human interaction. "In software and systems engineering, a use case is a list of steps, typically defining interactions between a role (known in Unified Modeling Language (UML) as an "actor") and a system, to achieve a goal. The actor can be a human or an external system."

Read more: http://en.wikipedia.org/wiki/Use_case

Here is example use case template how to do an order from web-shop.

Use case template

CONTENTS


Name documents like this: UC_Name.doc. Please note that UC is short for ‘Use case, put UC in the beginning for the sake of consistency.

Use case name
Frequency of use
<UC number>
12
Place Order
<times per day for example>500

Brief description
<Short description (one or two sentences) of what takes place>
After the user has selected items to purchase and then order the items. The user will provide payment and shipping information. The system will respond with confirmation of the order and a tracking number that the user can use to check on order status in the future. The system will also provide the user with an estimated delivery date for the order, which will include all selected items. The user may already have an account with the company with billing and shipping information.

1                                  Actors

User role
User rights
<User roles that participate in this use case.>
Registered Shopper
Has an existing account, possibly with billing and shipping information)
Non-registered Shopper
Does not have an existing account
Fulfillment System
(processes orders for delivery to customers)
Billing System
bills customers for orders that have been placed

2                                  Triggers (Not mandatory step)

The user indicates that she wants to purchase items that she has selected.

3                                  Preconditions

Describe what is already known at the beginning of the use case and what must have been done before.


Precondition
User has selected the items to be purchased.

4                                  Post-conditions

Describe what the result is both from the user’s and the system’s viewpoint.

Description
The order will be placed in the system.
The user will have a tracking ID for the order.
The user will know the estimated delivery date for the order.

5                                  Functional description

Normal flow for the case

Description
<Verbal description of use case step by step>
1.      The user will indicate that she wants to order the items that have already been selected.
2.      The system will present the billing and shipping information that the user previously stored.
3.      The user will confirm that the existing billing and shipping information should be used for this order.
4.      The system will present the amount that the order will cost, including applicable taxes and shipping charges.
5.      The user will confirm that the order information is accurate.
6.      The system will provide the user with a tracking ID for the order.
7.      The system will submit the order to the fulfillment system for evaluation.
8.      The fulfillment system will provide the system with an estimated delivery date.
9.      The system will present the estimated delivery date to the user.
10.   The user will indicate that the order should be placed.
11.   The system will request that the billing system should charge the user for the order.
12.   The billing system will confirm that the charge has been placed for the order.
13.   The system will submit the order to the fulfillment system for processing.
14.   The fulfillment system will confirm that the order is being processed.
15.   The system will indicate to the user that the user has been charged for the order.
16.   The system will indicate to the user that the order has been placed.
17.   The user will exit the system.

 Step by step

Identifier
Step by step
P1



6                                  Alternative flows

Enter here any alternative sequence of events. As an identifier for these, use ‘A’.

Identifier
Alternative
<A1, A2>
3A1: The user enters billing and shipping information for the order. The user desires to use shipping and billing information that differs from the information stored in her account. This alternate flow also applies if the user does not maintain billing and / or shipping information in their account, or if the user does not have an account.
The user will indicate that this order should use alternate billing or shipping information.
The user will enter billing and shipping information for this order.
The system will validate the billing and shipping information.
The use case continues
5A1: The user will discover an error in the billing or shipping information associated with their account, and will change it.
The user will indicate that the billing and shipping information is incorrect.
The user will edit the billing and shipping information associated with their account.
The system will validate the billing and shipping information.
The use case returns to step 2 and continues.
5A2: The user will discover an error in the billing or shipping information that is uniquely being used for this order, and will change it.
The user will indicate that the billing and shipping information is incorrect.
The user will edit the billing and shipping information for this order.
The use case returns to step 3A1 step 3.
10A1: The user will determine that the order is not acceptable (perhaps due to disatisfaction with the estimated delivery date) and will cancel the order.
The user will request that the order be cancelled.
The system will confirm that the order has been cancelled.
The use case ends.

7                                  Exceptions

Enter here exceptions to the use case, such as error situations. As an identifier for exceptions, use 'E’.

Identifier
Exception
<E1, E2>
 <System exception>


8                                  Additional information

Identifier
Additional information
Reference
<Ai1, Ai2>
<Additional information>




9                                  Open issues

Identifier
Open issue
Reference
<OI1, OI2>
<Open issues that still have to be solved.>




10                               Change history

Version
Date
Change
Change made by