Sunday 24 October 2021

Manual testing basic interview questions

===============MANUAL  TESTING BASIC IQ’S=================
                                        Not completed yet

Manual testing basic interview questions :

è Difference between Sanity testing and Regression? 

Sanity testing:

Once we get the build from the developer's end QA engineers will flash that build and then start surface-level testing with high-priority test cases based on the sanity report we can decide whether we can accept or reject the build to execute the remaining test cases this surface-level testing is called sanity testing.

Regression:

.       Whenever complex bugs are fixed/patched in a system, typically which affect the core areas of the system, regression tests are used to retest all the modules of the system.

è What is Retesting?

            We will retest the same test case once again to ensure it’s working perfectly.

è What is the difference between severity and priority?

        Severity means how severe a defect is affecting functionality.

        Priority means how fast the defect has to be fixed.

è  Difference between a Bug and a defect?

    A bug is a hidden defect they are captured in the user environment.

    A defect is a specification that is missing present but wrong captured in the control environment

è What is sanity testing?

     Refer to the above 1st question

è What is regression testing?

      Refer to the above 1st question

è What is Functional testing?

    Functional tests check for the correctness of the output concerning the input defined in the specification. 

è what is Non-Functional testing?

    Refer Document: Testing basics by Narendra

è What is the difference between manual  & automation testing?

    Refer Document: Testing basics by Narendra

è What is the difference between black box & white box testing?

    Refer Document: Testing basics by Narendra

è Do you know STLC? explain it.

    Refer Document: Testing basics by Narendra

è Which life cycle have you used in your project?

      Ans: Agile

è Which bug tracking or Issue tracking tool have you used in your project?

    JIRA & Bugzilla (Refer Document: "Testing Basics by Narendra Boyina")


for more questions and Testing concepts read my book "Testing Basics by Narendra Boyina"

                         
                             
Request: 
Please provide your valuable comments



Thursday 14 October 2021

adb commands

=========================================================

To use ADB commands, we have to install adb-setup-1.4.3.exe (your flexible version)
==> Download the above software. Double click on it.

 ==> Click on next and Finish it. after that from the command prompt, you can use adb commands.

=========================================================

To get the list of connected devices with serial numbers and details:

adb devices -l 

List of devices attached

12xxxxxxxx345       device product:xxx model:xxxxx device:yyy transport_id:1

12xxxxxx5Ex50         device product: xxxx model:xxxx device:yyy transport_id:2

=========================================================


Copy Files from Computer to Phone

If you want to copy files from your computer to your phone using adb

adb -s serial_number push <source> <destination>

Ex1: adb -s 24x30x02x3 push  C:\Narendra\poject_location\configutration.js  /sdcard/configutration.js

Ex2: adb -s 24x30x02x3 push  C:\Narendra\result.xml  /sdcard/downoads/result.xml

Note: Donot forget to replace [source] and [destination] with actual file paths.

=========================================================

you can copy files from your phone to your computer using adb

adb -s serial_number pull <source> <destination>

Ex: adb -s 24x30x02x3 pull   /sdcard/downoads/result.xml  C:\Narendra\result.xml 

=========================================================

install apk in connected mobile devices:

adb -s <device serial_number> install "path/to/file.apk" 
Note: Before installing the latest apk, uninstall old apk
=========================================================
uninstall apk on connected mobile devices:

adb -s <device serial_number> uninstall xxxxxxx.apk 

=========================================================

To decrease/increase the resolution of the connected device

adb -s <device serial_number> shell wm density 130

=========================================================

To get the mobile wifi  configuration values
adb -s <device serial_number> shell dumpsys wifi
=========================================================
How to Check the device either in the fastboot mode?
fastboot devices -l
=========================================================
If a device is in fastboot mode.! How to change the device to adb mode.
adb -s <serial_number>  fastboot reboot
=========================================================

To get device build version and all firmware related info:

step1 : adb devices -l  

step2 : adb -s <serial_number> shell

step3 : getprop | grep -i build

=========================================================

To get product name

adb -s <device serial_number> shell getprop ro.product.name

product_name will be displayed

======================================================== =

To get the build date  
command: adb -s serial_number shell uname -a
Responce : Linux localhost #1 SMP XXXXXXX Mon Dec 6 01:32:26 IST 2021 armv7l

=========================================================

Android Firmware Flashing process:

step 1: Download firmware, place somewhere & then through command prompt move to that location  step 2: adb devices -l  

            Expected result: connected device's serial_ numbers should display

