Thứ Tư, 22 tháng 8, 2018


  • Tap – Quick touch in a given place
  • Double Tap – 2 quick, sequential taps in a given place
  • Transform -Scaling or rotating with 2 fingers
  • Transform Start – Finger contact that initiates the transform action
  • Transform End – Finger contact that ends the transform action
  • Swipe – Directional move with high end velocity
  • Swipe Up – Upward move with high end velocity
  • Swipe Down – Downward move with high end velocity
  • Swipe Left – Leftward move with high end velocity
  • Swipe Right – Rightward move with high end velocity
  • Drag Start – The start of a swipe gesture that takes longer than the standard threshold of time
  • Drag End – The end of a swipe gesture that takes longer than the standard threshold of time
  • Drag Up – Upward drag
  • Drag Down – Downward drag
  • Drag Left – Leftward drag
  • Drag Right – Rightward drag
  • Hold – A sustained complete touch event
  • Release – Ending a complete touch event and letting go
  • Rotate – 2 finger, angular transformation of the page content
  • Pinch – Multifinger increase/decrease of scale
  • Pinch In – Multifinger decrease of scale
  • Pinch Out – Multifinger increase of scale
  • Touch – Initial contact with screen
https://vntesters.com/wp-content/uploads/2016/09/TouchGestureGuide.pdf
https://vntesters.com/wp-content/uploads/2016/09/TouchGestureCards.pdf
Ebook:
 “Foundation of software testing – 207 pages”
“ISTQB Glossary of testing Terms 2 1 – 43 pages” 
- “ISTQB Foundation Level Syllabus 2011 – 78 pages” 

Question 1 What is a key characteristic of specification-based testing techniques?
a. Tests are derived from information about how the software is constructed.
b. Tests are derived from models (formal or informal) that specify the problem to be solved by the software or its components.
c. Tests are derived based on the skills and experience of the tester.
d. Tests are derived from the extent of the coverage of structural elements of the system or components.
Question 2 An exhaustive test suite would include:
a. All combinations of input values and preconditions.
b. All combinations of input values and output values.
c. All pairs of input value and preconditions.
d. All states and state transitions.
Question 3 Which statement about testing is true?
a. Testing is started as early as possible in the life cycle.
b. Testing is started after the code is written so that we have a system with which to work.
c. Testing is most economically done at the end of the life cycle.
d. Testing can only be done by an independent test team.
Question 4 For a test procedure that is checking modifications of customers on a database, which two steps below would be the lowest priority if we didn’t have time to execute all of the steps?
1 Open database and confirm existing customer
2 Change customer’s marital status from single to married
3 Change customer’s street name from Parks Road to Park Road
4 Change customer’s credit limit from 500 to 750
5 Replace customer’s first name with exactly the same first name
6 Close the customer record and close the database
a. Tests 1 and 4
b. Tests 2 and 3
c. Tests 5 and 6
d. Tests 3 and 5
Question 5 Consider the following list of either product or project risks
I An incorrect calculation of fees might shortchange the organization.
II A vendor might fail to deliver a system component on time.
III A defect might allow hackers to gain administrative privileges.
IV A skills gap might occur in a new technology used in the system.
V A defect-prioritization process might overload the development team.
Which of the following statements is true?
a. I is primarily a product risk and II, III, IV and V are primarily project risks.
b. II and V are primarily product risks and I, III and V are primarily project risks.
c. I and III are primarily product risks, while II, IV and V are primarily project risks.
d. Ill and V are primarily product risks, while I, II and IV are primarily project risks.
Question 6 Consider the following statements about regression tests:
I They may usefully be automated if they are well designed.
II They are the same as confirmation tests (re-tests).
III They are a way to reduce the risk of a change having an adverse effect elsewhere in the system.
IV They are only effective if automated. Which pair of statements is true?
a. I and II
b. I and III
c. II and III
d. II and IV
Question 7 Which of the following could be used to assess the coverage achieved for structure-based (white-box) test techniques?
V Decision outcomes exercised
W Partitions exercised
X Boundaries exercised
Y Conditions or multiple conditions exercised
Z Statements exercised
a. V, W or Y
b. W, X or Y
c. V, Y or Z
d. W, X or Z
Question 8 Review the following portion of an incident report.
1 I place any item in the shopping cart.
2 I place any other (different) item in the shopping cart.
3 I remove the first item from the shopping cart, but leave the second item in the cart.
4 I click the < Checkout > button.
5 I expect the system to display the first checkout screen. Instead, it gives the pop-up error message, ‘No items in shopping cart. Click <Okay> to continue shopping.’
6 I click < Okay >.
7 I expect the system to return to the main window to allow me to continue adding and removing items from the cart. Instead, the browser terminates.
8 The failure described in steps 5 and 7 occurred in each of three attempts to perform steps 1,2,3,4 and 6.
Assume that no other narrative information is included in the report. Which of the following important aspects of a good incident report is missing from this incident report?
a. The steps to reproduce the failure.
b. The summary.
c. The check for intermittence.
d. The use of an objective tone.
Question 9 Which of the following are benefits and which are risks of using tools to support testing?
1 Over-reliance on the tool
2 Greater consistency and repeatability
3 Objective assessment
4 Unrealistic expectations
5 Underestimating the effort required to maintain the test assets generated by the tool
6 Ease of access to information about tests or testing
7 Repetitive work is reduced
a. Benefits: 3,4,6 and 7. Risks: 1,2 and 5
b. Benefits: 1,2,3 and 7, Risks: 4,5 and 6
c. Benefits: 2,3,6 and 7. Risks: 1,4 and 5
d. Benefits: 2,3,5 and 6. Risks: 1,4 and 7
Question 10 Which of the following encourages objective testing?
a. Unit testing
b. System testing
c. Independent testing
d. Destructive testing
Question 11 Of the following statements about reviews of specifications, which statement is true?
a. Reviews are not generally cost effective as the meetings are time consuming and require preparation
and follow up.
b. There is no need to prepare for or follow up on reviews.
c. Reviews must be controlled by the author.
d. Reviews are a cost effective early static test on the system.
Question 12 Consider the following list of test process activities:
I Analysis and design
II Test closure activities
III Evaluating exit criteria and reporting
IV Planning and control
V Implementation and execution
Which of the following places these in their logical sequence?
a. I, II, III, IV and V
b. IV, I, V, III and II.
c. IV, I, V,II and III.
d. I, IV, V HI and II.
Question 13 Test objectives vary between projects and so must be stated in the test plan. Which one of the following test objectives might conflict with the proper tester mindset?
a. Show that the system works before we ship it.
b. Find as many defects as possible.
c. Reduce the overall level of product risk.
d. Prevent defects through early involvement.
Question 14 Which test activities are supported by test data preparation tools?
a. Test management and control
b. Test specification and design
c. Test execution and logging
d. Performance and monitoring
Question 15 If you are flying with an economy ticket, there is a possibility that you may get upgraded to business class, especially if you hold a gold card in the airline’s frequent flyer program. If you don’t hold a gold card, there is a possibility that you will get ‘bumped’ off the flight if it is full and you checking in late. This is shown in Figure 7.1. Note that each box (i.e. statement) has been numbered.
http://prntscr.com/f8pm5t
Three tests have already been run:
Test 1: Gold card holder who gets upgraded to business class
Test 2: Non-gold card holder who stays in economy
Test 3: A person who is bumped from the flight
What additional tests would be needed to achieve 100% decision coverage?
a. A gold card holder who stays in economy and a non-gold card holder who gets upgraded to business class.
b. A gold card holder and a non-gold card holder who are both upgraded to business class.
c. A gold card holder and a non-gold card holder who both stay in economy class.
d. A gold card holder who is upgraded to business class and a non-gold card holder who stays in
economy class.
Question 16 Consider the following types of tools:
V Test management tools
W Static analysis tools
X Modeling tools
Y Dynamic analysis tools
Z Performance testing tools
Which of the following of these tools is most likely to be used by developers?
a. W, X and Y
b. V, Y and Z
c. V, W and Z
d. X,Y and Z
Question 17 What is a test condition?
a. An input, expected outcome, precondition and post condition
b. The steps to be taken to get the system to a given point
c. Something that can be tested
d. A specific state of the software, e.g. before a test can be run
Question 18 Which of the following is the most important difference between the metrics-based approach and the expert-based approach to test estimation?
a. The metrics-based approach is more accurate than the expert-based approach.
b. The metrics-based approach uses calculations from historical data while the expert-based approach relies on team wisdom.
c. The metrics-based approach can be used to verify an estimate created using the expert-based
approach, but not vice versa.
d. The expert-based approach takes longer than the metrics-based approach.
Question 19 If the temperature falls below 18 degrees, the heating is switched on. When the Temperature reaches 21 degrees, the heating is switched off. What is the minimum set of test input values to cover all valid equivalence partitions?
a. 15,19 and 25 degrees
b. 17,18,20 and 21 degrees
c. 18,20 and 22 degrees
d. 16 and 26 degrees
Question 20 Which of these statements about functional testing is true?
a. Structural testing is more important than functional testing as it addresses the code.
b. Functional testing is useful throughout the life cycle and can be applied by business analysts, testers, developers and users.
c. Functional testing is more powerful than static testing as you actually run the system and see what happens.
d. Inspection is a form of functional testing.

