Failure Sharing

Bootup your energy with sharing failure.

Learning Robot Framework : Setup and Teardown etc.

Set up and Teardown

Teardown Behavior Check
    [Setup]  Setup Start Browser and Maximize // keyword
    [Teardown]  Teardown Close Browser Window

This can be adapted at the suite level

*** Settings ***
Library  SeleniumLibrary
Test Timeout  30s
Test Setup  Setup Start Browser and Maximize
Test Teardown  Teardown Close Browser Window

Like this, suite level is also ok.

Suite Setup  Before Each Test Suite
Suite Teardown  After Each Test Suite

急に気になって調べたけど、 Parallel Executionのためには、pabotというものがあるみたい。

pabot.org

Learning Robot Framework : Create Resource Files

Create new user defined keywords using resource

Of course, we can create the keyword using python script but also create it with standard keywords

Keyword

*** Settings ***
Library  SeleniumLibrary

*** Variables ***
${URL}  https://www.rakuten.co.jp/
${BROWSER}  Chrome

*** Keywords ***
# Keyword without argument
Start Browser and Maximize
    Open Browser  ${URL}  ${BROWSER}
    Maximize Browser Window

Start Browser and Maximize With Argument
    [Arguments]  ${UserURL}  ${InputBrowser}
    Open Browser  ${UserURL}  ${InputBrowser}
    Maximize Browser Window

    ${title}=  Get Title
    # Put INFO log to log.html
    Log    ${title}
    [Return]  ${title}

Test case

*** Settings ***
Library  SeleniumLibrary

*** Variables ***
${URL}  https://www.rakuten.co.jp/
${BROWSER}  Chrome

*** Keywords ***
# Keyword without argument
Start Browser and Maximize
    Open Browser  ${URL}  ${BROWSER}
    Maximize Browser Window

Start Browser and Maximize With Argument
    [Arguments]  ${UserURL}  ${InputBrowser}
    Open Browser  ${UserURL}  ${InputBrowser}
    Maximize Browser Window

    ${title}=  Get Title
    # Put INFO log to log.html
    Log    ${title}
    [Return]  ${title}

Timeout for each test

Start Browser and Maximize With Argument
    [Documentation]  This keyword is...
    # This timeout setting is limiting test running time for this test. e.g. 2mins 8s
    [Timeout]  1s
    [Arguments]  ${UserURL}  ${InputBrowser}
    ...

github.com

Learning Robot Framework : Basic Usage

Basic syntax on Robot file

github.com

Selenium Speed / Timeout / Implicit Wait

Set Selenium Speed    1 seconds

Can set the speed like this but when we use this function? just when we show it as demo?

github.com

Selenium Timeout

github.com

Implicit Wait

github.com

Miscellaneous Keywords

Capture screenshot

Test Screeshot
    Open Browser  ${URL}  ${BROWSER}
    ${dir}=  Set Screenshot Directory    ./evidences

    Capture Page Screenshot  test.png
    Close Browser

Browser behavior

GoTo, GoBack, Get Location
    Open Browser  ${URL}  ${BROWSER}
    Go To  ${TO}
    Go Back
    ${location}=  Get Location
    Log To Console    Current is on ${location}
Execute Javascript
    Open Browser  ${URL}  ${BROWSER}
    Maximize Browser Window
    Execute Javascript  window.scrollTo(0,1000)
    Sleep    10 seconds

Context Menu

f:id:woosyume:20210614221513p:plain

Perform Mouse Operations
    Open Browser  ${URL}  ${BROWSER}
    Open Context Menu    xpath://*[@id="rankingGenreBox1"]/span/a
    Sleep    5 seconds

github.com

Learning Robot Framework : Introduction

Robot framework

  • Generic test automation framework for acceptance testing
  • Keyword Driven (standard, user defined)
  • Can be extended with programming language libraries

Advantages

  • Free
  • Easy Syntax
  • Mininum coding efforts
  • Reporting, Logging
  • Many standard, external libs, extensions with python programming
  • Distributed structure

Install Robot Framework

Framework

pip install robotframework
Collecting robotframework
  Downloading robotframework-4.0.3-py2.py3-none-any.whl (655 kB)
     |████████████████████████████████| 655 kB 2.1 MB/s 
Installing collected packages: robotframework
Successfully installed robotframework-4.0.3

Selenium library

pip install robotframework-seleniumlibrary
Collecting robotframework-seleniumlibrary
  Downloading robotframework_seleniumlibrary-5.1.3-py2.py3-none-any.whl (94 kB)
     |████████████████████████████████| 94 kB 1.7 MB/s 
Requirement already satisfied: robotframework>=3.1.2 in /usr/local/lib/python3.9/site-packages (from robotframework-seleniumlibrary) (4.0.3)
Collecting robotframework-pythonlibcore>=2.1.0
  Downloading robotframework_pythonlibcore-3.0.0-py2.py3-none-any.whl (9.9 kB)
Collecting selenium>=3.141.0
  Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB)
     |████████████████████████████████| 904 kB 3.2 MB/s 
Collecting urllib3
  Downloading urllib3-1.26.5-py2.py3-none-any.whl (138 kB)
     |████████████████████████████████| 138 kB 3.2 MB/s 
Installing collected packages: urllib3, selenium, robotframework-pythonlibcore, robotframework-seleniumlibrary
Successfully installed robotframework-pythonlibcore-3.0.0 robotframework-seleniumlibrary-5.1.3 selenium-3.141.0 urllib3-1.26.5

Browser driver

brew install chromedriver

Create test case