optional part: check for existing firmware info of the device.

                        adb -s <serial_number> shell <enter> 

                        getprop | grep -i build

step 3: adb -s serial_number reboot bootloader

step 4: fastboot devices -l 

            Expected result: that specific device serial only should display under fastboot devices list

step 5:  check the serial number properly by using the command: fastboot oem SYS_SN

step 6: Run the .bat file directly  (>xxxxxxxxxs.bat enter) wait till you have observed pass or success on the command prompt  

step 7: wait for some time reason: the device will restart after firmware flashed

step 8: optional part: check for existing firmware info of the device.

                        adb -s <serial_number> shell <enter> 

                        getprop | grep -i build

step 9: After the flashing process is completed make sure that you have installed the required apk s on your device, before executing test cases.

=========================================================

fastboot reboot

=========================================================




=========================================================

installation of certificates:

C:\...\....\...\\Common\Android>adb -s  <device serial_number> push eap.cer /sdcard/

eap.cer: 1 file pushed, 0 skipped. 1.6 MB/s (1186 bytes in 0.001s)


C:\...\....\...\Common\Android>adb -s <device serial_number>  push eap.p12 /sdcard/

eap.p12: 1 file pushed, 0 skipped. 4.2 MB/s (4004 bytes in 0.001s)

===================================================================

W.A.P  If os_type is android "Launches wifi Settings page"

def launch_wifi_settings_page (os_type,deviceID):

'''Launches wifi Settings page

INPUT: ``os_type``  :- DUT OS

``deviceID``  :- Device ID in case of Android

        OUTPUT: Launches wifi Settings page

'''

if(os_type == "Android"):

run_adb_command("adb -s "+deviceID +" shell am start -a android.settings.WIFI_SETTINGS")

return 1

else:

raise AssertionError("$os_type not supported")

===================================================================


                                Request: Please provide your valuable comments


Wednesday 22 September 2021

git repository - git commands

git steps:

git pull --rebase   # to pull the latest code from git

git pull --rebase  # again doing the same .. just for conformation  [optional]

Already up to date.

git status

git add <1st file name along with path>

git add <2nd file name along with path>

git add <3rd file name along with path>

# or you can add all files at once by using git add . command

git status

 git commit -m " you can provide the message "

git push origin HEAD:refs/for/project-int

open git link then add reviewers (who can review your code)

==============================================================

How do you enter into a particular branch & test? how do come out of that branch again?

git branch (cmd will be used to check your current branch=> note down somewhere Ex: * master)

git checkout <brach_name_need_to_test>

git branch ==> cmd will be used to check your current branch, have you moved or not? 

Do your testing 

git checkout <master>

git branch 

==============================================================

How do I check multiple previous git commit changes?

git log (type this command in the git bash prompt, and it will display as below )

commit id (HEAD -> Branch_name)

Author: Narendra <EMPID@companyname>

Date:   Fri Sep 17 11:38:40 2021 +0530

    latest changes in input file & added chamber details in file_name.py

Press the down arrow  mark (arrow  mark ) then you can see all previous commit changes datewise

Press q for quit from the log 

==============================================================

                                           In real-time I have faced the following git related issues:

In the latest git code, if you modify code in a single file or multiple files when you have given git status, it will display that file change.

if you don't want that file changed then 

git restore <filename along with path>

git status

==============================================================

When  you have committed and pushed your code to git, but you don't want to do that  then you have to follow the below procedure

git log (type this command in the git bash prompt, and it will display as below )

commit id (HEAD -> Branch_name)

Author: Narendra <EMPID@companyname>

Date:   Fri Sep 17 11:38:40 2021 +0530

    latest changes in input file & added chamber details in file_name.py

Press q for quit from the log

git reset --hard origin/<branch>

git pull origin fusion-int --rebase

git status

after this, you can pull the latest code if you want by typing the below command.

git pull --rebase

==============================================================

==============================================================

==============================================================





Thursday 26 August 2021

Python telephonic /theory-oriented interview questions for freshers & Experienced

Python telephonic /theory-oriented interview questions

Python Interview questions for freshers & Experienced 

**********  @@@  Interview Questions on Python Basics @@@*************

 __author__ = "Narendra Boyina"

 Note: For an interviewer no need to answer exactly as I have written below.

 I have written complete information regarding the question.

 Understand the below questions & answers, then perform on your own in front of the interviewer.

                                         @ All the best for your bright future @

 

General Python Interview Questions & Answers:

==> How is memory managed in Python?

  • Python memory is managed by Python's private heap space. 
  • All Python objects and data structures are in a private heap.
  • The programmer does not have access to this private heap and the interpreter takes care of this Python private heap.
  • The allocation of Python heap space for Python objects is done by the Python memory manager.
  • Python also has an inbuilt garbage collector, which recycles all the unused memory and frees the memory, and makes it available to the heap space.


==> What are Python Identifiers?

   A Python identifier is a name used to identify a variable/ function/ class/ module/ other object. 

Rules for Identifiers:

·       Identifier name purpose we can use a combination of alphabets (A to Z or a to z), digits (0to 9), an underscore (_)

·       Python does not allow punctuation characters such as @, $, and % - + .... etc within identifiers.

·       Identifier names should not start with numbers.

·       Keywords/ reserved words should not use as an Identifier.

·       Python is a case-sensitive programming language.  

Ex:  Manpower and manpower are two different identifiers in Python.

General information regarding identifiers:

·       Class name starts with an uppercase letter.

·       All other identifiers start with a lowercase letter (Ex: variable, function, method).

·       Starting an identifier with a single leading underscore indicates that the identifier is private (private variables/private method).

Explanation:  

o   Generally, we use private variables & private methods inside a class for Data hiding purposes. 

o   Private variables are also known as hided variables.

o   Private method also known as hided methods.

o   Outside the class, you cannot access the private variables as well as the private methods.

·        Starting an identifier with two leading underscores indicates a strongly private identifier.

·        If the identifier ends with two trailing underscores, the identifier is a language-defined special name.    Example: __author__ = "Narendra Boyina"

==> Mention the use of the // operator in Python?

It is a Floor Division-operator, which is used for dividing two operands with the result as a quotient showing only digits before the decimal point. For instance, 10//5 = 2 and 10.0//5.0 = 2.0.

==> What are the built-in Data types available in Python, classify them as either Homogeneous or Heterogeneous classify them as mutable or immutable.

                    or 

What are the data structures /data types available in Python?

Immutable built-in types

Numbers        ------> Ex:      123                              ------->   Homogeneous

Strings           ------> Ex:   "Narendra "                    ------>    Homogeneous

Tuples           ------> Ex:    (1, "Narendra", 1.5)      ------>    Heterogeneous

Mutable built-in types

List                ------> Ex: [1, "Narendra", 1.5]      ------>    Heterogeneous

Set                 ------> Ex{1, "Narendra", 1.5}       ------>   Heterogeneous

Dictionary     -----> Ex{'Name':'Narendra', 'Age':26, 'Percentage':76.2, 1990:'birthday'}

where the key is immutable & unique. 

The value may be mutable/ immutable (Heterogeneous) 

                            

==> What is the difference between List and Tuple?

List and Tuple both are Heterogeneous which means we can be able to store more than one value in a single variable.

List is a mutable sequence; we can modify list elements.

Tuple is an immutable sequence; we can’t perform modifications on tuple.

==> What are the modifications you can perform on the list?

List is a super dynamic and mutable sequence. We can add, and delete elements by using append, extend, and remove functions.

==> Can we perform modifications on the tuple?

No: Tuple is an immutable sequence, i.e. we cannot perform operations like list.

==> What is the difference between a list, tuple, and set?

  list [], tuple (), and set {} are heterogeneous data structures/ Data types.

  list & set are mutable, but the tuple is immutable.

==> What is the difference between append and extend?

append function will add a single element at the end of the List.

Extend function will add multiple elements at the end of the List.

==>What is the difference between Dictionary and Set?

         Dictionary is a key value pair.

Dictionary is an unordered mapping from unique.

immutable key to mutable/immutable values.

No duplicate key is allowed in a dictionary.

 Optional: when duplicate keys occur during an assignment the last assignment wins.

Set is an Unordered collection of unique data.

 Delimited by {curly braces} filled with comma-separated values.

==>What is the difference between Deep copy and shallow copy?

Deep copy creates a separate memory location.

While copying a list to another variable, if we use deep copy, it creates a separate memory location for the 2nd list. 

so, if you change an element in the 2nd list, the 1st list will not be changed.

Shallow copy uses the same memory location.

While copying a list to another variable, if we use shallow copy, it uses the same memory location for the 2nd list.

If you change an element in the 2nd list, then 1st list values also will change.

==> Define Conditional /Decision-making statement?

It will execute based on the given condition of the expression.

Types: if statement, if else, if elif else and nested if statement.

==> Control flow statements or iterative statements