Thứ Bảy, 27 tháng 8, 2016

We follow these principles:

1. Our highest priority is to satisfy the customer
through early and continuous delivery
of valuable software.

2. Welcome changing requirements, even late in
development. Agile processes harness change for
the customer's competitive advantage.

3. Deliver working software frequently, from a
couple of weeks to a couple of months, with a
preference to the shorter timescale.

4. Business people and developers must work
together daily throughout the project.

5. Build projects around motivated individuals.
Give them the environment and support they need,
and trust them to get the job done.

6. The most efficient and effective method of
conveying information to and within a development
team is face-to-face conversation.

7. Working software is the primary measure of progress.
8. Agile processes promote sustainable development.
The sponsors, developers, and users should be able
to maintain a constant pace indefinitely.

9. Continuous attention to technical excellence
and good design enhances agility.

10. Simplicity--the art of maximizing the amount
of work not done--is essential.

11. The best architectures, requirements, and designs
emerge from self-organizing teams.

12. At regular intervals, the team reflects on how
to become more effective, then tunes and adjusts
its behavior accordingly.

Thứ Tư, 17 tháng 8, 2016

1. Download SourceTree link https://www.sourcetreeapp.com/download/

2. Create account github link https://github.com/

3. Create account bitbucket link bitbucket.org

4. Setup Source code

5. Use SourceTree

GitHub:



SourceTree:




Thứ Hai, 1 tháng 8, 2016

1.Function testing (test chức năng): là test các chức năng, module theo tài liệu khách hàng.
Hay Kiểm thử chức năng là một loại kiểm thử hộp đen (black box) và test case của nó được dựa trên đặc tả của ứng dụng phần mềm/thành phần đang test. Các chức năng được test bằng cách nhập vào các giá trị nhập và kiểm tra kết quả đầu ra, và ít quan tâm đến cấu trúc bên trong của ứng dụng (không giống như kiểm thử hộp trắng - white-box testing).

