1) What Is Python? What Are The Benefits Of Using Python?</strong

Python is a programming language with objects, modules, threads, exceptions and automatic memory management. The benefits of pythons are that it is simple and easy, portable, extensible, build-in data structure and it is an open source.

2) How Python Can Be Used In Software Testing?

  • To generate test data; parse test results; generate reports; testing API calls etc.
  • Python to extract requirements from a Word document.
  • For testing tasks automation, setting up environments for tests, extracting performance data, etc…
  • Testers use Python extensively in many companies with Selenium for test automation.
  • For writing desktop applications used by testers.
  • Test data manipulation.
  • To build test environment
  • Testing with IronPython on .NET

3) What Python Frameworks Do You Know?

Framework called Web2py, PAMIE (Python automation Module for I. E.), The py.test framework

4) What Tools That Helps Python Development Do You Know?

There are good tools for helping Python development such as Notepad++ with the PyNPP plugin and Eclipse with PyDev and PyUnit

5) What Is A “unittest” In Python?

The unit testing framework of Python is known as “unittest”.  It supports the sharing of setups, automation testing, shutdown code for tests, aggregation of tests into collections, among others.

6) How Python Is Interpreted?

Python language is an interpreted language. Python program runs directly from the source code. It converts the source code that is written by the programmer into an intermediate language, which is again translated into machine language that has to be executed.

7) What Is The Difference Between “xrange” And “range”?

“Xrange” returns the “Xrange” object while range returns the “list” irrespective of the size of the “range”.

8) Define “module” And “package”?

  • Each Python program file is a “module”, which imports other modules like “objects” and “attributes”.
  • A Python program folder is a “package” of “modules”.  A package can have “modules” or “subfolders”.

9) Why my pip is not working when my python is not installed properly?

The executable path is not set properly.

10) What is the commands for downloading selenium?

  • pip install –U selenium
  • sudo pip install python

11) How can we know that our python is properly installed or not?

pip –version

12) How can we implement unittest framework in our scripts?

By using:- import unittest

13) What are the different locators used?

  1. Tag name
  2. Class name
  3. id
  4. link text
  5. Partial link text
  6. CSS Selector
  7. XPath
  8. Name

14) Which is the slowest locator?

Xpath.

15) Which is the best locator?

The selection of the best locator depends on the web elements or the ui page we are automating.

16) What is the library to be imported to add keyboard actions to our scripts?

from selenium.webdriver.common.keys import Keys

17) What is the library to be imported to add mouse actions to our scripts?

from selenium.webdriver.common.actionchains import ActionChains

18) What is Selenium?

It’s a Automation toolkit

19) What is python?

Iit’s a scripting language, it works as an interpreter and not a compiler

20) What is a locator?

It’s an element in web page with which the python script would interact through the selenium driver