for loop: Executes a set of elements repeatedly, depending on the number of elements in a sequence.

While loop: Executes a set of elements repeatedly until the condition fails.

==>Define Break and continue statements?

            Break keyword will cause your for-loop to stop executing and exit without reaching the

end of the list or end of the function.

Continue statement: we can use this to skip the current iteration and continue the next iteration

==> What is Function?

            A function is a block of organized code that is used to perform single/ multiple actions.

The purpose of the function is code re-usability.

Once the basic structure of a function is finalized. You can execute it by calling from another function also.

==> Types of Functions?

            There are two types of functions 1. Recursive function 2. Non-recursive functions

            We have 6 types of non-recursive functions:

1. function without arguments

2. functions with arguments/ positional/ Required arguments

3. functions with Default arguments

4. functions with Variable-length arguments (* args)

5. functions with Keyword arguments (**args) / (**kw args)

6. functions with command line arguments


==> What is variable-length arguments/ *args in python?

Variable-length arguments are defined using the *args and var_args for short,

arguments that can take Zero args/ an unspecified amount of input args and

store those arguments in a tuple.

                                                or

 *args can take Zero values or any number of values in it.

and no values are passed to it then also it will not give any error.

 

==> What is Keyword arguments/ **args/kw_args in python?

Python can accept multiple keyword arguments, it is also known as **kwargs.

It behaves similarly to *args, but stores the arguments in a dictionary.

                                            or

**kwargs can take Zero key_based values or any number of key_based values in it.

and no key_based values are passed to it then also it will not give any error.

==> What is comprehension and what are the different types of comprehension in Python?

         Comprehensions in Python provide us with a short way to construct new sequences

         (such as lists, sets, dictionaries, etc.) using sequences that have been already defined.

        Advantages of using Comprehensions

    •       Nneed to declare an empty list/set/dictionary.
    •       No need to write an append method, Comprehension will take care of both.

        Comprehensions are syntax constructions to ease the creation of a Dictionary or List based on existing iterable.

   List Comprehensions provide an elegant way to create new lists. 

Syntax: Variable = [expression(element) for element in iterable]