2.Intergration testing (Kiểm tra tích hợp):  test khi 2 hoặc nhiều module, chức năng được tích hợp lại với nhau. Test về cả back end & front end theo tài liệu khách hàng và thao tác user.

Integration Test có 4 loại:

·  Kiểm tra cấu trúc (structure): tương tự White Box Test (kiểm tra nhằm bảo đảm các thành phần bên trong của một chương trình chạy đúng), chú trọng đến hoạt động của các thành phần cấu trúc nội bên trong của chương trình chẳng hạn các lệnh và nhánh bên trong.
·  Kiểm tra chức năng (functional): tương tự Black Box Test (kiểm tra chỉ chú trọng đến chức năng của chương trình, không quan tâm đến cấu trúc bên trong), chỉ khảo sát chức năng của chương trình theo yêu cầu khách hàng.
·        Kiểm tra hiệu năng (performance): Kiểm tra việc vận hành của hệ thống.
·        Kiểm tra khả năng chịu tải (stress): Kiểm tra các giới hạn của hệ thống.


3.System testing: kiểm tra thiết kế và toàn bộ hệ thống (sau khi tích hợp hay intergration test) có thỏa mãn yêu cầu đặt ra hay không.
System Test bắt đầu khi tất cả các bộ phận của PM đã được tích hợp thành công. Thông thường loại kiểm tra này tốn rất nhiều công sức và thời gian. Trong nhiều trường hợp, việc kiểm tra đòi hỏi một số thiết bị phụ trợ, phần mềm hoặc phần cứng đặc thù, đặc biệt là các ứng dụng thời gian thực, hệ thống phân bổ, hoặc hệ thống nhúng. Ở mức độ hệ thống, người kiểm tra cũng tìm kiếm các lỗi, nhưng trọng tâm là đánh giá về hoạt động, thao tác, sự tin cậy và các yêu cầu khác liên quan đến chất lượng của toàn hệ thống.

Điểm khác nhau then chốt giữa Integration Test và System Test :

  • System test chú trọng các hành vi và lỗi trên toàn hệ thống,
  • Integration test chú trọng sự giao tiếp giữa các đơn thể hoặc đối tượng khi chúng làm việc cùng nhau.

Thông thường ta phải thực hiện function test và integration test để bảo đảm mọi function và sự tương tác giữa chúng hoạt động chính xác trước khi thực hiện system Test.
-Sau khi hoàn thành Integration Test,  1 hệ thống PM đã được hình thành cùng với các thành phần đã được kiểm tra đầy đủ. Bắt đầu thực hiện test PM như một hệ thống hoàn chỉnh. Việc lập kế hoạch cho System Test nên bắt đầu từ giai đoạn hình thành và phân tích các yêu cầu.
-System Test  kiểm tra cả các hành vi chức năng của phần mềm lẫn các yêu cầu về chất lượng như độ tin cậy, tính tiện lợi khi sử dụng, hiệu năng và bảo mật. Mức kiểm tra này đặc biệt thích hợp cho việc phát hiện lỗi giao tiếp với PM hoặc phần cứng bên ngoài, chẳng hạn các lỗi “tắc nghẽn” (deadlock) hoặc chiếm dụng bộ nhớ.

System test gồm:

  • Kiểm tra chức năng (Functional Test): bảo đảm các hành vi của hệ thống thỏa mãn đúng yêu cầu thiết kế.
  • Kiểm tra khả năng vận hành (Performance Test): bảo đảm tối ưu việc phân bổ tài nguyên hệ thống (ví dụ bộ nhớ) nhằm đạt các chỉ tiêu như thời gian xử lý hay đáp ứng câu truy vấn…
  • Kiểm tra khả năng chịu tải (Stress Test hay Load Test): bảo đảm hệ thống vận hành đúng dưới áp lực cao (ví dụ nhiều người truy xuất cùng lúc). Stress Test tập trung vào các trạng thái tới hạn, các “điểm chết”, các tình huống bất thường…
  • Kiểm tra cấu hình (Configuration Test)
  • Kiểm tra khả năng bảo mật (Security Test): bảo đảm tính toàn vẹn, bảo mật của dữ liệu và của hệ thống.
  • Kiểm tra khả năng phục hồi (Recovery Test): bảo đảm hệ thống có khả năng khôi phục trạng thái ổn định trước đó trong tình huống mất tài nguyên hoặc dữ liệu; đặc biệt quan trọng đối với các hệ thống giao dịch như ngân hàng trực tuyến.
Nhìn từ quan điểm người dùng, các kiểm tra trên rất quan trọng: bảo đảm hệ thống đủ khả năng làm việc trong môi trường thực.

4. Acceptance Test - Kiểm tra chấp nhận sản phẩm
Sau giai đoạn System Test là Acceptance Test, được khách hàng thực hiện (hoặc ủy quyền cho một nhóm thứ ba thực hiện).

Mục đích của Acceptance Test là để chứng minh PM  thỏa mãn tất cả yêu cầu của khách hàng và khách hàng chấp nhận sản phẩm (và trả tiền thanh toán hợp đồng).

Acceptance Test có ý nghĩa hết sức quan trọng, mặc dù trong hầu hết mọi trường hợp, các phép kiểm tra của System Test và Accepatnce Test gần như tương tự, nhưng bản chất và cách thực hiện lại rất khác biệt.