*** Settings ***
Library           SeleniumLibrary

*** Variables ***
${BROWSER}  Chrome
${URL}  https://ranking.rakuten.co.jp

*** Test Cases ***
Browser Start and Close
    Open Browser  ${URL}  ${BROWSER}
    Close Browser

Input Search Keyword
    Open Browser  ${URL}  ${BROWSER}
    Maximize Browser Window
    Enter Search Keyword  本
    # This kind of keyword is basically calling API connected with Selenium

*** Keywords ***
Enter Search Keyword
    [Arguments]  ${searchkeyword}
    Input Text  name: stx  ${searchkeyword}

Run the tests

robot start_close_browser.robot 
==============================================================================
Start Close Browser                                                           
==============================================================================
Browser Start and Close                                               | PASS |
------------------------------------------------------------------------------
Input Search Keyword                                                  | PASS |
------------------------------------------------------------------------------
Start Close Browser                                                   | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
Output:  /Users/woohyeok.kim/Desktop/study/robotframework-basic/testcases/output.xml
Log:     /Users/woohyeok.kim/Desktop/study/robotframework-basic/testcases/log.html
Report:  /Users/woohyeok.kim/Desktop/study/robotframework-basic/testcases/report.html

Github

github.com

Approach for checking cache server behavior for migration (Varnish)

Version is the latest?

varnishlog, varnishncsa, varnishd can be accessible and available

// Log when failed due to not enough permission
/etc/varnish$ varnishstat 
.....
Could not get hold of varnishd, is it running?

default.vcl difference should be tested

(Cache Hit rate) User agent normalization

e.g. If the cache is for API, response should be same for ALL user agents.
e.g. Cache for iPhone6 and 7 should be same.

(Cache Hit rate) Accept-Encoding normalization

varnish-cache.org

Software Testing Interview

This content is from 'edureka' and I'm just taking a memo referring to it.

Top 50 Software Testing Interview Questions To Know In 2021 | Edureka

Senior Software QA Automation Engineer

  • Job Summary : Plan, design, execute and report software tests (with automation technique). Supervise a team of software testers.

1. Test Cycle

Planning, Case development, Env setting, Execution, Closure

2. What are the different methods of testing?

There are three methods of software testing and they are as follows:

  • Black-box testing : It is a testing strategy based solely on requirements and specifications. In this strategy, it requires no knowledge of internal paths, structures, or implementation of the software being tested.
  • White box testing : It is a testing strategy based on internal paths, code structures, and implementation of the software being tested. White box testing generally requires detailed programming skills.
  • Gray box testing : It is a strategy for software debugging in which the tester has limited knowledge of the internal details of the program.

3. Bug/Defect Life Cycle

f:id:woosyume:20210322202454p:plain

4. What is Non Functional Testing?

Performed after functional testing, Based on customers expectations (Functional Test is based on requirement) Non-Functional Testing is normally conducted during System and Acceptance Testing levels. Normally, White Box Testing method is used. (Exception is Usability Testing where black box testing method is used.) * Usability Testing * Performance Testing * Security Testing * Compliance Testing

7. What is Verification and Validation in Software Testing?

  • Verification: It is a static analysis technique. Here, testing is done without executing the code. Examples include – Reviews, Inspection, and walkthrough.
  • Validation: It is a dynamic analysis technique where testing is done by executing the code. Examples include functional and non-functional testing techniques.

8. Category of defects

f:id:woosyume:20210322202736p:plain

9. Different type of Test coverage

  • Statement coverage : It ensures that each line of source code has been executed and tested.
  • Decision coverage : It assures that every decision (true/false) in the source code has been executed and tested.
  • Path coverage : Here we ensure that every possible route through a given part of the code is executed and tested.

10. Environment reality / Test phase

f:id:woosyume:20210322203055p:plain

11. Cost impact from when defect is found

f:id:woosyume:20210322203204p:plain

12. BVA(Boundary Value Analysis)

Boundary Value Analysis (BVA) is a black box test design technique which is applied to see if there are any bugs at the boundary of the input domain.

13. Random Testing (= Adhoc, Monkey Testing)

f:id:woosyume:20210322203333p:plain

14. what basis you can arrive at an estimation for your project?

  • Divide project to milestones
  • Extract necessary tasks
  • Estimate

15. General order between black box and white box testing

Black -> White due to the amount of knowledge

16. AT's Success Criteria

* Maintainability * Defect Detection Ratio * Automation execution time and time savings to release the product * Reduction in Labour & other costs

17. What kind of input do we need from the end user to begin proper testing?

f:id:woosyume:20210322204247p:plain

18. What is meant by workbench concept?

A workbench at its core is a way of documenting how a specific activity has to be performed. It is often referred to as phases, steps, and tasks as shown in the following figure. f:id:woosyume:20210322204404p:plain There are five tasks for every workbench and they are as follows: Input Execute Check Production output Rework

19. What is meant by Defect Cascading?

Defect cascading is a defect which is caused by another defect. One defect triggers the other defect. When a defect is present in any stage but is not identified, hide to other phases without getting noticed. This will result in an increase in the number of defects.

Let us understand this by an example.

You are designing the Login Module of a WebPage:

  • In phase 1 – You are designing Register User Module for Login and mobile number is mandatory but you can leave it blank due to a bug that gets unnoticed.

  • In Phase 2 – You will design the login form having username and password. The password is OTP which will be sent to User’s registered mobile number.

Now as Register module has a bug that mobile number can be left blank so this may lead to Login failure or maybe some system error or crash if a null mobile number is not handled. This is known as defect cascading.