Ex: list_1 = ["Always", "Trust yourself", "Do", Hard-work", "You", "can", "reach", "your","goals", "easily"]

x = [((len(i)) *3) for i in list_1]

# It calculates the length of each word & length multiplied by 3 then the result is stored in the same list instead of taking a new empty list and appending the result

print(x) # [18, 42, 6, 27, 9, 9, 15, 12, 15, 18]

   Set Comprehensions

Syntax: Variable = {expression(item) for item in iterable}

set function eliminates duplicate objects present if any result set will not store in order because the set is unordered.

from math import factorial

f = {len(str(factorial(x))) for x in range (20)}

print(f) # length of factorial of numbers till 19

# Result : set([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 18])

# Note: duplicate elements were discarded because of set comprehension

   Dictionary Comprehensions

Syntax: Variable = {key_expr : value_expr for item in iterable}

Ex: Naren = [1,2,3,4]

x = {i: i**i for i in Naren} # dictionary comprehension print(x)

# Output {1: 1, 2: 4, 3: 27, 4: 256}

 

==> What is lambda in Python and what is the drawback of lambda?

Lambda function is a single-line anonymous function but not declared in the standard manner by using the “def” keyword.

Drawback: lambda function allows multiple arguments in it but can return only one return value in the form of an expression.

 

==>Define Map( ) and filter( )

map() will apply the same function to every element of iterable /sequence and return a list of the results.

The filter(function_name, iterable) function offers a way,  to filter out all the elements of a list, for which the function returns True.

==>Difference between read(), readline() and readlines() functions?

read(n)       : Reads at most n characters from the file. Reads till the end of file

deadline()   :  Reads and returns one line from the file.

readlines()  : Reads and returns a list of lines from the file.

 

==> What is Class?

Class is nothing but just blue-print and there is no use of class definition,

 unless you have created the instance/object for that class.

 

==> What are the advantages of classes compared with functions?

  • We can provide a specific class name by grouping functions in the form of methods
  • We can inherit the class into another class.
  • We can perform multiple class-related properties

    (single/multiple/hybrid inheritances, Data hiding/abstraction/ method overriding / encapsulation...) 

==> Difference between method and function?

A function that is defined inside of the class is a method.

A function that is defined outside of the class is a Function.


==> What is the _ _init_ _ () method or  Constructor method?


Constructor method (def __init__(self)) is a special kind of method,

as soon as you have created an object/ instance for the class then automatically,

 _ _init_ _ method will be executed, without calling it.

 

==> What is the difference between the class variable and the instance variable?     

         Class variables can use in all instances of the same class created by the user.

          class variables, which have the same value across all class instances (i.e., static variables)

          Instance variables can use only for the same instance.

          Instance variables are owned by instances of the class. T

          this means that for each object or instance of a class, the instance variables are different.

·   Class variables will be shared among the multiple instances of the class.

·   But the instance variable will be independent.

·   Class variables are defined within the class but outside of the class method.

·   Class variables are not used as frequently as instance variables.

 

==> What are pass, continue & Assert keywords in Python?

Pass means, a no-operation Python statement, or in other words, it is a placeholder in a compound statement, where there should be a blank left and nothing has to be written there.

 Python's assert statement is a debugging aid that tests a condition. 

If the condition is true, it does nothing and your program just continues to execute. 

But if the assert condition evaluates to false, it raises an AssertionError exception with an optional error message.

        x = "narendra"
        #if the condition returns False, AssertionError is raised:

        assert x == "Narendra", "x should be 'narendra'" 

 

==> In Python what are iterators and generators?

Iterators are used to iterate a group of elements, containers like list.

The way of implementing iterators is known as generators.

The generator function is normal, except that it yields expression in the function.

 

==>What are Python namespaces? Why are they used? Scope in Python

A namespace in Python ensures that object names in a program are unique and can be used without any conflict. Python implements these namespaces as dictionaries with 'name as key' mapped to a corresponding 'object as value'. This allows for multiple namespaces to use the same name and map it to a separate object. A few examples of namespaces are as follows:

·        Local Namespace includes local names inside a function. the namespace is temporarily created for a function call and gets cleared when the function returns. Examples : narendra =30, x = 40, y =50 defined inside functions

·        Global Namespace includes names from various imported packages/ modules that are being used in the current project. This namespace is created when the package is imported in the script and lasts until the execution of the script.

·        Built-in Namespace includes built-in functions of core Python and built-in names for various types of exceptions. Examples: print(), id(), type(), len(), input()


 ==> What is a module?

Python module is nothing but a Python file.

That filename is referred to as the module name while importing to another

 

==> Purpose of a module?

 For using the functions, class methods are defined in another file in the current Python file.

 We are having 3 types of modules in Python

        1. User-defined modules (we need to create these modules)

        2. Internal modules (During the installation of the Python these modules will be installed)

        3. External modules (We need to install these modules)

 

==> What internal & external modules do you know?

Internal Modules:  datetime, time, calendar, random, os, sys, re, json string

External Modules: openpyxl, paramiko, serial, subprocess

 ==>Tell the different ways of utilizing modules in your code?

         we can use modules in 17 ways. Refer to my training notes for an answer

 

==> Mention what are the rules for local and global variables in Python?

Local variables: If a variable is assigned a new value anywhere within the function's body, it's assumed to be local.

Global variables: Those variables that are only referenced inside a function are implicitly global.

 

==> What is the module and package in Python?

 In Python, a module is a way to structure a program. Each Python program file is a module, which imports other modules like objects and attributes.

The folder of the Python program is a package of modules. A package can have modules or subfolders.

If a folder contains __init__ (constructer) then it is a package (it may be an empty constructer) otherwise, it is just a folder.

 

==> How can you share global variables across modules?

To share global variables across modules within a single program, create a special module. 

Import the config module in all modules of your application. 

The module will be available as a global variable across modules.

 

==> Explain how you can make a Python Script executable on Unix?

 To make a Python Script executable on Unix, you need to do 2 things:

·       Script file's mode must be executable and

·       Inside python file the first line must begin with # ( #!/usr/local/bin/python) 

==> What is Comprehension?

Comprehensions in Python provide us with a short way to construct new sequences

(such as lists, sets, dictionaries, etc.) using sequences that have been already defined.

Advantages of Comprehension

we do not need to declare an empty list/set/dictionary.

We do not need to write an append method, Comprehensions will take care

Python supports the following 3 types of comprehension:

·       List Comprehensions

·       Dictionary Comprehensions

·       Set Comprehensions

 

==> What are Python decorators?

   A Python decorator is a specific change that we make in Python syntax to alter functions easily.

==> what is "chmod 777" ?

        chmod 777 means granting all permissions to read, write, and to execute any file by any user of the system

        chmod 777 -R  Dir_name  (Note:  -R  means recursive    Change files and directories recursively)





 

Request: Please provide your valuable comments