Đối với những sản phẩm dành bán rộng rãi trên thị trường cho nhiều người sử dụng, thông thường sẽ thông qua hai loại kiểm tra gọi là Alpha test và Beta test.

  • Alpha test, người sử dụng (tiềm năng) kiểm tra PM ngay tại nơi PTPM, lập trình viên sẽ ghi nhận các lỗi hoặc phản hồi, và lên kế hoạch sửa chữa.
  • Beta test, PM sẽ được gửi tới cho người sử dụng (tiềm năng) để kiểm tra ngay trong môi trường thực, lỗi hoặc phản hồi cũng sẽ gửi ngược lại cho lập trình viên để sửa chữa.
Thực tế cho thấy, nếu khách hàng không quan tâm và không tham gia vào quá trình PTPM thì kết quả Acceptance Test sẽ sai lệch rất lớn, mặc dù PM đã trải qua tất cả các kiểm tra trước đó. Sự sai lệch này liên quan đến việc hiểu sai yêu cầu cũng như sự mong chờ của khách hàng. Ví dụ đôi khi một PM xuất sắc vượt qua các phép kiểm tra về chức năng thực hiện bởi nhóm thực hiện dự án, nhưng khách hàng khi kiểm tra sau cùng vẫn thất vọng vì bố cục màn hình nghèo nàn, thao tác không tự nhiên, không theo tập quán sử dụng của khách hàng v.v…

Gắn liền với giai đoạn Acceptance Test thường là một nhóm những dịch vụ và tài liệu đi kèm, phổ biến như hướng dẫn cài đặt, sử dụng v.v… Tất cả tài liệu đi kèm phải được cập nhật và kiểm tra chặt chẽ.

5. Regression Test - Kiểm tra hồi quy
Regression test không phải là một mức kiểm tra, như các mức khác đã nói ở trên. Nó đơn thuần kiểm tra lại PM sau khi có một sự thay đổi xảy ra, để bảo đảm phiên bản PM mới thực hiện tốt các chức năng như phiên bản cũ và sự thay đổi không gây ra lỗi mới trên những chức năng vốn đã làm việc tốt.

Regression test là một trong những loại kiểm tra tốn nhiều thời gian và công sức nhất. Bỏ qua Regression Test là “không được phép” vì có thể dẫn đến tình trạng phát sinh hoặc tái xuất hiện những lỗi nghiêm trọng, mặc dù ta “tưởng rằng” những lỗi đó hoặc không có hoặc đã được kiểm tra và sửa chữa rồi!


Thứ Hai, 23 tháng 3, 2015

