Unit 3- Scripting
Unit 3- Scripting
Course Code-COM-702(B)
Lecture No-
Topic – Scripting
Date- 15-10-2024
CO2 Analyze the variations in the types of testing suits and their applicability
For software testing specifically, some scripting languages are used more
frequently due to their robust libraries and frameworks that support testing
activities:
• Python: It's widely used in testing because of frameworks like pytest and unittest.
It can be used for a variety of tests, including but not limited to unit testing,
integration testing, and end-to-end testing.
• JavaScript: Essential for web development testing, especially with frameworks
like Jest for unit and integration tests and Cypress or Selenium WebDriver for
browser-based testing.
• Ruby: Utilized with Ruby on Rails applications, with RSpec being a popular
testing framework.
Execution:
• Scripting Languages: These are often interpreted, meaning they are executed line
by line at runtime. This allows for quicker testing and modification since there's no
need to compile the code before it runs.
• Programming Languages: These can be either compiled or interpreted, but
traditionally, major programming languages like C and Java are compiled into
machine code, which is then executed by the computer's hardware.
Use Case:
• Scripting Languages: Typically used for automating specific tasks within
programs or systems, such as data manipulation, routine administrative tasks, or
scripting for applications like web browsers. Examples include Python, Bash, and
JavaScript.
• Programming Languages: Used to create applications from the ground up,
capable of spanning every aspect of functionality including UI, backend
processing, and data management. Examples include Java, C++, and Swift.
Test Automation Fundamentals. Unit 3
Differences Between Scripting and Programming
Languages:
7
Performance:
• Scripting Languages: Generally slower than programming languages due
to being interpreted and not optimized during the translation to machine
code.
• Programming Languages: Often faster because the code is compiled to
native machine code which is directly executed by the operating system.
Complexity and Control:
• Scripting Languages: Designed for higher-level programming with a
focus on ease of use and rapid development rather than low-level memory
and process management.
• Programming Languages: Provide more control over system resources,
which makes them suitable for developing complex and performance-
critical applications like operating systems and game engines.
Automated test case execution involves scripting tests that were traditionally
performed manually. This allows for tests to be run automatically, reducing human
error and saving time. Tools like Selenium, Appium, or frameworks like JUnit or
TestNG can be used to write these scripts.
Examples
Automation scripts can include commands to navigate through the application, input
values, and then check the output against expected results. This is especially useful
for repetitive tests or those that require extensive data input.
Data Input Scripts
10
Data input scripts are designed to automate the entry of test data into the
system. This is particularly useful for boundary value testing, equivalence
partitioning, and other test methods that require varied and extensive inputs
to ensure the application handles data correctly under different scenarios.
For example,
a script could be written to test form validations by automatically inputting
strings, numbers, and special characters into form fields to verify that the
application responds correctly.
GUI Testing Scripts
11