- Open: Open a URL. url – the URL to open; may be relative or absolute
– Assert: Title
Check the title of a web page.
the title to check
– Click and Wait: Click on a link and wait for the page to load
locator – an element locator
– Click: Click on a link in the page.
locator – an element locator
– Type: Type content into a entry box on the web page.
locator – an element locator
value – the value to type
– Wait: Wait for a number of seconds
time – time to wait in seconds
Capture Screenshot Capture a screenshot of the current page.
– Add Selection: Add a selection to the set of selected options in a multi-select element using an option locator.
locator – an element locator identifying a multi-select box
optionLocator – an option locator (a label by default)
– Alt Key Down: Press the alt key and hold it down until ALTKEYUP is called or a new page is loaded.
– Alt Key Up: Release the alt key.
Answer on Next Prompt
Return the specified answer string in response to the next JavaScript prompt. answer – the answer to give in response to the prompt pop-up
– Check: Check a toggle-button (checkbox/radio). locator – an element locator
– Click At: Clicks on a link, button, checkbox or radio button.
locator – an element locator
coordString – specifies the x,y position (i.e. – 10,20) of the mouse event relative to the element returned by the locator.
Close Simulates the user clicking the “close” button in the titlebar of a popup window or tab.
– Control Key Down: Press the control key and hold it down until doControlUp() is called or a new page is loaded.
– Control Key Up: Release the control key.
– Double Click: Double clicks on a link, button, checkbox or radio button.
locator – an element locator
– Double Click At: Doubleclicks on a link, button, checkbox or radio button.
locator – an element locator
coordString – specifies the x,y position (i.e. – 10,20) of the mouse event relative to the element returned by the locator.
– Drag and Drop: Drags an element a certain distance and then drops it.
locator – an element locator
movementsString – offset in pixels from the current location to which the element should be moved, e.g., “+70,-300″
– Drag and Drop to Object: Drags an element and drops it on another element.
locatorOfObjectToBeDragged – an element to be dragged
locatorOfDragDestinationObject – an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged is dropped
– Get Alert: Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
– Get Confirmation: Retrieves the message of a JavaScript confirmation dialog generated during the previous action.
– Get Prompt: Retrieves the message of a JavaScript question prompt dialog generated during the previous action.
– Go Back: Simulates the user clicking the “back” button on their browser.
Is Text Present Verifies that the specified text pattern appears somewhere on the rendered page shown to the user. the text that should appear on the page
– Key Down: Simulates a user pressing a key (without releasing it yet). locator – an element locator keySequence – Either be a string(“\” followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: “w”, “\119″.
– Key Press: Simulates a user pressing and releasing a key. locator – an element locator keySequence – Either be a string(“\” followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: “w”, “\119″.
– Key Up: Simulates a user releasing a key.
locator – an element locator
keySequence – Either be a string(“\” followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: “w”, “\119″.
– Mouse Down: Simulates a user pressing the mouse button (without releasing it yet) on the specified element. locator – an element locator
– Mouse Down At: Simulates a user pressing the mouse button (without releasing it yet) at the specified location.
locator – an element locator
coordString – specifies the x,y position (i.e. – 10,20) of the mouse event relative to the element returned by the locator.
– Mouse Move: Simulates a user pressing and moving the mouse button (without releasing it yet) on the specified element.
locator – an element locator
– Mouse Move At: Simulates a user pressing and moving the mouse button (without releasing it yet) on the specified element.
locator – an element locator
coordString – specifies the x,y position (i.e. – 10,20) of the mouse event relative to the element returned by the locator.
– Mouse Out: Simulates a user moving the mouse pointer away from the specified element.
locator – an element locator
– Mouse Over: Simulates a user hovering a mouse over the specified element.
locator – an element locator
– Mouse Up: Simulates the event that occurs when the user releases the mouse button (i.e., stops holding the button down) on the specified element. locator – an element locator
– Mouse Up At: Simulates the event that occurs when the user releases the mouse button (i.e., stops holding the button down) at the specified location.
locator – an element locator
coordString – specifies the x,y position (i.e. – 10,20) of the mouse event relative to the element returned by the locator.
– Open Window: Opens a popup window (if a window with that ID isn’t already open).
url – the URL to open, which can be blank windowID
– the JavaScript window ID of the window to select
– Refresh: Simulates the user clicking the “Refresh” button on their browser.
– Select: Select an option from a drop-down using an option locator. locator – an element locator identifying a multi-select box optionLocator – an option locator (a label by default)
– Shift Key Down: Press the shift key and hold it down until SHIFTKEYUP is called or a new page is loaded.
– Shift Key Up: Release the shift key.
– Submit: Submit the specified form.
formLocator – an element locator for the form you want to submit
– Type Keys: Simulates keystroke events on the specified element, as though you typed the value key-by-key.
locator – an element locator
value – the value to type
– Uncheck: Uncheck a toggle-button (checkbox/radio)
locator – an element locator
– Select Frame: Selects a frame within the current window.
locator – an element locator identifying a frame or iframe
– Select Window: Selects a popup window; once a popup window has been selected, all commands go to that window. windowID – the JavaScript window ID of the window to select
– Window Focus: Gives focus to the currently selected window
– Store Alert: Stores the message of the most recent JavaScript alert.
– Cancel On Next: Simulate the user clicking Cancel to the next Confirmation.
– OK On Next: Undo the effect of calling ‘Cancel On Next’.
– Create Cookie: Create a new cookie whose path and domain are same with those of current page under test, unless you specified a path for this cookie explicitly. NameValuePair – name and value of the cookie in a format “name=value” optionsString – options for the cookie. Currently supported options include ‘path’ and ‘max_age’. the optionsString’s format is “path=/path/, max_age=60″. The order of options are irrelevant, the unit of the value of ‘max_age’ is second.
– Delete Cookie: Delete a named cookie with specified path. name – the name of the cookie to be deleted. path – the path property of the cookie to be deleted.
– Meta Key Down: Press the meta key and hold it down until ‘Meta Key Up’ command is called or a new page is loaded.
– Meta Key Up: Release the meta key.
– Pause:Wait for the specified amount of time (in milliseconds).
waitTime – the amount of time to sleep (in milliseconds).
– Set Cursor Position: Moves the text cursor to the specified position in the given input element or textarea. This method will fail if the specified element isn’t an input element or textarea. locator – an element locator pointing to an input element or textarea. position – the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field.
– Set Mouse Speed: Configure the number of pixels between “mousemove” events during dragAndDrop commands (default=10). pixels – the number of pixels between “mousemove” events.
– Set Speed: Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., the delay is 0 milliseconds. value – the number of milliseconds to pause after operation.
– Wait For Frame To Load: Waits for a new frame to load. FrameAddress – FrameAddress from the server side. timeout – a timeout in milliseconds, after which this command will return with an error.
– Wait For Page To Load:
Waits for a new page to load. Timeout – a timeout in milliseconds, after which this command will return with an error.
– Wait For PopUp: Waits for a popup window to appear and load up.
windowID – the JavaScript window ID of the window that will appear. Timeout – a timeout in milliseconds, after which the action will return with an error.
– Assert Text Present: Asserts if the specified text IS NOT present on the page. The text that should appear on the page
– Assert Text Not Present: Asserts if the specified text IS present on the page. The text that should NOT appear on the page
– Verify Text Present: Verifies that the specified text IS present – if it is not, it is an error. The text that should appear on the page
– Verify Text Not Present: Verifies that the specified text IS NOT present – if it is, it is an error. The text that should NOT appear on the page
– Assert Value: Asserts that the value of the specified input field matches the pattern specified.
locator – an element locator pointing to an input element the text or pattern that should appear in the input field
– Assert Not Value: Asserts that the value of the specified input field DOES NOT match the pattern specified.
locator – an element locator pointing to an input element the text or pattern that should NOT appear in the input field
– Verify Value: Verifies that the value of the specified input field matches the pattern specified.
locator – an element locator pointing to an input element
the text or pattern that should appear in the input field
– Verify Not Value: Verifies that the value of the specified input field DOES NOT match the pattern specified.
locator – an element locator pointing to an input element
The text or pattern that should NOT appear in the input field
– Assert Checked: Asserts that the toggle-button is checked.
locator – an element locator pointing to a toggle-button.
– Assert Not Checked: Asserts that the toggle-button is NOT checked.
locator – an element locator pointing to a toggle-button.
– Verify Checked: Verifies that the toggle-button is checked.
locator – an element locator pointing to a toggle-button.
– Verify Not Checked: Verifies that the toggle-button is NOT checked.
locator – an element locator pointing to a toggle-button.
– Assert Tex: Asserts that the text is present at the specific locator.
locator – an element locator pointing to an element that contains text. The text or pattern that should appear
– Assert Not Text: Asserts that the text is NOT present at the specific locator.
locator – an element locator pointing to an element that contains text. the text or pattern that should NOT appear
– Verify Text: Verifies that the text is present at the specific locator.
locator – an element locator pointing to an element that contains text. the text or pattern that should appear
-Verify Not Text: Verifies that the text is NOT present at the specific locator.
locator – an element locator pointing to an element that contains text.
the text or pattern that should NOT appear
– Assert Alert: Asserts that the value of the alert matches the pattern specified.
the pattern that should appear as the alert
– Assert Alert Not Present: Asserts if an alert is not present
– Assert Alert Present: Asserts if an alert is present
– Store Alert Present:Returns if an alert was present or not.
a dummy variable – the value is NOT stored into it
– Verify Alert: Verifies that the value of the alert matches the pattern specified. the pattern that should appear as the alert
– Verify Alert Not Present: Verifies that an alert IS NOT present.
– Verify Alert Present: Verifies that an alert IS present.
– Wait For Alert: Waits for the alert matching the pattern to appear. the pattern that should appear as the alert
– Wait For Alert Not Present: Waits for an alert not present
– Wait For Alert Present: Waits for an alert to be present
– Assert Confirmation: Asserts that the value of the confirmation matches the pattern specified.
the pattern that should appear as the confirmation.
– Assert Confirmation Not Present: Asserts if a confirmation is NOT present.
– Assert ConfirmationPresent: Asserts if a confirmation is present.
– Store Confirmation: Stores the message from the most recent confirmation.
– Store Confirmation Present: Returns if an confirmation was present or not.
a dummy variable – the value is NOT stored into it
– Verify Confirmation: Verifies that the value of the confirmation matches the pattern specified.
the pattern that should appear as the confirmation.
– Verify Confirmation Not Present: Verifies if a confirmation is NOT present.
– Verify Confirmation Present: Verifies if a confirmation is present.
– Wait For Confirmation: Waits for the confirmation matching the pattern to appear. the pattern that should appear as the confirmation.
– Wait For Confirmation Not Present: Waits for a confirmation not to be present.
– Wait For Confirmation Present: Waits for a confirmation to be present.
 Javascript  selenium IDE: dưới hai dạng scripts và Non- Scripts ( thường là biểu thức).
1. Cách sử dụng Javascripts dạng scripts trong selenium IDE
Một vài câu lệnh trong selenium, tham số đầu vào của lệnh chỉ định một đoạn kịch bản JS như là assertEval, verifyEval, storeEval, và waitForEval. Tham số này không cần cú pháp gì đặc biệt. Người dùng chỉ việc đặt một đoạn mã JS vào phần Target ( bởi vì cú pháp trong câu lệnh của selenium thường lấy Target là tham số đầu tiên)
Tất cả các biến được tạo ra trong trường hợp thử nghiệm của bạn được lưu trữ trong
JavaScript là một mảng kết hợp. Nhưng mảng này chỉ có chuỗi ký tự, không sử dụng chỉ mục.
Bất cứ khi nào bạn muốn truy cập hay thao tác với một biến trong một đoạn mã JavaScript, bạn phải đề cập đến nó như storedVars [‘tên biến của bạn’].
1.1: Câu lệnh assertEval, verifyEval
verifyEval : Câu lệnh rất hữu ích khi so sánh hai giá trị hoặc chuỗi đặc biệt, khi so sánh kết quả của kịch bản với các giá trị được lưu trữ trong biến.
Trong ví dụ trên, đã so sánh giá trị (5) được lưu trữ trong biến “Test1″ với kết quả của javascript {2 +3}. Nó sẽ trả về kết quả đúng vì 5 = javascript {2 + 3}.
AssertEval: Làm việc tương tự như “verifyEval” nhưng sẽ ngừng thực hiện nếu thất bại. Trong ví dụ trên, “assertEval” sẽ thất bại vì chuỗi “1234″ sẽ không phù hợp với chuỗi “123″
Ví dụ tiếp theo minh họa cách một đoạn mã JavaScript có thể biến đổi dữ liệu văn bản từ chữ thường thành chữ hoa và từ chữ hoa thành chuỗi văn bản chữ thường , trường hợp này ta sẽ phải sử dụng 2 phương thứ toUpperCase method và toLowerCase của đối tượng String.
  • info] Executing: |store | Selenium IDE | name |
  • [info] Executing: |storeEval | storedVars[‘name’].toUpperCase() | Chuhoa |
  • [info] script is: storedVars[‘name’].toUpperCase()
  • [info] Executing: |echo | ${Chuhoa} | |
  • [info] echo: SELENIUM IDE
  • [info] Executing: |storeEval | storedVars[‘name’].toLowerCase() | Chuthuong |
  • [info] script is: storedVars[‘name’].toLowerCase()
  • [info] Executing: |echo | ${Chuthuong} | |
  • [info] echo: selenium ide
Như các bạn thấy kết quả của đoạn script ở trên chuỗi “Selenium IDE” đã được chuyển thành chữ in hoa sau khi kết thúc phương thức toUpperCase() và chuyển thành chữ thường sau khi kết thúc phương thức toLowerCase()
2. Cách sử dụng Javascripts dạng Non-scripts
JavaScript cũng có thể được sử dụng để giúp tạo ra giá trị cho các tham số trong lệnh của selenium. Tuy nhiên trong trường hợp này cú pháp sẽ đặc biệt hơn chút. Tất cả các đoạn mã Javascript sẽ được đặt trong dấu { } và phía trước có nhãn javascript.
Cú pháp: javascript{mã js của bạn ở đây}
Dưới đây là một ví dụ về cách sử dụng javascript dạng non-script
Kết quả của đoạn script trên
  • [info] Executing: |store | 20.05 | number1 |
  • [info] Executing: |store | 30.023 | number2 |
  • [info] Executing: |echo | javascript{parseInt(storedVars[‘number1′])+parseInt(storedVars[‘number2′])} | |
  • [info] echo: 50
Trong ví dụ trên đã sử dụng hàm parseInt(“chuỗi”): biến chuỗi thành số nguyên của ngôn ngữ javascript
Selenium có một lệnh đơn giản cho phép bạn in ra giá trị đầu ra của js đó là lệnh echo. Nó rất hữu ích cho việc cung cấp thông tin trong quá trình phát triển kịch bản của bạn. Nó sẽ in giá trị trong cửa sổ Log trong quá trình chạy. Nó sẽ giúp tìm ra được các vấn đề tồn tại ẩn trong kịch bản như sai sót về thuật toán hoặc sự nhầm lần trong việc tính toán dựa vào công thức trong mã javascript.
Selenium IDE hầu như chỉ record lại những hành động của chúng ta trên trình duyệt. IDE không đủ thông minh để biết được chúng ta muốn kiểm tra những gì trên trang web đó. Sau đây một số câu lệnh kiểm tra hay dùng trong Selenium IDE để kiểm tra các đối tượng UI trên trang web.

Selenium IDE – Tự động kiểm tra

Theo như mình biết thì hiện tại Selenium IDE chỉ hỗ trợ kiểm tra tiêu đề của trang web một cách tự động. Để làm được điều đó, chúng ta cần thiết lập cơ chế của IDE như sau:
B1: Mở Selenium IDE Options bằng menu item Options –> Options
B2: Kích hoạt chức năng “Record assertTitle automatically” trong thẻ General
selenium ide

Như vậy, khi chúng ta thực thi record với Selenium IDE, cứ mỗi trang mới được hiển thị, IDE sẽ tự động thêm dòng lệnh kiểm tra tiêu đề trang web cho chúng ta.

Selenium IDE – Các câu lệnh kiểm tra

Để thêm các câu lệnh vào Selenium IDE, các bạn có thể chọn menu item Edit –> Insert New Command, hoặc chọn Insert New Command ở Context Menu
selenium ide
Các câu lệnh về đối tượng UI
Đối với các đối tượng UI, thông thường chúng ta chỉ có hai loại kiểm tra: Tồn tại hay không tồn tại.
·         verifyElementPresent/assertElementPresent: Hai câu lệnh này dùng để kiểm tra một đối tượng UI tồn tại trên trang web.
·         verifyElementNotPresent/assertElementNotPresent: Hai câu lệnh này dùng để kiểm tra một đối tượng UI không tồn tại trên trang web.
Bên cạnh hai loại kiểm tra chính, Selenium IDE còn hỗ trợ chúng ta kiểm tra đối tượng UI ở mức độ chi tiết hơn như:
Cách hiển thị của đối tượng UI trên trang web:
·         Chiều cao: verifyElementHeight/assertElementHeight – verifyNotElementHeight/assertNotElementHeight
·         Chiều rộng: verifyElementWidth/assertElementWidth – verifyNotElementWidth/assertNotElementWidth
·         Toạ độ trái so với trang web: verifyElementPositionLeft/assertElementPositionLeft – verifyNotElementPositionLeft/assertNotElementPositionLeft
·         Toạ độ trên so với trang web: verifyElementPositionTop/assertElementPositionTop – verifyNotElementPositionTop/assertNotElementPositionTop
Các đối tượng UI được thiết kế với thuộc tính đặc biệt và chúng ta cần kiểm tra thuộc tính đó: verifyAttribute/assertAttribute – verifyNotAttribute/assertNotAttribute
Đối tượng UI đặc biệt như Checkbox hay RadioBox: verifyChecked/assertChecked – verifyNotChecked/assertNotChecked

Các câu lệnh về text

Đôi khi, chúng ta không cần kiểm tra một đối tượng UI, chúng ta chỉ muốn biết một dòng text có hay không có xuất hiện trên trang web. Lúc này, chúng ta có các câu lệnh kiểm tra vể text từ Selenium IDE.
·         verifyTextPresent/assertTextPresent: Hai câu lệnh này dùng để kiểm tra một dòng text tồn tại trên trang web.
·         verifyTextNotPresent/assertTextNotPresent: Hai câu lệnh này dùng để kiểm tra một dòng text không tồn tại trên trang web.
Vì bốn câu lệnh kiểm tra text này không tương tác với đối tượng UI nào, nên phần Target của câu lệnh chính là dòng text mà chúng ta muốn kiểm tra.
Trong trường hợp đặc biệt, chúng ta muốn kiểm tra text của một đối tượng UI xác định, chúng ta có hai câu lệnh verifyText/assertText. Lúc này, target chính là đối tượng UI của chúng ta, và Value chính là dòng text cần kiểm tra.

Các câu lệnh vể tổng thể trang web

Khi chúng ta quan trọng việc thiết kế trang web một cách tổng thể, Selenium IDE hỗ trợ chúng ta các câu lệnh có thể làm việc với toàn bộ trang web.
·         verifyBodyText/assertBodyText: Kiểm tra toàn bộ text trên trang web.
·         verifyCssCount/assertCssCount: Kiểm tra số lượng đối tượng UI sử dụng chung một thiết kế CSS
·         verifyXpathCount/assertXpathCount: Kiểm tra số lượng đối tượng UI có cùngXPath
Trên đây là một số câu lệnh dùng để kiểm tra trang web với Selenium IDE mà mình nghĩ là chúng ta thường xuyên sử dụng. Ngoài ra, Selenium IDE còn hỗ trợ chúng ta rất nhiều câu lệnh để chúng ta có thể sủ dụng trong các trường hợp đặc biệt mà các bạn có thể tìm thấy trong ô Command trên màn hình chính của Selenium IDE.

selenium ide

ký hiệu trên cửa sổ Selenium IDE
Thanh trượt Fast – Slow tuỳ chọn tốc độ chạy testcase
Chọn chạy tất cả các testcase sẵn có
Chạy từng testcase một
Record lại các thao tác bạn tạo script trên url (đường dẫn website) bạn cần test.
Cho phép bạn dừng test tại 1 điểm bất kỳ bạn muốn
Bỏ qua 1 testcase khi nó đang bị tạm dừng
Nơi chứa đường dẫn web mà bạn muốn test
Textbox command: Dòng lệnh
Textbox target: Kết quả mong đợi của dòng lệnh
Textbox Value: Giá trị đầu vào của dòng lệnh
  ——————————————

Một số command thường dùng
1. open(url) : dùng để mở trang (URL)
vi dụ : Open (target = /login) => mở trang login.
2. pause(waitTime): Tạm dừng
Vidụ:  Pause (target : 1500) => Tạm dừng 1.5 s
3. type(locator, value) :
ví dụ : type (target : name=username,value=user01) = > type vào ô User name là uaser01
4. click(locator):
ví dụ : click (locator : link=Đăng nhập) => Click vào link Đăng nhập
5. assertText(locator, pattern) :
ví dụ : asserText( target: css=a.btn_big, value : Nạp tiền) => asser vào object Nạp tiền nếu có và check text hiển thị là có text là Nạp tiền
6. store(expression, variableName):
ví dụ : store(target: user01@yahoo.com, value:V1_User_Name) =>biết V1_User_Name hiện tại đang giữ value là :  user01@yahoo.com.
7. captureEntirePageScreenshot(filename, kwargs):
ví dụ: 
captureEntirePageScreenshot(Target : d:\\Eclick_Auto_Test\\image_test\\TC_6_image01_DanhSachChienDich.png) => Capture 1 hình và lưu tên đường dẫn như trên)
—————————————-
Các câu lệnh Selenium – “Selenese”:
Các câu lệnh Selenium 3 loại: Actions, Accessors, và Assertions.
Actions: là các lệnh thao tác nói chung trên trạng thái của ứng dụng. Chúng là những việc như “click trên link” hay “lựa chọn các tùy chọn”. Nếu có một Action fail hoặc có một lỗi, thực hiện kiểm thử hiện tại được dừng lại. Nhiều Action có thể được gọi với hậu tố “AndWait”, Ví dụ: “clickAndWait”. Hậu tố này cho biết Selenium sẽ thực hiện một cuộc gọi tới máy chủ và Selenium đợi để tải một trang mới.
Accessors: kiểm tra trạng thái của ứng dụng và lưu trữ kết quả trong các biến, ví dụ: “storeTitle”. Chúng cũng được sử dụng để tự động tạo ra Assertions.
Assertions như Accessors, nhưng chúng xác minh rằng trạng thái của ứng dụng  phù hợp với những gì được mong đợi, ví dụ: “chắc chắn rằng tiêu đề trang là X” và “xác nhận rằng checkbox này đã được kiểm tra”.
Tất cả các Assertions Selenium có thể được sử dụng trong ba cách thức:
– assert
– verify
– waitFor
Ví dụ: “assertText”, “verifyText” và “waitForText”. Khi một “assert” fail kịch bản của bạn sẽ dừng lại ngay lập tức và không chạy bất kỳ thêm một lệnh nào khác. Khi một “verify” fail kiểm thử vẫn tiếp tục thực hiện.
———————————
Các lệnh Selenium thường được sử dụng:
Open:
Mở một trang sử dụng một URL.
click/clickAndWait:
Thực hiện một thao tác nhấp chuột và chờ đợi để nạp một trang mới.
verifyTitle/assertTitle:
Xác minh một tiêu đề trang được dự kiến.
verifyTextPresent:
Được sử dụng để xác nhận văn bản cụ thể tồn tại một nơi nào đó trên trang. Với lệnh này nó sẽ tìm kiếm chuỗi văn bản “Selenium IDE” có xuất hiện ở một nơi nào đó trên trang hiện đang thử nghiệm không. Sử dụng hàm này bạn chỉ cần quan tâm nó văn bản cần kiểm tra có xuất hiện không, chứ không kiểm tra nó xuất hiện tại một vị trí nào cụ thể.
verifyElementPresent:
Kiểm tra sự hiện diện của một yếu tố giao diện người dùng cụ thể, hơn là nội dung của nó. Xác minh này không kiểm tra các văn bản, chỉ có các tag HTML. Thông thường sử dụng để kiểm tra sự hiện diện của một hình ảnh.
VerifyText:
Sử dụng verifyText khi cần kiểm tra cả  văn bản và giao diện phần tử của nó. verifyText phải sử dụng locator. Nếu bạn chọn một Xpath hoặc DOM locator, bạn có thể verrify rằng văn bản cụ thể xuất hiện tại một địa điểm cụ thể trên trang web liên quan đến các thành phần UI trên trang.
VerifyTable:
Kiểm tra nội dung của một bảng dự kiến.
waitForPageToLoad:
Tạm dừng thực hiện cho đến khi một trang mới dự kiến được nạp.
WaitForElementPresent:
Tạm dừng thực hiện cho đến khi yếu tố giao diện người dùng mong đợi, được định nghĩa bởi thẻ HTML của nó xuất hiện trên trang.
AssertTextPresent:
Kiểm tra một chuỗi Text có tồn tại trên màn hình.
AssertTextNotPresent:
Kiểm tra một chuỗi Text không tồn tại trên màn hình

BACK TO TOP