标签搜索
全栈-06-测试-2
程序员的自留地

全栈-06-测试-2

fiora
2026-10-21 / 0 评论 / 10 阅读
本段 281 题 | 来源:fullstack + general + design | 知识点:测试

577. Mention some of the ETL bugs.

提及一些ETL缺陷。
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab3ea | 官方: 否 | 付费: 否

答案:

Following are a few common ETL bugs:

以下是一些常见的ETL错误:
  • User Interface Bug: GUI bugs include issues with color selection, font style, navigation, spelling check, etc.
  • Input/Output Bug: This type of bug causes the application to take invalid values in place of valid ones.
  • Boundary Value Analysis Bug: Bugs in this section check for both the minimum and maximum values.
  • Calculation bugs: These bugs are usually mathematical errors causing incorrect results.
  • Load Condition Bugs: A bug like this does not allow multiple users. The user-accepted data is not allowed.
  • Race Condition Bugs: This type of bug interferes with your system’s ability to function properly and causes it to crash or hang.
  • ECP (Equivalence Class Partitioning) Bug: A bug of this type results in invalid types.
  • Version Control Bugs: Regression Testing is where these kinds of bugs normally occur and does not provide version details.
  • Hardware Bugs: This type of bug prevents the device from responding to an application as expected.
  • Help Source Bugs: The help documentation will be incorrect due to this bug.

578. Can you define cubes and OLAP cubes?

你能定义立方体和OLAP立方体吗?
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab3ed | 官方: 否 | 付费: 否

答案:

The cube is one of the things on which data processing relies heavily. In their simplest form, cubes are just data processing units that contain dimensions and fact tables from the Data warehouse. It provides clients with a multidimensional view of data, querying, and analysis capabilities.

立方体是数据处理高度依赖的对象之一。在其最简单的形式中,立方体只是包含数据仓库中维度和事实表的数据处理单元。它为客户提供数据的多维视图、查询和分析能力。

On the other hand, Online Analytical Processing (OLAP) is software that allows you to analyze data from several databases at the same time. For reporting purposes, an OLAP cube can be used to store data in the multidimensional form. With the cubes, creating and viewing reports becomes easier, as well as smoothing and improving the reporting process. The end users are responsible for managing and maintaining these cubes, who have to manually update their data.

另一方面,联机分析处理(OLAP)是一种允许你同时分析多个数据库数据的软件。出于报告目的,OLAP立方体可用于以多维形式存储数据。使用立方体,创建和查看报告变得更加容易,同时也能简化和改进报告流程。最终用户负责管理和维护这些立方体,他们必须手动更新其数据。

579. Explain what is fact and write its type.

解释什么是事实,并写出其类型。
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab3f0 | 官方: 否 | 付费: 否

答案:

An important aspect of data warehousing is the fact table. A fact table basically represents the measurements, metrics, or facts of a business process. In fact tables, facts are stored, and they are linked to a number of dimension tables via foreign keys. Facts are usually details and/or aggregated measurements of a business process which can be calculated and grouped to address the business question. Data schemas like the star schema or snowflake schema consist of a central fact table surrounded by several dimension tables. The measures or numbers like sales, cost, profit and loss, etc., are some examples of facts.

数据仓库的一个重要方面是事实表。事实表基本上表示业务流程的度量、指标或事实。在事实表中,事实被存储,并通过外键链接到多个维度表。事实通常是业务流程的详细信息或汇总度量,可以计算和分组以解决业务问题。像星型模式或雪花模式这样的数据模式由中央事实表和围绕它的多个维度表组成。销售额、成本、损益等度量或数字是事实的一些示例。

Fact tables have two types of columns, foreign keys and measures columns. Foreign keys store foreign keys to dimensions, while measures contain numeric facts. Other attributes can be added, depending on the business need and necessity.

事实表有两种类型的列:外键列和度量列。外键存储指向维度的外键,而度量包含数字事实。根据业务需求和必要性,可以添加其他属性。

Types of Facts

事实的类型

Facts can be divided into three basic types, as follows:

事实可以分为三种基本类型,如下所示:
  • Additive: Facts that are fully additive are the most flexible and useful. We can sum up additive facts across any dimension associated with the fact table.
  • Semi-additive: We can sum up semi-additive facts across some dimensions associated with the fact table, but not all.
  • Non-Additive: The Fact table contains non-additive facts, which cannot be summed up for any dimension. The ratio is an example of a non-additive fact.

580. Define Grain of Fact.

定义事实粒度。
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab3f3 | 官方: 否 | 付费: 否

答案:

Accordingly, grain fact refers to the level of storing fact information. Alternatively, it is known as Fact Granularity.

相应地,事实粒度指的是事实信息存储的级别。它也被称为事实粒度。

581. What do you mean by ODS (Operational data store)?

你所说的ODS(操作数据存储)是什么意思?
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab3f6 | 官方: 否 | 付费: 否

答案:

Between the staging area and the Data Warehouse, ODS serves as a repository for data. Upon inserting the data into ODS, ODS will load all the data into the EDW (Enterprise data warehouse). The benefits of ODS mainly pertain to business operations, as it presents current, clean data from multiple sources in one place. Unlike other databases, an ODS database is read-only, and customers cannot update it.

在暂存区和数据仓库之间,ODS充当数据的存储库。将数据插入ODS后,ODS会将所有数据加载到EDW(企业数据仓库)中。ODS的好处主要涉及业务运营,因为它在单一位置展示来自多个来源的当前、干净的数据。与其他数据库不同,ODS数据库是只读的,客户不能更新它。

582. What do you mean by staging area and write its main purpose?

你所说的暂存区是什么意思,并写出其主要目的?
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab3f9 | 官方: 否 | 付费: 否

答案:

During the extract, transform, and load (ETL) process, a staging area or landing zone is used as an intermediate storage area. It serves as a temporary storage area between data sources and data warehouses. Staging areas are primarily used to extract data quickly from their respective data sources, therefore minimizing the impact of those sources. Using the staging area, data is combined from multiple data sources, transformed, validated, and cleaned after data has been loaded.

在提取、转换和加载(ETL)过程中,暂存区或着陆区用作中间存储区域。它是数据源和数据仓库之间的临时存储区域。暂存区主要用于快速从各自的数据源提取数据,从而最小化这些数据源的影响。使用暂存区,在数据加载后,来自多个数据源的数据被合并、转换、验证和清理。

583. Explain the Snowflake schema.

解释雪花模式。
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab3fc | 官方: 否 | 付费: 否

答案:

Adding additional dimension tables to a Star Schema makes it a Snowflake Schema. In the Snowflake schema model, multiple hierarchies of dimension tables surround a central fact table. Alternatively, a dimension table is called a snowflake if its low-cardinality attribute has been segmented into separate normalized tables. These normalized tables are then joined with referential constraints (foreign key constraints) to the original dimensions table. Snowflake schema complexity increases linearly with the level of hierarchy in the dimension tables.

向星型模式添加额外的维度表会使其成为雪花模式。在雪花模式模型中,多个维度表层级围绕一个中心事实表。或者,如果维度表的低基数属性被分割成独立的规范化表,则该维度表被称为雪花。这些规范化表随后通过参照约束(外键约束)连接到原始维度表。雪花模式的复杂性随维度表层级水平线性增加。

Advantages - Data integrity is reduced because of structured data.

优点 - 由于结构化数据,数据完整性降低。
  • Data are highly structured, so it requires little disk space.
  • Updating or maintaining Snowflaking tables is easy.
    Disadvantages - Snowflake reduces the space consumed by dimension tables, but the space saved is usually insignificant compared with the entire data warehouse.

    缺点 - 雪花模式减少了维度表占用的空间,但相对于整个数据仓库,节省的空间通常微不足道。
  • Due to the number of tables added, you may need complex joins to perform a query, which will reduce query performance.

584. Explain what you mean by Bus Schema.

请解释你所说的总线模式是什么意思。
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab3ff | 官方: 否 | 付费: 否

答案:

An important part of ETL is dimension identification, and this is largely done by the Bus Schema. A BUS schema is actually comprised of a suite of verified dimensions and uniform definitions and can be used for handling dimension identification across all businesses. To put it another way, the bus schema identifies the common dimensions and facts across all the data marts of an organization just like identifying conforming dimensions (dimensions with the same information/meaning when being referred to different fact tables). Using the Bus schema, information is given in a standard format with precise dimensions in ETL.

ETL的一个重要部分是维度识别,这主要由总线模式完成。总线模式实际上由一组经过验证的维度和统一定义组成,可用于跨所有业务处理维度识别。换句话说,总线模式识别组织中所有数据集市中的公共维度和事实,就像识别一致性维度(在不同事实表中引用时具有相同信息或含义的维度)一样。使用总线模式,ETL中以标准格式提供具有精确维度的信息。

585. What do you mean by schema objects?

你所说的模式对象是什么意思?
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab402 | 官方: 否 | 付费: 否

答案:

Generally, a schema comprises a set of database objects, such as tables, views, indexes, clusters, database links, and synonyms, etc. This is a logical description or structure of the database. Schema objects can be arranged in various ways in schema models designed for data warehousing. Star and snowflake schemas are two examples of data warehouse schema models.

通常,模式由一组数据库对象组成,如表、视图、索引、簇、数据库链接和同义词等。这是数据库的逻辑描述或结构。在为数据仓库设计的模式模型中,模式对象可以以各种方式排列。星型和雪花模式是数据仓库模式模型的两个示例。

586. What is the benefit of using a Data reader destination adapter?

使用数据读取器目标适配器有什么好处?
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab405 | 官方: 否 | 付费: 否

答案:

ADO Recordset holds a collection of records (records and columns) from a database table. The Data Reader Destination Adapter is very useful when it comes to populating them in a simple manner. Using the ADO.NET DataReader interface, it exposes the data in a data flow for other applications to consume it.

ADO记录集保存来自数据库表的记录集合(记录和列)。数据读取器目标适配器在以简单方式填充它们时非常有用。通过使用ADO.NET DataReader接口,它在数据流中公开数据,供其他应用程序使用。

587. What do you mean by factless table?

你所说的无事实表是什么意思?
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab408 | 官方: 否 | 付费: 否

答案:

Factless tables do not contain any facts or measures. It contains only dimensional keys and deals with event occurrences at the informational level but not at the calculational level. As the name implies, factless fact tables capture relationships between dimensions but lack any numerical or textual data. Factual fact tables can be categorized into two categories: one that describes events, and the other one that describes conditions. Both may have a significant impact on your dimensional modeling.

无事实表不包含任何事实或度量。它仅包含维度键,并在信息层面处理事件发生,而不在计算层面处理。顾名思义,无事实事实表捕获维度之间的关系,但缺乏任何数值或文本数据。事实性事实表可分为两类:一类描述事件,另一类描述条件。两者都可能对维度建模产生重大影响。

588. Explain SCD (Slowly Change Dimension).

解释SCD(缓慢变化维度)。
  • 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37aec58d557c902bab40b | 官方: 否 | 付费: 否

答案:

SCD (Slowly Changing Dimensions) basically keep and manage both current and historical data in a data warehouse over time. Rather than changing regularly on a time-based schedule, SCD changes slowly over time. SCD is considered one of the most critical aspects of ETL.

SCD(缓慢变化维度)基本上随时间在数据仓库中保留和管理当前及历史数据。SCD不会按基于时间的定期计划频繁变化,而是随时间缓慢变化。SCD被认为是ETL中最关键的方面之一。

589. Difference between Retesting and Regression testing.

重测试和回归测试之间的区别。
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babd9c | 官方: 否 | 付费: 否

答案:

Regression testing differs from re-testing in the following ways:

回归测试在以下方面不同于重测试:
Retesting
重测试
Regression Testing
回归测试
During retesting, testers make sure that all test cases that failed during the last execution are passed after the defects are fixed.
在重测试期间,测试人员确保上次执行中失败的所有测试用例在缺陷修复后都能通过。
This type of testing makes sure that alterations to the code won't affect the system's functionality.
这种类型的测试确保代码的更改不会影响系统的功能。
Upon fixing the defects, re-testing is carried out.
修复缺陷后,进行重测试。
The purpose of this test is to ensure that adding fresh code, improvements, or fixing bugs does not cause instability or compromise the software functionality.
此测试的目的是确保添加新代码、改进或修复错误不会导致不稳定或损害软件功能。
Retesting involves defect verification.
重测试涉及缺陷验证。
Regression testing does not include defect verification.
回归测试不包括缺陷验证。
Retesting cannot be automated.
重测试无法自动化。
Regression testing can be automated because it is time-consuming and expensive to do manually.
回归测试可以自动化,因为手动执行耗时且昂贵。
Test cases that failed generically are subjected to this type of testing.
通常适用于失败的测试用例。
Test cases that pass generically are subjected to this type of testing.
通常适用于通过的测试用例。

590. What test cases are to be automated?

哪些测试用例需要自动化?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babd9f | 官方: 否 | 付费: 否

答案:

Automation enables the avoidance of repetitive manual work, faster feedback, and a reduction of time spent running tests repeatedly. Despite this, automated testing cannot cover all test cases, so determining which test cases to automate is important.

自动化能够避免重复性手动工作、加快反馈速度并减少重复运行测试所花费的时间。尽管如此,自动化测试无法覆盖所有测试用例,因此确定哪些测试用例需要自动化非常重要。

It can be difficult, however, to figure out which tests need to be automated since it is pretty much dependent on the functionality of the software product. Here are some of the parameters to select test cases for automated testing. - Different data set for the test case.

然而,由于这很大程度上取决于软件产品的功能,确定哪些测试需要自动化可能很困难。以下是一些用于选择自动化测试用例的参数。- 测试用例的不同数据集。
  • Execution of a test case with a different browser.
  • Execution of test cases in different environments.
  • Execution of a test case with complex business logic.
  • Execution of the test case with different users.
  • Test case with a lot of data, etc.
    Conclusion:

    结论:

Functional testing is a quality assurance procedure used to evaluate whether a software application or component conforms with its stated functional requirements. It is clear that functional testing is essential to building a top-quality software product.

功能测试是一种质量保证程序,用于评估软件应用程序或组件是否符合其声明的功能需求。显然,功能测试对于构建高质量的软件产品至关重要。

The purpose of functional testing interviews is to assess candidates' skill sets and determine whether they are suited for the position. Throughout this article, we've covered 30+ functional testing interview questions with answers, which will help you nail the interview. Hopefully, you found the article informative and helpful.

功能测试面试的目的是评估候选人的技能水平,并确定他们是否适合该职位。在本文中,我们涵盖了30多个功能测试面试问题及答案,这将帮助您顺利通过面试。希望您觉得本文信息丰富且有用。

Useful Resources: - Automation Testing Interview Questions

有用资源:- 自动化测试面试问题
  • Manual Testing Interview Questions
  • API Testing Interview Questions
  • Database Testing Interview Questions
  • Performance Testing Interview Questions
  • Mobile App Testing Interview Questions

591. What do you mean by Defect Severity and Defect Priority?

缺陷严重性和缺陷优先级是什么意思?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babda2 | 官方: 否 | 付费: 否

答案:

Defect Severity: This is the degree or extent to which a defect impacts the application being tested. The severity of the defect is a measure of its impact on the software's functionality. A defect with a higher severity level will have a greater impact on the application. Defect severity is classified into four categories:

缺陷严重性:这是缺陷对被测应用程序影响的程度或范围。缺陷的严重性是衡量其对软件功能影响的指标。严重性级别较高的缺陷将对应用程序产生更大的影响。缺陷严重性分为四个类别:
  • Critical
  • Major
  • Medium
  • Low

Defect priority: It is a parameter determining the order in which defects must be fixed. A high priority defect will more likely result in an unusable or stuck application, and it should be corrected as soon as possible. Defect priority is classified into three categories:

缺陷优先级:这是一个确定缺陷必须修复顺序的参数。高优先级的缺陷更可能导致应用程序不可用或卡住,应尽快修复。缺陷优先级分为三个类别:
  • High
  • Medium
  • Low

592. What do you understand by the term accessibility testing?

你理解的可访问性测试是什么意思?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babda5 | 官方: 否 | 付费: 否

答案:

Accessibility Testing refers to the process of testing the usability of a software application by ensuring that it can be accessed by people with all abilities and disabilities. The intent of this testing is to verify both the usability and the accessibility of the application. The accessibility of the application should allow for people with all types of disabilities including: - Visual Impairments

可访问性测试是指通过确保软件应用程序能够被各种能力和残疾人士访问,来测试其可用性的过程。此测试的目的是验证应用程序的可用性和可访问性。应用程序的可访问性应允许所有类型的残疾人士使用,包括:- 视觉障碍
  • Physical Impairment
  • Hearing Impairment
  • Cognitive Impairment
  • Learning Impairment
    In the present scenario, the web has acquired a major position in our lives with e-commerce sites, e-learning, e-payments, etc. Therefore, everyone should be able to use technology to a greater degree, especially people with disabilities. Accessibility testing can be performed both manually and automatically.

    在当前情况下,网络通过电子商务网站、电子学习、电子支付等在我们的生活中占据了重要地位。因此,每个人都应该更大程度地使用技术,尤其是残疾人士。可访问性测试可以手动和自动执行。

593. What is build acceptance testing?

什么是构建验收测试?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babda8 | 官方: 否 | 付费: 否

答案:

BAT (Build Acceptance Testing), also known as BVT (Build Verification Testing), is a type of software testing intended to ensure the most important functions are working properly when new code is implemented. Based on the results of this testing, a software build can be considered stable enough to continue for further testing. Basically, it's a set of tests that are run on each new build in order to verify that it conforms to the requirements of the build before sending it to the testing team for further examination. BAT processes are typically automated. In the event BAT fails, then that build will be assigned to a developer for the fix once again. Advantages: - Enhanced coverage and efficiency of testing.

BAT(构建验收测试),也称为BVT(构建验证测试),是一种软件测试类型,旨在确保新代码实现时最重要的功能正常工作。基于此测试的结果,软件构建可以被视为足够稳定,可以继续进一步测试。基本上,它是在每个新构建上运行的一组测试,以在将构建发送给测试团队进行进一步检查之前,验证其是否满足构建要求。BAT流程通常是自动化的。如果BAT失败,则该构建将再次分配给开发人员进行修复。优点:- 增强测试覆盖率和效率。
  • Testers are less concerned with the possibility of unstable builds.
  • All builds are tested daily, so any major issues can be caught early.
  • Testing is automated, so there is no need for manual intervention.

594. Why automate functional tests? What should we look for while choosing the right automation tool?

为什么要自动化功能测试?选择正确的自动化工具时应该注意什么?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37afb58d557c902babdab | 官方: 否 | 付费: 否

答案:

Automating functional tests can certainly save time and effort. Testing can be done continuously without human intervention. Furthermore, human errors can be reduced, which prevents bugs from slipping through the test phase. It is especially useful during the development phase because it helps you find bugs and problems earlier, increasing your team's efficiency. As there are various automation tools available, it is essential to identify the right automation tool for the job. Now the question is how do you choose the right automation tool? The following points should be taken into account when choosing an automation tool. - All members of your QA team should be able to use the tool easily.

自动化功能测试确实可以节省时间和精力。测试可以在无需人工干预的情况下持续进行。此外,可以减少人为错误,从而防止缺陷在测试阶段漏掉。这在开发阶段尤其有用,因为它有助于更早发现问题,提高团队效率。由于有各种自动化工具可用,因此确定适合工作的正确自动化工具至关重要。现在的问题是如何选择正确的自动化工具?选择自动化工具时应考虑以下几点。- 您的QA团队的所有成员应能轻松使用该工具。
  • It must be able to operate in different environments seamlessly.
  • The tool should support the reusability of test cases in case the UI is changed.
  • Ensure that it has features specific to your team's needs. If, for instance, your testing team needs specific reporting or logging, or if it needs to use different scripting languages, then the tool must have these features as well.

595. Explain what are functional test cases.

解释什么是功能测试用例。
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37afb58d557c902babdae | 官方: 否 | 付费: 否

答案:

Every feature/function of a piece of software should be tested thoroughly before it's released, and many of them should be continually tested. The functional test cases are the documents written by QA managers for the purpose of conducting functional testing. Functional test cases inspect the software's functionality across a range of actions or conditions to ensure the desired outcome. Following are the features of a functional test case: - Name or description of the function/feature.

软件中的每个功能/特性在发布前都应进行彻底测试,并且其中许多功能应持续测试。功能测试用例是由QA经理撰写的文档,用于执行功能测试。功能测试用例检查软件在一系列操作或条件下的功能,以确保达到预期结果。以下是功能测试用例的特征:- 功能/特性的名称或描述。
  • The preconditions for testing.
  • The steps needed to test.
  • The expected outcome/result.
    All of these provide the tester with everything they need to satisfy the test case requirements. It is also a good idea to write the location of the function in the description section, especially if the app is very large and complex, or if the same function is found in some different areas of the app.

    所有这些都为测试人员提供了满足测试用例要求所需的全部信息。在描述部分写明功能的位置也是一个好主意,特别是当应用程序非常大且复杂时,或者当同一功能在应用程序的不同区域出现时。

596. How should Test Cases be written? What are the important points to consider?

测试用例应如何编写?需要考虑哪些重要要点?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babdb1 | 官方: 否 | 付费: 否

答案:

Having understood what functional test cases are, let's take a look at how they're written. Below is a list of points you should consider while writing test cases: - The first step is to have a broad overview of the testing project and determine what should be tested.

在理解了功能测试用例是什么之后,让我们来看看它们是如何编写的。以下是编写测试用例时应考虑的一系列要点:- 第一步是对测试项目有一个广泛的概览,并确定应测试的内容。
  • Now it’s time to write the test cases. Before writing test cases, it is important to understand the client's requirements clearly. According to the requirement document specifications, every functional and nonfunctional requirement should be covered, from UI interfaces to compatibility. Normally, a traceability matrix is maintained to ensure that all requirements are implemented and tested.
  • It is a good idea to periodically check test cases to ensure that they are not redundant.
  • While writing a test case, priority is an important consideration. In this way, the tester is able to begin testing the application with the high priority test cases, followed by the medium and then the low priority test cases.
  • Test cases should be written in a simple language and in a structure that is easy to understand. For test cases, the input data values should be valid and within a wide range.

597. List out some examples of functional test cases.

列出一些功能测试用例的示例。
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37afb58d557c902babdb4 | 官方: 否 | 付费: 否

答案:

Here is an example of functional test cases: - The new task to be assigned: Consider the case of assigning a new task to an appropriate user.

以下是功能测试用例的示例:- 分配新任务:考虑将新任务分配给适当用户的情况。
  • Description: Create a new task and assign it to an appropriate user.
  • Preconditions: When the user gets assigned, he/she should be enabled to receive email notifications.
  • Steps:
    Create two separate user profiles, each with an email address. Create a new task using one of the accounts. Assign the task to your other user account. - Expected result: The user should receive an email confirming that they are assigned a task.

    创建两个单独的用户配置文件,每个包含一个电子邮件地址。使用其中一个账户创建新任务。将任务分配给您的另一个用户账户。- 预期结果:用户应收到一封确认其被分配任务的电子邮件。

598. What are some possible login features that need to be tested in any Web application?

在任何Web应用程序中,需要测试哪些可能的登录功能?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babdb7 | 官方: 否 | 付费: 否

答案:

Listed below are the possible scenarios you can use to test an application's login feature: - Input fields, such as username and password, should be validated both with valid and invalid values.

下面列出了可用于测试应用程序登录功能的可能场景:- 输入字段(如用户名和密码)应使用有效和无效值进行验证。
  • You can also try entering a valid email address with an incorrect/invalid password, as well as entering an invalid email address with a valid password. Verify that a proper error message appears.
  • Get logged in to the application by entering valid credentials. Check if you are still logged in by closing and reopening the browser.
  • Once the user has logged in, navigate again to the login page to see whether he or she needs to log in again.
  • If you are signed in through one browser, open the application through another browser to verify that you are signed in through the other browser.
  • You should change your password after logging into the application and then try to login again with the old password.

599. What is the best way to ensure functional test cases cover all product areas?

确保功能测试用例覆盖所有产品领域的最佳方法是什么?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37afb58d557c902babdba | 官方: 否 | 付费: 否

答案:

The most likely scenario is that you need to conduct regression testing in order to cover parts of the product that may be impacted by any new updates or product releases. The tester, in addition to testing the product's core features or functionality, should also list any areas that are affected by this function or prone to breaking due to high usage and complexity of coding.

最可能的情况是,您需要进行回归测试,以覆盖可能受任何新更新或产品发布影响的产品部分。测试人员除了测试产品的核心功能或特性外,还应列出受此功能影响或因高使用率和代码复杂性而容易出错的任何领域。

In order to get a fresh perspective on test coverage, test cycles should be scheduled over two or three days. When strategizing and writing test cases, testers should open the app so they can ensure they aren't overlooking a function or feature they would have missed otherwise.

为了获得测试覆盖范围的新视角,测试周期应安排在两到三天内。在制定策略和编写测试用例时,测试人员应打开应用程序,以确保他们没有遗漏本可能错过的功能或特性。

600. Why is RTM (Requirement Traceability Matrix) important?

为什么RTM(需求可追溯性矩阵)很重要?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babdbd | 官方: 否 | 付费: 否

答案:

Each tester should be responsible for understanding the client's requirements and ensuring that the output product is error-free. To accomplish this goal, the QA team must create test cases after thoroughly analyzing the requirements. As a result, the client's software requirements need to be divided further into different scenarios and finally into test cases. Each of these cases needs to be tested separately.

每位测试人员应负责理解客户需求,并确保输出产品无错误。为了实现这一目标,QA团队必须在彻底分析需求后创建测试用例。因此,客户软件需求需要进一步划分为不同场景,最终转化为测试用例。这些用例每个都需要单独测试。

Here is a question: how can one make sure that the requirement is tested in all possible scenarios? Are any requirements left out of the testing process?

这里有一个问题:如何确保需求在所有可能场景下都被测试?是否有任何需求被排除在测试过程之外?

The simplest way is to trace the requirements to their corresponding test cases and scenarios and it is termed as ‘Requirement Traceability Matrix.’ Typically, the traceability matrix is a worksheet that contains the requirements and their associated test cases and scenarios as well as the current status of those tests, whether they were successfully executed or not. This will aid the testing team in understanding the extent to which testing has been done for the specific product.

最简单的方式是将需求追溯到对应的测试用例和场景,这被称为“需求可追溯性矩阵”。通常,可追溯性矩阵是一个工作表,包含需求及其相关的测试用例和场景,以及这些测试的当前状态,即是否成功执行。这将帮助测试团队了解针对特定产品已完成测试的程度。

For example, The following is an example of different test cases that have different requirements to be tested. A matrix shows the requirements as columns on top and the test data as rows. The "X" here indicates which test cases relate to which requirements.

例如,下面是一个包含不同测试用例且各有不同待测需求的示例。矩阵将需求作为顶部列,测试数据作为行。这里的“X”表示哪些测试用例与哪些需求相关。

601. What is RTM (Requirement Traceability Matrix)

什么是RTM(需求可追溯性矩阵)
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babdc0 | 官方: 否 | 付费: 否

答案:

The Requirement Traceability Matrix, or RTM, is a tool that keeps track of requirements as a system or application progress through a testing process. As soon as the requirements document is received, the RTM is created and maintained until the system or application is released. RTM is used to ensure that all requirements in the requirements specification have been implemented before the release of the system.

需求可追溯性矩阵,或称为RTM,是一种工具,用于在系统或应用程序通过测试过程时跟踪需求。一旦收到需求文档,RTM即被创建并维护,直到系统或应用程序发布。RTM用于确保需求规格说明中的所有需求在系统发布前都已被实施。

602. Explain Smoke testing and Sanity testing.

解释冒烟测试和健全性测试。
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babdc5 | 官方: 否 | 付费: 否

答案:

  • Smoke testing: This test only examines the basic functionality of a system to ensure the software works properly (or is not plagued with too many problems) so that the next test can proceed.
  • Sanity testing: This type of testing is also known as a build-verification test and is usually performed after a smoke test. The testing is performed after a complete software build with minor changes is released to verify that the code changes introduced continue to work as intended.

Smoke vs Sanity Testing: Learn More

冒烟测试与健全性测试:了解更多
Smoke Testing
冒烟测试
Sanity Testing
健全性测试
Smoke testing is done to assure that the acute functionalities of the program are working fine.
冒烟测试确保程序的关键功能运行正常。
After receiving a software build that has undergone minor code or functionality changes, sanity testing is conducted to ensure that bugs have been fixed and that there are no further problems that can be introduced by the changes.
在收到经过小幅代码或功能变更的软件构建后,进行健全性测试以确保已修复缺陷且变更不会引入进一步问题。
It is possible to perform smoke testing manually or with the help of automation tools.
冒烟测试可以手动执行或借助自动化工具执行。
It is common to perform sanity testing manually, not through automation.
健全性测试通常手动执行,而非通过自动化。
Both developers and testers perform smoke testing.
开发人员和测试人员都会执行冒烟测试。
Testers perform sanity testing.
测试人员执行健全性测试。
There is documentation or scripting for smoke testing.
冒烟测试有文档或脚本记录。
There is no documentation for sanity testing.
健全性测试没有文档记录。

603. What do you mean by Data-driven testing?

数据驱动测试是什么意思?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babdca | 官方: 否 | 付费: 否

答案:

A data-driven testing approach is a method of functional testing where a series of test scripts are executed repeatedly with the use of data sources like Excel, CSV files, Spreadsheets, XML files, and SQL databases. Data sources like these are used as inputs for generating output. Next, the output is compared to what was expected to verify the system or software.

数据驱动测试方法是一种功能测试方法,其中一系列测试脚本使用如Excel、CSV文件、电子表格、XML文件和SQL数据库等数据源重复执行。此类数据源作为输入用于生成输出。接着,将输出与预期结果进行比较以验证系统或软件。

A data-driven approach is preferable because testers often have multiple data sets for a single test, and it can be time-consuming to create individual tests for each data set. By using data-driven testing, data and test scripts can be separated, and the same test script can be run for different combinations of input data, resulting in efficient testing results.

数据驱动方法更受欢迎,因为测试人员通常对单个测试有多个数据集,而为每个数据集创建单独测试可能耗时。通过使用数据驱动测试,数据和测试脚本可以分离,并且同一测试脚本可以针对不同的输入数据组合运行,从而获得高效的测试结果。

Example: Let's assume we want to test the login system with 100 different data sets and multiple input fields. We can have the below three approaches: - Approach 1: Write 100 scripts, one for each dataset, and run each test individually.

示例:假设我们要使用100个不同的数据集和多个输入字段测试登录系统。我们可以有以下三种方法:- 方法1:编写100个脚本,每个数据集一个,并单独运行每个测试。
  • Approach 2: Change the value in the script manually and run it several times.
  • Approach 3: Import Excel data and pull test data one by one from Excel rows, and then run the script.
    The first two scenarios listed are arduous and time-consuming. As a result, it would be best to utilize the third approach (data-driven testing).

    前面列出的前两个场景既费力又耗时。因此,最好采用第三种方法(数据驱动测试)。

604. What do you mean by UFT (Unified Functional Testing)?

UFT(统一功能测试)是什么意思?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37afb58d557c902babdcd | 官方: 否 | 付费: 否

答案:

UFT ( Unified Functional Testing ), also known as QTP (QuickTest Professional), is an automated functional testing tool that helps testers to conduct automated tests to identify errors, defects, and other deviations from the expected behaviour of a software application. - Specifically, it is used for functional, regression, and service testing.

UFT(统一功能测试),也称为QTP(QuickTest Professional),是一种自动化功能测试工具,帮助测试人员执行自动化测试以识别错误、缺陷以及其他偏离软件应用程序预期行为的情况。- 具体来说,它用于功能、回归和服务测试。
  • This tool runs UI-based test cases and also automated non-UI test cases, such as database testing and file operations.
  • It is compatible with Windows platforms and multiple browsers like Firefox, Chrome, etc.
  • It supports a wide variety of software development environments, including SAP, Oracle, etc.
  • Also, it allows for Quality Assurance checks to be run on the software being tested.
  • This tool provides easy navigation, validation of results, and report generation. etc.

605. State difference between functional and structural testing.

说明功能测试和结构测试之间的区别。
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37afb58d557c902babdd0 | 官方: 否 | 付费: 否

答案:

Functional testing differs from structural testing in the following ways:

功能测试与结构测试在以下方面有所不同:
Functional Testing
功能测试
Structural Testing
结构测试
The purpose of functional testing is not only to validate a software system or component against the various functional specifications and requirements defined but also to verify whether it is ready to be deployed into the live environment.
功能测试的目的不仅是根据定义的各种功能规格和需求来验证软件系统或组件,还要确认其是否已准备好部署到实际运行环境中。
This test evaluates a software's internal design or the structure of its code. It is also called white-box testing, clear box testing, or glass box testing.
该测试评估软件的内部设计或其代码结构,也称为白盒测试、透明盒测试或玻璃盒测试。
Functional testing is a black-box test since no knowledge of the internal logic of the system is used to create test cases.
功能测试是一种黑盒测试,因为创建测试用例时不使用系统内部逻辑的知识。
Structured testing demands fundamental knowledge of a programming language, as opposed to functional testing. In order to implement structural testing, the test engineer should have thorough knowledge of the code's internal execution and the software's implementation.
与功能测试不同,结构测试要求具备编程语言的基础知识。为了实施结构测试,测试工程师应深入了解代码的内部执行和软件的实现方式。
Some types of functional testing include system testing, regression testing, sanity testing, and user acceptance testing.
功能测试的某些类型包括系统测试、回归测试、健全性测试和用户验收测试。
Among the structural testing techniques are path testing, code coverage testing, logic testing, etc.
结构测试技术包括路径测试、代码覆盖率测试、逻辑测试等。

606. What do you mean by boundary value analysis?

你所说的边界值分析是什么意思?
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babdd3 | 官方: 否 | 付费: 否

答案:

The boundary value analysis is a technique for testing the boundary value of an equivalence class partition. A boundary value analysis identifies errors at the boundaries, opposed to within ranges in equivalence partitioning.

边界值分析是一种测试等价类划分边界值的技术。边界值分析识别边界处的错误,而不是等价划分中的范围内错误。

Example: Consider an input field in an application that can accept a minimum of 5 characters and a maximum of 10 characters. We were able to split our test cases into three equivalence classes composed of invalid and valid input. Then 5-10 is considered as valid and 10 is considered as invalid.

示例:考虑应用程序中的一个输入字段,它可以接受最少5个字符和最多10个字符。我们能够将测试用例分为三个等价类,由无效和有效输入组成。然后5-10被视为有效,而10被视为无效。

Test cases for application input field accepting numbers between 5-10 using boundary value analysis: - The valid partition: Between values 5-10 (For this test case, we will use the same test data as the input boundaries of the input domain, namely values 5 and 10).

使用边界值分析对接受5-10之间数字的应用程序输入字段的测试用例: - 有效分区:介于值5-10之间(对于此测试用例,我们将使用与输入域输入边界相同的测试数据,即值5和10)。
  • The first invalid partition: 10 (The test data value for this case will be just above the edge/boundary of the input domain, i.e., value 11).

607. Explain equivalence partitioning.

解释等价类划分。
  • 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37afb58d557c902babdd6 | 官方: 否 | 付费: 否

答案:

Equivalence Partitioning is also called Equivalence Class Partitioning (ECP) and is a form of black-box testing. In this method, input domain data is divided into equivalence classes (partitions) and test cases are derived using these classes of data. Then, while testing, one sample value is picked from each class. By using this method, test cases are generally reduced to a finite set of testable cases that still cover the maximum requirements.

等价类划分也称为等价分类(ECP),是黑盒测试的一种形式。在此方法中,输入域数据被划分为等价类(分区),并使用这些类别的数据推导测试用例。然后,在测试时,从每个类中选取一个样本值。通过使用此方法,测试用例通常被缩减为有限的可用测试集,仍能覆盖最大需求。

A technique of equivalence partitioning is applied only when input data values can be divided into ranges. For each range partition, only one condition will be tested, assuming that all other conditions within the same partition will behave similarly.

等价类划分技术仅在输入数据值可以划分为范围时应用。对于每个范围分区,只测试一个条件,假设同一分区内的所有其他条件行为相似。

Example: Let's say you have an input field that can accept only percentage values between 50 and 90%. In that case, it would be pointless to write thousands of test cases for 50-90 valid input numbers, plus others for invalid data.

示例:假设你有一个输入字段,只接受50%到90%之间的百分比值。在这种情况下,为50-90有效输入数字编写数千个测试用例,再加上无效数据的测试用例,是没有意义的。

The Equivalence Partitioning method outlined above can be used to divide test cases into three classes of input data. Each test case represents a class. As you can see, in the example provided above, we were able to split our test cases into three equivalence classes (can be more) composed of invalid and valid inputs.

上面概述的等价类划分方法可用于将测试用例划分为三类输入数据。每个测试用例代表一个类。如你所见,在上面提供的示例中,我们能够将测试用例分为三个等价类(可能更多),由无效和有效输入组成。

Test cases for input box accepting percentages between 50 and 90 using equivalence partitioning:

使用等价类划分对接受50%到90%之间百分比的输入框的测试用例:
  • The valid partition: Between 50%-90% (The expectation is that the text field would handle all input percentages between 50%-90%, the same way).
  • The first invalid partition: = 90% (We’d expect the text field to reject all values greater than or equal to 90%).

608. How is Ultimate thread group different from other thread groups?

Ultimate 线程组与其他线程组有何不同?
  • 知识点: 测试 / 行为与软技能 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb103c | 官方: 否 | 付费: 否

答案:

Multiple thread groups are provided, each of which can be set to imitate how users interact with the app, how the load is sustained, and for how long. The Arrivals Thread Group is the beginning of thread iteration. It defines the schedule of the load. The Concurrency Thread group is likewise appropriate for goal-oriented scenarios, but the purpose here is to manage the number of concurrent users over time. Freedom Arrivals Thread Group resembles the Arrivals Thread group, the difference being that this thread group does not have choices for ramp-up time and steps. The Stepping Thread Group is an older version of the Concurrency Thread Group that takes a little more configuration. The ultimate result is essentially the same; the main difference is in the ramp-up and ramp-down phases.

提供了多个线程组,每个线程组都可以设置为模拟用户如何与应用交互、负载如何持续以及持续多久。Arrivals 线程组是线程迭代的开始,它定义了负载的调度。Concurrency 线程组同样适用于目标导向场景,但这里的目的是随时间管理并发用户数。Freedom Arrivals 线程组类似于 Arrivals 线程组,区别在于该线程组没有 ramp-up 时间和步进选项。Stepping 线程组是 Concurrency 线程组的旧版本,需要稍多的配置。最终结果基本相同;主要区别在于 ramp-up 和 ramp-down 阶段。

The ultimate thread group is highly customizable, and unlike the arrivals, freeform, and concurrency thread groups, it kills active threads when the set time runs out. As users exit the application tab or browser, this would convert into real-world user behaviour. Because the ramp-down is controlled by the thread group rather than the execution time of individual threads, the preview graph depicting the expected simultaneous users will be extremely accurate. In the case where one thread has completed execution, the thread group also starts a new thread to keep the thread count up.

Ultimate 线程组高度可定制,与 arrivals、freeform 和 concurrency 线程组不同,当设定时间用完时,它会终止活动线程。当用户退出应用标签页或浏览器时,这会转化为现实世界中的用户行为。由于 ramp-down 由线程组控制,而非单个线程的执行时间,因此描述预期同时用户的预览图将极为准确。在某个线程已完成执行的情况下,线程组还会启动新线程以保持线程数。

Conclusion:

结论:
We are confident that this post on JMeter interview questions has greatly enriched your knowledge of JMeter topics. A solid mastery of all of the questions provided here will enable you to confidently crack any interview. Happy learning!
我们相信这篇关于 JMeter 面试问题的文章极大地丰富了你对 JMeter 主题的知识。熟练掌握此处提供的所有问题将使你能够自信地应对任何面试。祝学习愉快!

Resources

资源
  • Best Performance Testing Tools
  • Top API Testing Tools
  • Top Manual Testing Tools
  • Software Testing Interview Questions
  • API Testing Interview Questions
  • Postman Interview Questions
  • REST API Interview Questions
  • JDBC Interview Questions
  • QA Interview Questions

609. In JMeter, what are the different sorts of controllers?

在 JMeter 中,有哪些不同类型的控制器?
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb1041 | 官方: 否 | 付费: 否

答案:

In JMeter, controllers are used to regulating the flow of request execution. They allow you to specify the order in which requests are processed in a Thread. It allows you to choose "when" a user request is sent to a web server. They choose the sequence in which user requests are processed.

在 JMeter 中,控制器用于调节请求执行的流程。它们允许你指定线程中请求处理的顺序,让你可以选择用户请求“何时”发送到 Web 服务器。它们决定了用户请求被处理的顺序。

Some controllers used in JMeter are listed below: - Recording controller- JMeter has the ability to record your testing steps; a recording controller is a container for these recordings.

下面列出了 JMeter 中使用的一些控制器:- 录制控制器 - JMeter 有能力录制你的测试步骤;录制控制器是这些录制的容器。
  • IF controller- IF Controller decides whether or not to run a batch of child samplers based on particular criteria.
  • While controller- The JMeter While Controller basically runs child Samplers and keeps running until the condition in the condition field becomes false.
  • Transaction controller- The Transaction Controller in JMeter is a useful tool for organising and determining how different pieces of your test will appear in a report. The Transaction Controller creates a second sample that measures the total time it takes to complete the nested test items.
  • Loop controller- The Loop Controller causes the user request to be repeated a given number of times or to be repeated indefinitely.
  • Simple controller- Simple Controller is a container for user requests.
  • Module controller- Module Controller's purpose is to make JMeter more modular. Web applications, in general, are made up of small functional units (e.g., login, create account, logoff...). This capability can be saved as "modules" in Simple Controller. The Module Controller will determine which module is required to run.
  • Random Controller-In each loop period, the Random Controller causes all user requests to be processed in a random sequence.
  • Interleave Controller- Interleave Controller takes one of the user requests and makes it run in each loop of the thread.

610. What are the most significant plugins that JMeter supports?

JMeter 支持的最重要的插件有哪些?
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb1044 | 官方: 否 | 付费: 否

答案:

JMeter comes with a lot of functionality by default, but one of the best things about it is that its open-source software! As a result, any interested party can create additions to the system that will expand its capabilities and provide new features. Plugins are the name for these additions. Developers have already produced a wide range of useful plugins, which is fantastic and demonstrates the JMeter community's strength. JMeter supports a variety of plugins that aid in the generation of high-quality results.

JMeter 默认自带许多功能,但它最出色的一点在于它是开源软件!因此,任何感兴趣的人都可以为系统创建扩展,从而增强其能力并提供新功能。插件就是这些扩展的名称。开发者已经生成了各种实用的插件,这非常棒,也展示了 JMeter 社区的实力。JMeter 支持多种插件,有助于生成高质量的结果。

The important plugins that are supported are listed below: - Plugins Manager: The Plugin Manager is the most popular plugin, and for a legitimate reason: most users need to install the Plugin Manager before installing additional plugins. The most convenient approach to handle JMeter plugins is to use the Plugins Manager.

所支持的重要插件如下:- 插件管理器:插件管理器是最受欢迎的插件,原因合理:大多数用户在安装额外插件之前需要先安装插件管理器。处理 JMeter 插件最便捷的方法就是使用插件管理器。
  • Custom Thread Groups: Stepping Thread Group, Ultimate Thread Group, Concurrency Thread Group, Arrivals Thread Group, and Free-Form Arrivals Thread Group are the five thread group types added by the Custom Thread Groups plugin. These five thread groups provide you with a lot of possibilities for creating test run schedules.
  • Dummy Sampler: The Dummy Sampler simulates request and response processing without actually running the requests. The sampler's fields define the request and response data. Debugging post-processors and extractors has never been easier.
  • PerfMon (Servers Performance Monitoring): This plugin adds the PerfMon Servers Performance Monitoring listener to JMeter. This listener allows us to keep track of the servers' CPU, memory, swap, disc I/O, and network I/O.
  • Throughput Shaping Timer: The following features are added to JMeter by this plugin: Throughput Shaping Timer, Special Property Processing, and Schedule Feedback Function. These features allow us to set a test throughput limit to guarantee that we don't go above our desired throughput.
  • Basic Graphs: JMeter is extended with three listeners by the 3 Basic Graphs plugin: Active Threads Over Time, Response Times Over Time, and Transactions per Second. These listeners display information and KPIs regarding the load testing results in a graphic style, allowing you to examine the success of your performance tests and make more informed decisions about your website or app's next steps.

611. What factors influence the number of threads that should be generated per system?

哪些因素会影响每个系统应生成的线程数?
  • 知识点: 测试 / 行为与软技能 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb1047 | 官方: 否 | 付费: 否

答案:

It is dependent on the system's hardware.

这取决于系统的硬件。

On a 2-3 GHz CPU, for example, 400-600 threads can be produced. It also depends on the elements included in your test strategy. The higher the number of processors and XML processing components, the higher the CPU burden and, as a result, the fewer threads. Load testing with multiple machines is recommended for large loads.

例如,在 2-3 GHz 的 CPU 上,可以生成 400-600 个线程。这也取决于测试策略中包含的元素。处理器和 XML 处理组件的数量越多,CPU 负担就越大,因此线程数就越少。对于大负载,建议使用多台机器进行负载测试。

612. What is a Root Certificate Authority (CA) certificate?

什么是根证书颁发机构(CA)证书?
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb104a | 官方: 否 | 付费: 否

答案:

A certificate is required to authenticate HTTPS connections, which are established when the browser connects to the webserver. JMeter creates it for the purpose of intercepting SSL traffic and recording actions. This certificate must be installed on your mobile device in order to record actions via mobile. It is necessary to install the JMeter protected CA certificate in the browser before recording any secured web application with JMeter.

验证 HTTPS 连接需要证书,这些连接在浏览器连接到 Web 服务器时建立。JMeter 创建它是为了拦截 SSL 流量并记录操作。此证书必须安装在您的移动设备上,以便通过移动设备记录操作。在使用 JMeter 记录任何受保护的 Web 应用程序之前,有必要在浏览器中安装 JMeter 受保护的 CA 证书。

The HTTP(S) Test Script Recorder in JMeter can be used to record the protected online application. Certificates are used to authenticate the connection between the browser and the web server in secured (HTTPS) communications. The server presents the certificate to the browser when connecting through HTTPS. The browser verifies that the server certificate is signed by a Certificate Authority (CA) that is related to one of the browser's built-in root CAs. To intercept the HTTPS connection from the browser, JMeter must utilise its own certificate to enable encrypted connections. JMeter must effectively impersonate the target server.

可以使用 JMeter 中的 HTTP(S) 测试脚本录制器来记录受保护的在线应用程序。在受保护的(HTTPS)通信中,证书用于验证浏览器与 Web 服务器之间的连接。通过 HTTPS 连接时,服务器向浏览器呈现证书。浏览器会验证服务器证书是否由与浏览器内置根 CA 相关的证书颁发机构(CA)签名。为了拦截来自浏览器的 HTTPS 连接,JMeter 必须使用自己的证书来启用加密连接。JMeter 必须有效地模拟目标服务器。

613. Write the code to write data stored in a JMeter variable to a CSV file.

编写代码,将存储在 JMeter 变量中的数据写入 CSV 文件。
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb104d | 官方: 否 | 付费: 否

答案:

To write data to a CSV file, use the lines of code below inside a BeanShell postprocessor.

要写入数据到 CSV 文件,请在 BeanShell 后处理器中使用以下代码行。

dataString = vars.get("DataToBeWritten");

dataString = vars.get("DataToBeWritten");
filePath = vars.get("DataFilePath");
filePath = vars.get("DataFilePath");
// you should pass true if you want to append the data to an existing file
// 如果您想将数据追加到现有文件,应传入 true
// if you wish to overwrite, then do not pass the second argument
// 如果您希望覆盖,则不传第二个参数
FileWriter fstream = new FileWriter(filePath, true);
FileWriter fstream = new FileWriter(filePath, true);
BufferedWriter out = new BufferedWriter(fstream);
BufferedWriter out = new BufferedWriter(fstream);
out.write(dataString);
out.write(dataString);
out.write(System.getProperty("line.separator"));
out.write(System.getProperty("line.separator"));
out.close();
out.close();
fstream.close();
fstream.close();
In the above code, the data is written to an existing file. The path of the existing file is stored in filePath, and the data in dataString is appended to the file.
在上述代码中,数据被写入到一个已存在的文件中。该文件的路径存储在filePath中,dataString中的数据被追加到文件中。

614. What is BeanShell scripting?

什么是BeanShell脚本?
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb1050 | 官方: 否 | 付费: 否

答案:

BeanShell is one of the most advanced JMeter built-in components. BeanShell is a lightweight Java scripting language that JMeter uses to do some sophisticated tasks. With the help of coding, the BeanShell sampler can execute a variety of tasks. You can get the thread number, run the current sampler, collect the cookies, and so forth. It comprehends Java syntax and provides scripting features such as loose types, commands and method closures. BeanShell can be a wonderful solution to achieve your goals if your test case is peculiar and creating it using embedded JMeter components is nearly impossible. BeanShell entities in JMeter include accessibility both to internal JMeter APIs as well as any external classes packed into the JMeter classpath (make sure to drop appropriate jars into your JMeter installation's /lib/ext folder and place the relevant "import" statements at the top of your BeanShell scripts).

BeanShell是JMeter最先进的内置组件之一。BeanShell是一种轻量级的Java脚本语言,JMeter使用它来执行一些复杂的任务。借助编码,BeanShell采样器可以执行各种任务。您可以获取线程号、运行当前采样器、收集Cookie等等。它理解Java语法,并提供诸如松散类型、命令和方法闭包等脚本功能。如果您的测试用例特殊且使用嵌入式JMeter组件几乎不可能实现,BeanShell可能是实现目标的好解决方案。JMeter中的BeanShell实体可以访问JMeter内部API以及打包到JMeter类路径中的任何外部类(确保将适当的jar文件放入JMeter安装的/lib/ext文件夹,并在BeanShell脚本顶部放置相关的“import”语句)。

The following BeanShell-enabled components are available in all JMeter versions: - Beanshell Sampler: A sampler that can operate independently.

所有JMeter版本中以下支持BeanShell的组件均可用:- BeanShell采样器:一种可以独立运行的采样器。
  • Beanshell PreProcessor: A sampler pre-processor that operates before the sampler and can be used to establish prerequisites (i.e. to generate some input).
  • Beanshell PostProcessor: A post-processor that runs after the sampler and can be used for cleanup or recovery.
  • Beanshell Assertion: A powerful assertion that allows you to use the JMeter API completely. Java conditional logic can be used to control the outcome of the assertion.
  • __Beanshell Function: A JMeter function that permits custom BeanShell code to be executed while the sampler is running.

615. What are the crucial steps in the JDBC (Java Database Connectivity) request testing process?

JDBC(Java数据库连接)请求测试过程中的关键步骤是什么?
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb1053 | 官方: 否 | 付费: 否

答案:

JDBC requests are used to create a connection with databases and then to track query response times.

JDBC请求用于建立与数据库的连接,然后跟踪查询响应时间。

The following are important procedures to take when evaluating JDBC requests: - Setting up the Config Element, JDBC Connection setup, and adding the Database URL and JDBC Driver Class according to the database. Add the name of the variable for this connection configuration so that it can be used in the sampler.

评估JDBC请求时需要采取以下重要步骤:- 设置配置元件、JDBC连接设置,并根据数据库添加数据库URL和JDBC驱动类。为此连接配置添加变量名,以便在采样器中使用。
  • JDBC Request should be added. Write your queries to the test using the same variable name as before.

616. Is it possible for you to use JMeter to run Selenium scripts? If so, how would you go about doing it?

您能否使用JMeter运行Selenium脚本?如果可以,您将如何操作?
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb1056 | 官方: 否 | 付费: 否

答案:

Yes, you can run Selenium scripts in JMeter in order to get an indication of how well they perform. - It can be done in two ways. You can either utilise JUnit libraries to create Selenium scripts and save them as Jars, which you can then add to the JMeter directory. Then, in your test plan, add the JUnit sampler and import the Jar file.

是的,您可以在JMeter中运行Selenium脚本,以了解它们的性能表现。- 可以通过两种方式完成。您可以使用JUnit库创建Selenium脚本并将其保存为Jar文件,然后将它们添加到JMeter目录中。然后,在测试计划中添加JUnit采样器并导入该Jar文件。
  • Or else, you can place the Webdriver sampler plugin in the JMeter ext folder. JMeter should be restarted. In the Webdriver sampler, write your Selenium code and then run it to observe how it performs.

617. How do you perform spike testing with JMeter?

如何使用JMeter进行尖峰测试?
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb1059 | 官方: 否 | 付费: 否

答案:

Spike Testing is a type of performance assessment that examines how the system behaves when the load is significantly increased on the system. Using the Synchronizing Timer in JMeter, you may perform spike testing. The threads are clogged by synchronising the timer until a certain number of threads are blocked, then releasing them all at once, resulting in a significant sudden load.

尖峰测试是一种性能评估类型,用于检查系统在负载显著增加时的行为。使用JMeter中的同步定时器,您可以执行尖峰测试。通过同步定时器,线程会被阻塞,直到一定数量的线程被阻塞,然后一次性释放所有线程,从而产生显著的突发负载。

JMeter offers you two options to carry out spike testing: - Use the JMeter Ultimate Thread Group: This strategy will necessitate advance planning. Using the Ultimate Thread Group, the tester can perform many ramp-ups and ramp-downs in a single test. These could be gradual or more abrupt. For our purposes, you could introduce a spike during the test, for example, after 10 minutes of slow ramp-up and then stable load, ramp up to 10X in 10 seconds, then ramp down to the previous load level after 1 minute. The disadvantage of this method is that you won't be able to regulate concurrency during the test run. You won't be able to predict when the spike will occur.

JMeter为您提供了两种执行尖峰测试的选项:- 使用JMeter Ultimate线程组:此策略需要提前规划。使用Ultimate线程组,测试人员可以在单个测试中执行多次上升和下降。这些可以是渐进的或更突然的。为了我们的目的,您可以在测试期间引入尖峰,例如在缓慢上升10分钟然后稳定负载后,在10秒内上升到10倍,然后在1分钟后下降到之前的负载水平。此方法的缺点是,在测试运行期间您无法控制并发性。您无法预测尖峰何时发生。
  • Use JMeter Properties: This method will provide you with the most choice and flexibility. Determine how many threads you'll run at the start of the test, as well as when you'll want to create spikes dynamically. Use JMeter Properties for the number of threads, then use Real-Time Control to change the Properties while the test is executing.

618. Why is running JMeter in Non-GUI mode recommended?

为什么推荐以非 GUI 模式运行 JMeter?
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb105c | 官方: 否 | 付费: 否

答案:

JMeter tests can be conducted in GUI or non-GUI modes. Because the AWT (Abstract Window Toolkit) event thread can kill the tests in high load conditions, it is highly advised to conduct the load test in Non-GUI mode. JMeter's GUI mode is ideal for adding and updating new configuration components, thread groups, and samplers, as well as viewing a variety of different listeners for troubleshooting. The GUI option, on the other hand, has a constraint that slows down CPU consumption while running the recorded script. JMeter performance suffers when several listeners are used in a script. In order to avoid this, the script should be run in non-GUI mode. In non-GUI mode, there is a benefit to driving more requests per second out of JMeter.

JMeter 测试可以在 GUI 或非 GUI 模式下进行。因为 AWT(抽象窗口工具包)事件线程在高负载条件下可能中断测试,因此强烈建议以非 GUI 模式进行负载测试。JMeter 的 GUI 模式非常适合添加和更新新的配置组件、线程组和采样器,以及查看各种不同的监听器以进行故障排除。然而,GUI 选项存在一个限制,即运行录制脚本时会降低 CPU 消耗。当脚本中使用多个监听器时,JMeter 性能会受到影响。为了避免这种情况,脚本应以非 GUI 模式运行。在非 GUI 模式下,JMeter 能够驱动更多每秒请求数。

JMeter supports a number of non-GUI modes, including: - Command-line

JMeter 支持多种非 GUI 模式,包括:- 命令行
  • ANT plugin
  • MAVEN plugin
  • Jenkins

619. Is it possible to use JMeter to record actions using a mobile device? If so, how would you go about doing it?

是否可以使用 JMeter 通过移动设备记录操作?如果可以,你会怎么做?
  • 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7b58d557c902bb1061 | 官方: 否 | 付费: 否

答案:

Yes, JMeter can also record HTTP or HTTPS requests sent to the server through your mobile application. Mobile and JMeter must be connected to the same network.

是的,JMeter 也可以记录通过移动应用程序发送到服务器的 HTTP 或 HTTPS 请求。移动设备和 JMeter 必须连接到同一网络。

The following is the needed configuration: - In JMeter, set your proxy server to run on a specific port.

以下为所需配置:- 在 JMeter 中,将代理服务器设置为在特定端口上运行。
  • Set up the proxy on your phone's wifi settings and use the same port number as the recorder.
  • On your mobile device, install the Root CA certificate.
  • From your mobile, send server requests and watch them get captured by the selected controller.

620. Why does JUnit report only the first failure in a single attempt?

为什么 JUnit 在单次尝试中只报告第一个失败?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1311 | 官方: 否 | 付费: 否

答案:

JUnit is usually designed in a way that it deals with smaller tests and is capable of running each assessment with a boundary of separate analysis. Due to this, it reports only the first failure on each test case attempt.

JUnit 通常设计用于处理较小型的测试,并能以独立分析为边界运行每个评估。因此,在每次测试用例尝试中,它只报告第一个失败。

621. Why can't we use System.out.println() for testing and debugging?

为什么不能使用 System.out.println() 进行测试和调试?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1314 | 官方: 否 | 付费: 否

答案:

If we use System.out.println() for debugging, then we would have to do a manual scan of the outputs every time program is executed to ensure that the output printed is the expected output. Also, in the longer run, writing JUnit tests will be easier and will take lesser time. Writing test cases will be like an initial investment and then, later on, we can later automatically test them on the classes.

如果我们使用 System.out.println() 进行调试,那么每次程序执行时都必须手动扫描输出,以确保打印的输出是预期结果。此外,从长远来看,编写 JUnit 测试会更简单且耗时更少。编写测试用例就像一项初始投资,之后我们可以自动在类上运行这些测试。

622. How can we run JUnit from the command window?

如何在命令行窗口中运行JUnit?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1317 | 官方: 否 | 付费: 否

答案:

The first step is to set the CLASSPATH with the library path. Then invoke the JUnit runner by running the command:

第一步是使用库路径设置CLASSPATH。然后通过运行以下命令调用JUnit runner:

java org.junit.runner.JUnitCore

java org.junit.runner.JUnitCore
To run the test class via commandline, we would first have to compile the class. This can be done by running:
要通过命令行运行测试类,我们首先需要编译该类。可以通过运行以下命令完成:

javac -d target -cp target:junit-platform-console-standalone-1.7.2.jar src/test/java/com/pathTo/DemoTest.java

javac -d target -cp target:junit-platform-console-standalone-1.7.2.jar src/test/java/com/pathTo/DemoTest.java
Then we can run the compiled test class using the console launcher of JUnit by running the following command:
然后我们可以使用JUnit的控制台启动器运行编译后的测试类,通过运行以下命令:

java -jar junit-platform-console-standalone-1.7.2.jar --class-path target --select-class com.pathTo.DemoTest

java -jar junit-platform-console-standalone-1.7.2.jar --class-path target --select-class com.pathTo.DemoTest

623. How do you assert exceptions thrown in JUnit 4 tests?

如何在JUnit 4测试中断言抛出的异常?
  • 知识点: 测试 / 编程语言基础 / 行为与软技能 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb131a | 官方: 否 | 付费: 否

答案:

Consider an example to see how to write test cases for asserting exceptions.

考虑一个示例来了解如何编写用于断言异常的测试用例。

import org.apache.commons.lang3.StringUtils;

import org.apache.commons.lang3.StringUtils;
public final class ExceptionDemo {
public final class ExceptionDemo {
public String convertToUpperCase(String input) {
public String convertToUpperCase(String input) {
if (StringUtils.isEmpty(input)) {
if (StringUtils.isEmpty(input)) {
throw new IllegalArgumentException("Input empty, cannot convert to upper case!!");
throw new IllegalArgumentException("Input empty, cannot convert to upper case!!");
}
return input.toUpperCase();
return input.toUpperCase();
}
}
The method convertToUpperCase() defined in the ExceptionDemo class would throw an IllegalArgumentException if an empty string is passed as an input to the method. Let us write unit test cases for asserting the exception thrown in the code. In JUnit, there are 3 different ways of achieving this and they are as follows:
ExceptionDemo类中定义的convertToUpperCase()方法在向该方法传递空字符串时,会抛出IllegalArgumentException。让我们编写单元测试用例来断言代码中抛出的异常。在JUnit中,有3种不同方式可以实现这一点,具体如下:

try-catch idiom: We can use the try-catch block for asserting exception as shown below:

try-catch 惯用法:我们可以使用 try-catch 块来断言异常,如下所示:

@Test

@Test
public void convertToUpperCaseWithTryCatchTest{
public void convertToUpperCaseWithTryCatchTest{
try {
try {
exceptionDemo.convertToUpperCase("");
exceptionDemo.convertToUpperCase("");
fail("It should throw IllegalArgumentException");
fail("它应该抛出 IllegalArgumentException");
} catch (IllegalArgumentException e) {
} catch (IllegalArgumentException e) {
Assertions.assertThat(e)
Assertions.assertThat(e)
.isInstanceOf(IllegalArgumentException.class)
.isInstanceOf(IllegalArgumentException.class)
.hasMessage("Input empty, cannot convert to upper case!!");
.hasMessage("输入为空,无法转换为大写!!");
}
}
@Test expected annotation:
@Test 期望注解:

Here we give the expected exception as value to the expected parameter of the @Test annotation as: @Test(expected = IllegalArgumentException.class)

这里我们将期望的异常作为值传递给 @Test 注解的 expected 参数,例如:@Test(expected = IllegalArgumentException.class)

When no exception is thrown by the target method under test, then we will get the below message:

当被测试的目标方法未抛出任何异常时,我们将收到以下消息:

java.lang.AssertionError: Expected exception: java.lang.IllegalArgumentException

java.lang.AssertionError: 期望异常:java.lang.IllegalArgumentException
Care has to be taken here while defining the expected Exception. We should not expect general Exception, RuntimeException or even a Throwable type of exceptions as that is a bad practice. If we do so, then there are chances that the code can throw an exception in other places and the test case can pass.
在定义期望的异常时需要注意。我们不应期望一般异常、运行时异常或甚至 Throwable 类型的异常,因为这是不好的实践。如果这样做,那么代码有可能在其他地方抛出异常而测试用例仍然通过。

Here we cannot assert the message in the exception. The code snippet of the test method would be:

这里我们无法断言异常中的消息。测试方法的代码片段将如下所示:

@Test(expected = IllegalArgumentException.class)

@Test(expected = IllegalArgumentException.class)
public void convertToUpperCaseExpectedTest() {
public void convertToUpperCaseExpectedTest() {
exceptionDemo.convertToUpperCase("");
exceptionDemo.convertToUpperCase("");
}
Junit @Rule :
Junit @Rule :

The same example can be created using the ExceptedException rule. The rule must be a public field marked with @Rule annotation.

同一个示例可以使用ExceptedException规则来创建。该规则必须是一个带有@Rule注解的公共字段。

@Rule

@Rule
public ExpectedException exceptionRule = ExpectedException.none();
public ExpectedException exceptionRule = ExpectedException.none();

@Test

@Test
public void convertToUpperCaseRuleTest() {
public void convertToUpperCaseRuleTest() {
exceptionRule.expect(IllegalArgumentException.class);
exceptionRule.expect(IllegalArgumentException.class);
exceptionRule.expectMessage("Input empty, cannot convert to upper case!!");
exceptionRule.expectMessage("输入为空,无法转换为大写!!");
exceptionDemo.convertToUpperCase("");
exceptionDemo.convertToUpperCase("");
}
In this approach, when the exception is not thrown, we will get:
在这种方法中,当异常未被抛出时,我们会得到:

java.lang.AssertionError: Expected test to throw (an instance of java.lang.IllegalArgumentException and exception with the message “Input empty, cannot convert to upper case!!”)

java.lang.AssertionError: 期望测试抛出(java.lang.IllegalArgumentException的实例,并且异常带有消息“输入为空,无法转换为大写!!”)

624. What are the differences between @Before, @After, @BeforeClass and @AfterClass?

@Before、@After、@BeforeClass和@AfterClass之间有什么区别?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb131d | 官方: 否 | 付费: 否

答案:

The order of execution of these annotations is as shown below:

这些注解的执行顺序如下所示:
@Before@After@BeforeClass@AfterClass
Methods annotated with @Before are executed before each test case.
带有@Before注解的方法在每个测试用例之前执行。
Methods annotated with @After are executed after each test case.
带有@After注解的方法在每个测试用例之后执行。
Methods annotated with @BeforeClass are executed once before the start of all the test cases.
带有@BeforeClass注解的方法在所有测试用例开始之前执行一次。
Methods annotated with @AfterClass are executed once all the tests have completed their execution.
带有@AfterClass注解的方法在所有测试执行完成后执行一次。
This is used for preparing the test environment like to read inputs, initialise the variables etc.
这用于准备测试环境,如读取输入、初始化变量等。
This is used for cleaning up the test environment like deleting the temporary data, restoring the value of variables to default. This helps in saving memory.
这用于清理测试环境,如删除临时数据、将变量值恢复为默认值。这有助于节省内存。
This is used for performing time-intensive set-up activities like connecting to any resource that is common across all tests. Methods annotated with this API needs to be defined as static methods for working with JUnit.
这用于执行耗时的设置活动,如连接到所有测试共用的资源。带有此API的方法需要定义为静态方法才能与JUnit配合使用。
This is used for performing time-intensive cleanup activities like disconnecting from a resource that is common across all tests. Methods annotated with this annotation has to be defined as static methods for it to work with JUnit.
这用于执行耗时的清理活动,如断开与所有测试共用的资源的连接。带有此注解的方法必须定义为静态方法才能与JUnit配合使用。

625. What are Hamcrest Matchers?

什么是 Hamcrest Matchers?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1320 | 官方: 否 | 付费: 否

答案:

Hamcrest is a JUnit framework used to write matcher objects that provides ‘match’ rules definition in a declarative manner. They are used in UI validation, data filtering and for writing flexible unit tests. Hamcrest matches are used in the assertThat() method in JUnit. We can use one or more matchers within this assert method. Some of the matcher methods are as follows:

Hamcrest 是一个用于编写匹配器对象的 JUnit 框架,以声明性方式提供“匹配”规则的定义。它们用于 UI 验证、数据过滤以及编写灵活的单元测试。Hamcrest 匹配器用于 JUnit 中的 assertThat() 方法。我们可以在此断言方法中使用一个或多个匹配器。部分匹配器方法如下:
MatcherDescription
描述
Example
示例
allOf()This calculates the logical conjunction of multiple matchers and the object under consideration should match all of the matcher given.
该匹配器计算多个匹配器的逻辑合取,被考虑的对象应匹配所有给定的匹配器。
assertThat("InterviewBit",allOf(startsWith("In"),containsString(“Bit”))) --> All conditions should match for assertThat to pass.
assertThat("InterviewBit", allOf(startsWith("In"), containsString("Bit"))) --> 所有条件都应匹配,assertThat 才能通过。
anyOf()This is used for calculating the logical disjunction of multiple matchers. This means that the object under consideration matches ANY of the specified matchers.
该匹配器用于计算多个匹配器的逻辑析取。这意味着被考虑的对象匹配任一指定的匹配器。
assertThat( "InterviewBit",anyOf(containsString( "Bit" ),containsString( "unit" ))); -->Any of the conditions should match for assertThat to pass.
assertThat("InterviewBit", anyOf(containsString("Bit"), containsString("unit"))); --> 任一条件匹配,assertThat 即可通过。
describedAs()This adds a description to the matcher.
该匹配器为匹配器添加描述。
assertThat("Friday", describedAs("Friday is not Sunday", is(not("Sunday"))));
is()This decorates another matcher by retaining its behavior. and checks for the equality of the objects. It allows tests to be more expressive and meaningful.
该匹配器保留另一个匹配器的行为,并检查对象的相等性。它使测试更具表达力和意义。
assertThat("InterviewBit",is(equalTo("InterviewBit")))
assertThat("InterviewBit", is(equalTo("InterviewBit")))
anything()This matcher always returns true.
该匹配器始终返回 true。
assertThat("InterviewBit",is(anything("foo bar")));
assertThat("InterviewBit", is(anything("foo bar")));
equalTo()This checks for the equality of objects.
该匹配器检查对象的相等性。
assertThat("InterviewBit",equalTo("InterviewBit"));
assertThat("InterviewBit", equalTo("InterviewBit"));
instanceOf()This tests whether the value is an instance of any class.
该匹配器测试值是否为任何类的实例。
assertThat(instance,instanceOf(InstanceClass.class));
assertThat(instance, instanceOf(InstanceClass.class));
hasItems()This creates matcher for iterables which matches when consecutive passes over Iterable yields at least one item equal to corresponding item from list of items. The iterable stops as soon as matching item is found.
该匹配器为可迭代对象创建匹配器,当对 Iterable 的顺序遍历产生至少一个与列表项列表中对应项相等的项时匹配。一旦找到匹配项,迭代即停止。
assertThat(Arrays.asList("Interviewbit", "Junit", "Interview","Questions"), hasItems("Junit", "Questions"))
assertThat(Arrays.asList("Interviewbit", "Junit", "Interview", "Questions"), hasItems("Junit", "Questions"))
not()This creates matcher which wraps existing matcher but inverts logic by which it should match.
该匹配器包装现有匹配器,但反转其匹配的逻辑。
assertThat("InterviewBit", is(not(equalTo("Junit"))));
nullValue()This creates matcher which matches if object that is examined is null.
该匹配器在检查的对象为 null 时匹配。
assertThat(obj, is(nullValue()));

626. What is the relationship between the cyclomatic complexity of code and unit tests?

代码的圈复杂度与单元测试之间有什么关系?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1323 | 官方: 否 | 付费: 否

答案:

The code cyclomatic complexity is calculated based on the number of decision points of the code that contributes to different execution paths as shown in the image below:

代码圈复杂度是基于代码中决策点的数量计算的,这些决策点导致不同的执行路径,如下图所示:

This is why, higher the cyclomatic complexity, the more difficult is to attain the required code coverage.

这就是为什么圈复杂度越高,就越难达到所需的代码覆盖率。

627. What is the keyboard shortcut for running the Junit test cases in eclipse IDE?

在 Eclipse IDE 中运行 JUnit 测试用例的键盘快捷键是什么?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1326 | 官方: 否 | 付费: 否

答案:

We can press Alt+Shift+X for running the test. We can also right-click on the project, select Run As and then select JUnit Test. If the test method needs to be rerun, then we can press Ctrl+F11.

我们可以按 Alt+Shift+X 来运行测试。我们还可以右键点击项目,选择“运行方式”,然后选择“JUnit 测试”。如果需要重新运行测试方法,可以按 Ctrl+F11。

628. Define code coverage. What are the different types of code coverages?

定义代码覆盖率。代码覆盖率有哪些不同类型?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1329 | 官方: 否 | 付费: 否

答案:

The extent to which the source code is unit tested is called coverage. There are three types of coverage techniques, they are: - Statement coverage: This ensures that each statement/line in the source code is executed and tested.

源代码被单元测试的程度称为覆盖率。有三种覆盖率技术,它们是:- 语句覆盖率:确保源代码中的每条语句/行都被执行和测试。
  • Decision coverage: This ensures that every decision point that results in true or false is executed and run.
  • Path coverage: This ensures that every possible route from a given point is run and tested.

629. Is it possible to test the Java method for a timeout in JUnit?

是否可以在 JUnit 中测试 Java 方法的超时?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb132c | 官方: 否 | 付费: 否

答案:

Yes, it is possible. @Test annotation provides a timeout parameter that takes value in milliseconds in JUnit that is used for instructing JUnit to pass or fail the test method based on execution time. For instance, if a test method has Test annotation as @Test(timeout=30) , then it means that if the execution does not complete in 30ms, then the test case will be failed. This helps in verifying the SLA of the Java method.

是的,可以。@Test 注解提供了 timeout 参数,在 JUnit 中以毫秒为单位取值,用于指示 JUnit 根据执行时间通过或失败测试方法。例如,如果测试方法的 Test 注解为 @Test(timeout=30),则意味着如果执行未能在 30ms 内完成,测试用例将会失败。这有助于验证 Java 方法的 SLA。

630. What are some of the best practices to be followed while writing code for making it more testable?

编写代码以使其更可测试时,应遵循哪些最佳实践?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1330 | 官方: 否 | 付费: 否

答案:

Following are some of the best practices that can be followed while coding to make the code more testable: - Make use of interfaces as a wrapper to implementation classes. This helps testers to replace the class with mocks or stubs to test the module.

以下是编码时可遵循的一些最佳实践,以使代码更可测试:- 使用接口作为实现类的包装器。这有助于测试人员用模拟对象或桩替换类来测试模块。
  • Use dependency injection wherever needed instead of creating. new objects. This makes it easy for testing individual modules and also supply dependency in the test configuration.
  • Avoid using static methods as that makes it difficult to test because they cannot be called polymorphically.

631. How can we test protected methods?

如何测试受保护的方法?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1333 | 官方: 否 | 付费: 否

答案:

For testing protected methods, the test class should be declared in the same package as that of the target class.

为了测试受保护的方法,测试类应声明在与目标类相同的包中。

632. How can we do testing for private methods?

我们如何对私有方法进行测试?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1336 | 官方: 否 | 付费: 否

答案:

It is generally not required to test private methods directly. Since they are private, it is assumed that they are called from public methods. If these methods are working as expected, then by extension it is considered that the private methods are working correctly. However, we can explore how the private methods are tested using reflection.

通常不需要直接测试私有方法。由于它们是私有的,因此假定它们是从公共方法中调用的。如果这些方法按预期工作,那么可以推断私有方法也工作正常。然而,我们可以探索如何使用反射来测试私有方法。

Let us consider we have a public class Item with private method getItemName() as shown below:

让我们考虑我们有一个公共类 Item,其中包含一个私有方法getItemName(),如下所示:

public class Item {

public class Item {
private String getItemName(String itemName) {
private String getItemName(String itemName) {
//Some logic
//一些逻辑
if(itemName.equals("computer")) {
if(itemName.equals("computer")) {
return itemName;
return itemName;
}
return "laptop";
return "laptop";
}
}
Consider we have a test class ItemTest that tests this method as shown below:
考虑我们有一个测试类ItemTest来测试此方法,如下所示:

import static org.junit.Assert.assertEquals;

import static org.junit.Assert.assertEquals;
import java.lang.reflect.Method;
import java.lang.reflect.Method;
import org.junit.BeforeClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.Test;
public class ItemTest {
public class ItemTest {
public static Item item;
public static Item item;

@BeforeClass

@BeforeClass
public static void beforeClass() {
public static void beforeClass() {
item = new Item();
item = new Item();
}

@Test

@Test
public void testGetItemNameSuccess() throws Exception {
public void testGetItemNameSuccess() throws Exception {
String expectedName = "computer";
String expectedName = "computer";
Method method = Item.class.getDeclaredMethod("getItemName", String.class);
Method method = Item.class.getDeclaredMethod("getItemName", String.class);
method.setAccessible(true);
method.setAccessible(true);
String actualName = (String) method.invoke(item, actualName);
String actualName = (String) method.invoke(item, actualName);
assertEquals(expectedName, actualName);
assertEquals(expectedName, actualName);
}
}
In the above code, we see that we can test the private method by using getDeclaredMethod method of the Method class that belongs to reflection strategy. Since we know that the private methods cant be invoked directly, we can use the Method class object’s invoke() method and send the input parameters. Then as usual, we can compare the results with the expected and the actual methods.
在上述代码中,我们看到可以通过使用属于反射策略的Method类的getDeclaredMethod方法来测试私有方法。由于我们知道私有方法不能被直接调用,我们可以使用Method类对象的invoke()方法并传递输入参数。然后像往常一样,我们可以将结果与预期方法和实际方法进行比较。

633. How can you test a generics class?

如何测试泛型类?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1339 | 官方: 否 | 付费: 否

答案:

Generics allows creating classes, interfaces or methods that operate with different data types at a time. In order to test Generic entities, we can test it for one or two datatypes for the logic since the datatype allocation are evaluated at compilation time for type-correctness.

泛型允许创建一次操作不同数据类型的类、接口或方法。为了测试泛型实体,我们可以针对逻辑测试一个或两个数据类型,因为数据类型分配在编译时进行类型正确性评估。

634. What are the best practices for writing Unit Test Cases?

编写单元测试用例的最佳实践是什么?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb133c | 官方: 否 | 付费: 否

答案:

A standard unit test case comprises a known input and an expected output. These two things need to be known before we run the test case. A known input is tested for a precondition and an expected output is tested by postcondition. Following are the best practices for writing unit test cases: - For every method, we need to have at least two unit test cases - a positive test case and a negative test case.

标准的单元测试用例包括已知输入和预期输出。在运行测试用例之前,我们需要知道这两件事。已知输入用于测试前置条件,预期输出用于测试后置条件。以下是编写单元测试用例的最佳实践:- 对于每个方法,我们需要至少两个单元测试用例——一个正面测试用例和一个负面测试用例。
  • If there are sub-requirements for a requirement, then those sub-requirements should have their own positive and negative test cases.
  • Each test case should be independent of other test cases. If we make a chain of unit test cases, then it would not be possible for finding the root cause of the test case failures.
  • Mock all the external services that are used by the modules under test. This is necessary because we do not want to unnecessarily debug our modules under test due to the failures of the external systems.
  • Configuration settings need not be tested as they won’t be part of any unit code. Even if we want to inspect the configuration, then test whether the loading code is working or not.
  • The unit test cases should be named consistently and clearly. The names of the test cases should be dependent on the operations that the test case would test.

635. What are the differences between JUnit 4 and JUnit 5?

JUnit 4和JUnit 5之间有什么区别?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb133f | 官方: 否 | 付费: 否

答案:

Category
类别
JUnit 4JUnit 5
Annotation for executing method before all test methods run in the current class
在当前类中所有测试方法运行前执行方法的注解
@BeforeClass@BeforeAll
Annotation for executing method after all test methods run in the current class
在当前类中所有测试方法运行后执行方法的注解
@AfterClass@AfterAll
Annotation for executing method before each test case
在每个测试用例前执行方法的注解
@Before@BeforeEach
Annotation for executing method after each test method
在每个测试方法后执行方法的注解
@After@AfterEach
Architecture
架构
It has everything like platform, annotations etc bundled in a single jar file.
平台、注解等所有功能都打包在单个jar文件中。
JUnit 5 is composed of 3 sub-units - JUnit Platform, JUnit Jupiter and JUnit Vintage
JUnit 5由3个子单元组成 - JUnit Platform、JUnit Jupiter和JUnit Vintage
Required JDK Version
所需JDK版本
This needs Java 5 or higher versions.
需要Java 5或更高版本。
This needs Java 8 or above.
需要Java 8或以上版本。
Assertions
断言
Assert methods are present in org.junit.Assert package for validating expected and actual outputs.
Assert方法位于org.junit.Assert包中,用于验证预期和实际输出。
Assert methods are present in the org.junit.jupiter.Assertions package. The methods also have overloaded methods for supporting error messages in case tests fail.
Assert方法位于org.junit.jupiter.Assertions包中。这些方法还有重载方法,用于在测试失败时支持错误消息。

636. What are the differences between JUnit and TestNG?

JUnit和TestNG之间有什么区别?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1343 | 官方: 否 | 付费: 否

答案:

JUnitTestNG
Open-source unit testing framework for writing test cases.
用于编写测试用例的开源单元测试框架。
TestNG is similar to JUnit but with extended functionalities.
TestNG与JUnit类似,但具有扩展功能。
JUnit does not support advanced annotations.
JUnit不支持高级注解。
This supports advanced and special annotations too.
这也支持高级和特殊注解。
JUnit does not support parallel testing.
JUnit不支持并行测试。
TestNG supports multiple threads to run parallelly.
TestNG支持多线程并行运行。
Group test is not supported.
不支持分组测试。
TestNG is supported in TestNG.
TestNG中支持分组测试。
The naming convention for annotations like Before, After, Expected are confusing.
像Before、After、Expected这类注解的命名约定令人困惑。
The naming convention for understanding annotations like BeforeMethod, AfterMethod, ExpectedException is easy to understand based on their functionality.
BeforeMethod、AfterMethod、ExpectedException等注解的命名约定基于其功能易于理解。
Cannot rerun failed cases.
无法重新运行失败的用例。
Can rerun failed tests.
可以重新运行失败的测试。

637. How to ignore tests in JUnit?

如何在JUnit中忽略测试?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb1347 | 官方: 否 | 付费: 否

答案:

We need to ignore test cases when we have certain functionalities that are not certain or they are under development. To wait for the completion of the code, we can avoid running these test cases. In JUnit 4, we can achieve this by using @Ignore annotation over the test methods. In JUnit 5, we can do it using @Disabled annotation over the test methods.

当某些功能不确定或正在开发中时,我们需要忽略测试用例。为了等待代码完成,我们可以避免运行这些测试用例。在JUnit 4中,我们可以通过在测试方法上使用@Ignore注解来实现这一点。在JUnit 5中,我们可以通过在测试方法上使用@Disabled注解来实现。

638. What is the purpose of @Before and @After annotations in JUnit 4?

在JUnit 4中@Before和@After注解的目的是什么?
  • 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b7f58d557c902bb134a | 官方: 否 | 付费: 否

答案:

These are the annotations present in JUnit 4. Methods annotated with @Before will be called and run before the execution of each test case. Methods annotated with @After will be called and executed after the execution of each test case. If we have 5 test cases in a JUnit class, then the methods annotated with these two would be run 5 times. In JUnit 5, the annotations @Before and @After are renamed to @BeforeEach and @AfterEach for making it more readable.

这些是JUnit 4中的注解。带有@Before注解的方法将在每个测试用例执行前被调用并运行。带有@After注解的方法将在每个测试用例执行后被调用并执行。如果JUnit类中有5个测试用例,那么带有这两个注解的方法将运行5次。在JUnit 5中,@Before和@After注解已更名为@BeforeEach和@AfterEach,以提高可读性。

639. How many Vusers are essential for load testing?

负载测试需要多少Vuser(虚拟用户)?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1bc7 | 官方: 否 | 付费: 否

答案:

The count of Vusers depends on the application under test, hardware settings, infrastructure like network configurations, memory, operating system, and objective of the performance test. We cannot provide a generic value for the number of Vusers.

Vuser的数量取决于被测应用程序、硬件设置、基础架构(如网络配置、内存、操作系统)以及性能测试的目标。我们无法为Vuser数量提供通用值。

640. Consider a scenario where you have an application showing the results of an exam for all students.

考虑一个场景,你有一个显示所有学生考试结果的应用程序。
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1bca | 官方: 否 | 付费: 否

答案:

The result will be displayed next to the student’s name with the label “Passed” or “Failed” depending on whether the student has passed or not. How can we identify what is the count of students that have passed and failed the VuGen Script?

结果将显示在学生姓名旁边,并标注“Passed”或“Failed”,具体取决于学生是否通过。我们如何通过VuGen脚本识别通过和未通过的学生数量?
Since we have “Passed” and “Failed” labels on the page, we can make use of the text check using the web_reg_find method and SaveCount to store the number of matches found on the webpage as follows:
由于页面上有“Passed”和“Failed”标签,我们可以使用web_reg_find方法进行文本检查,并使用SaveCount来存储网页上找到的匹配数量,如下所示:

/ To find count of students passed /

/ 查找通过的学生数量 /
web_reg_find("Text=Passed", "SaveCount=Students_Passed", LAST);
web_reg_find("Text=Passed", "SaveCount=Students_Passed", LAST);

/ To find count of students failed /

/ 查找未通过的学生数量 /
web_reg_find("Text=Failed", "SaveCount=Students_Failed", LAST);
web_reg_find("Text=Failed", "SaveCount=Students_Failed", LAST);
Conclusion
结论
LoadRunner has become an important software performance testing tool in the corporate world as it provides various powerful tools to emulate real-world scenarios effectively under varying loads. Hence, it is important to have both practical experience and theoretical knowledge about this tool for any software testers as well as software developers. In this article, we have seen the most commonly asked interview questions in LoadRunner for both freshers and experienced professionals in software testing and development fields.
LoadRunner已成为企业界重要的软件性能测试工具,因为它提供了各种强大的工具来在不同负载下有效模拟真实场景。因此,对于任何软件测试人员和软件开发人员来说,具备此工具的实践经验与理论知识都很重要。在本文中,我们看到了LoadRunner中最常被问到的面试问题,适用于软件测试和开发领域的初学者及经验丰富的专业人员。

References

参考文献
LoadRunner Official Documentation : https://www.microfocus.com/en-us/products/loadrunner-professional/overview
LoadRunner官方文档:https://www.microfocus.com/en-us/products/loadrunner-professional/overview

Important Testing Interview References:

重要测试面试参考:

641. Does caching have detrimental impact on results of load testing?

缓存是否对负载测试结果有不利影响?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1bcf | 官方: 否 | 付费: 否

答案:

Yes, caching has a lot of impact on load testing. In the presence of caching, the surf history would be stored in a temporary memory called cache and whenever information is required to load a page, it would be loaded mostly from cache thereby reducing the time taken to load the page for second and subsequent times. This will affect the reaction times in the testing results as they would not be accurate while testing varying loads. Hence, caching should be disabled before we perform load testing.

是的,缓存对负载测试影响很大。当存在缓存时,浏览历史会存储在名为缓存的临时内存中,每当需要信息来加载页面时,信息大多会从缓存中加载,从而减少了第二次及后续加载页面所需的时间。这会影响测试结果中的响应时间,因为当测试不同负载时,这些时间可能不准确。因此,在执行负载测试前应禁用缓存。

642. How are concurrent users different from simultaneous users?

并发用户与同时用户有何不同?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1bd2 | 官方: 否 | 付费: 否

答案:

Concurrent users define the number of users for a given test duration whereas simultaneous users define the number of users performing the same transactions at a particular point in time. All concurrent users are not the same as simultaneous users, however, all simultaneous users are actually concurrent users.

并发用户定义了在给定测试时长内的用户数量,而同时用户定义了在特定时间点执行相同事务的用户数量。并非所有并发用户都是同时用户,但所有同时用户实际上是并发用户。

In LoadRunner, when a script is running, all Vusers working on the test are concurrent users as they are assigned to use the application under test at the same time. However, the Vusers might not be performing the same activity at any instant in time. For example, in the image below, we can see that there are 6 Vusers available and performing a series of actions in an application under test. We can observe that not all Vusers would be in the same step at that point for concurrent users. Whereas for simultaneous users, we can see that all users would be performing the same activities at that instant of time.

在LoadRunner中,当脚本运行时,所有参与测试的Vuser都是并发用户,因为它们被分配在同一时间使用被测应用程序。然而,Vuser可能在任何时刻并未执行相同活动。例如,在下图中,我们可以看到有6个Vuser可用并在被测应用程序中执行一系列操作。我们可以观察到,对于并发用户,并非所有Vuser在该点都处于相同步骤。而对于同时用户,我们可以看到所有用户在该时刻都执行相同活动。

It is possible to convert concurrent users to simultaneous users by making use of rendezvous points. When we add rendezvous points in between actions, the controller waits for the specified number of Vusers to arrive at that point so that they can perform tasks at the same time.

通过使用集合点,可以将并发用户转换为同时用户。当我们在操作之间添加集合点时,控制器会等待指定数量的Vuser到达该点,以便它们可以同时执行任务。

643. Define hits per second and throughput.

定义每秒点击次数和吞吐量。
  • 知识点: 测试 / 行为与软技能 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1bd5 | 官方: 否 | 付费: 否

答案:

Hits Per Second is a measure of the number of times our site is hit/visited by users in any second. It corresponds to the number of times users send HTTP requests to the web server.

每秒点击次数是衡量我们网站在任何一秒钟内被用户点击/访问次数的指标。它对应于用户每秒向Web服务器发送HTTP请求的次数。

Throughput is a measure of the number of requests a software can handle per hour, or per minute or per second. An increase in the Response time of requests decreases the throughput.

吞吐量是衡量软件每小时、每分钟或每秒能处理的请求数量的指标。请求响应时间的增加会降低吞吐量。

644. How would you decide when you want to run a script in controller or in VuGen?

您如何决定何时在控制器或VuGen中运行脚本?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1bd8 | 官方: 否 | 付费: 否

答案:

VuGen stands for Virtual User Generator. This is usually where the actual scripting takes place. Running a script in VuGen is beneficial if we want to debug while we are writing it as the VuGen lets us see where the script has failed, what the response of the script is, and what needs to be changed. However, this is useful only to test with a single user and is limited to local machines only. When we are ready with the script after debugging here, we can run the script in the controller. The controller is like a command centre in LoadRunner because here we have options to ramp up the number of Vusers, select scenario configuration based on the workload model, configure monitors etc. In addition to this, the controller does not launch separate VuGen instances for each Vuser while running the script.

VuGen代表Virtual User Generator(虚拟用户生成器)。这通常是实际进行脚本编写的地方。在VuGen中运行脚本是有益的,如果我们想在编写时进行调试,因为VuGen让我们看到脚本失败的位置、脚本的响应是什么以及需要更改什么。然而,这仅适用于使用单个用户进行测试,并且仅限于本地机器。当我们在此处调试完脚本并准备好后,可以在控制器中运行脚本。控制器就像LoadRunner中的指挥中心,因为在这里我们可以选择增加Vuser数量、基于工作负载模型选择场景配置、配置监视器等选项。此外,控制器在运行脚本时不会为每个Vuser启动单独的VuGen实例。

645. What do you understand by Think Time? What is the default threshold level value? How can we change this value?

您如何理解思考时间?默认阈值级别值是多少?我们如何更改此值?
  • 知识点: 测试 / 行为与软技能 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1beb | 官方: 否 | 付费: 否

答案:

Think time refers to the delay that happens between the time when the user receives the response from a server and the time taken by the user to review this response. This can be emulated in LoadRunner by intentionally configuring wait time between the script actions. The threshold level of think time refers to the level below which the think time recorded is ignored.

思考时间指的是用户从服务器接收响应到用户审查该响应之间发生的延迟。在 LoadRunner 中,可以通过在脚本操作之间故意配置等待时间来模拟这种延迟。思考时间的阈值级别指的是在此级别以下记录的思考时间会被忽略的级别。

The default threshold level value for this field is 5 seconds. This value can be changed in VuGen by going to the Recording Options . Go to Recording Options , then go to Script , and then you can generate think time greater than the threshold.

此字段的默认阈值级别值为5秒。该值可以在 VuGen 中通过进入录制选项来更改。进入录制选项,然后进入脚本,接着您可以生成大于阈值的思考时间。

646. What are monitors in LoadRunner and how do you configure them?

LoadRunner 中的监视器是什么,以及如何配置它们?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1c0e | 官方: 否 | 付费: 否

答案:

Monitors are used for monitoring performance bottlenecks by helping to identify the problematic area that leads to an increase in response times. Monitors are available in LoadRunner controllers. Some monitors would be enabled by default and their statistics would be visible while running the test. However, most monitors require configuration within the Controller component. LoadRunner Controller provides monitors like Run-time, Transaction, Web Resource, Network, System Resource, Firewall, Database Server Resource, Web Application Server, Dynatrace, Kafka, and many more!

监视器用于通过帮助识别导致响应时间增加的问题区域来监控性能瓶颈。监视器在 LoadRunner 控制器中可用。一些监视器默认启用,其统计数据在运行测试时会可见。然而,大多数监视器需要在控制器组件中进行配置。LoadRunner 控制器提供了运行时、事务、Web 资源、网络、系统资源、防火墙、数据库服务器资源、Web 应用服务器、Dynatrace、Kafka 等监视器!

To set up the monitoring environment in LoadRunner Professional, we need to follow the below steps:

要在 LoadRunner Professional 中设置监控环境,我们需要遵循以下步骤:
  1. First, install monitoring components on the server. The setup/installation details vary for each type of monitor. You can refer to the official documentation for installing each monitor. 2. Add the server that has to be monitored to the Controller. This can be done by: Select a server whose monitors have to be configured in the controller. If we need to monitor a server from the controller, then we need to add the monitoring measurements and the machine in the controller. Select the required monitor graph in Graphs the section for displaying in the right pane of the Run tab. Select Add Measurements on the graph or from the graph menu (in hamburger shape). This opens the Monitor dialog box. Here, Go to the Monitored Server Machines section and click Add. This opens the Add Machine dialog. Enter the IP address or your server name that needs to be monitored. Select which platform your server runs. Select what measurements have to be configured. Ensure that the monitors selected appear in the Monitored Server Machines section of the Monitor dialog. In the Resource Measurements part in the Monitor dialog, click Add and define the server measurements in the Monitor Configuration dialog.

    1. 首先,在服务器上安装监控组件。每个监视器的设置/安装细节各不相同。您可以参考官方文档来安装每个监视器。2. 将要监控的服务器添加到控制器中。这可以通过以下方式完成:在控制器中选择一个需要配置监视器的服务器。如果我们需要从控制器监控服务器,那么我们需要在控制器中添加监控度量和机器。在“图形”部分选择所需的监视器图形,以便在“运行”选项卡的右侧窗格中显示。在图形上或从图形菜单(汉堡形状)中选择“添加度量”。这将打开监视器对话框。在此处,转到“被监控服务器机器”部分并点击“添加”。这将打开“添加机器”对话框。输入需要监控的 IP 地址或服务器名称。选择服务器运行的操作系统平台。选择需要配置的度量。确保所选监视器出现在监视器对话框的“被监控服务器机器”部分。在监视器对话框的“资源度量”部分,点击“添加”,并在监视器配置对话框中定义服务器度量。

647. What changes can we make in run-time settings in LoadRunner?

在 LoadRunner 中,我们可以在运行时设置中进行哪些更改?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1c11 | 官方: 否 | 付费: 否

答案:

Following are some of the changes we can make in the run-time settings: - Log – This allows us to define and set which logs have to be stored.

以下是我们可以在运行时设置中进行的一些更改:- 日志 – 这允许我们定义和设置要存储哪些日志。
  • Run Logic – This lets us arrange operations in a logical way and set the number of iterations for the script.
  • Browser – This lets us calibrate browser settings like cache.
  • Pacing – This lets us insert random or fixed delays between iterations.
  • Proxy – This helps us set the proxy server.
  • Think time – This can be set to fix or random delay between transactions.
  • Miscellaneous – This lets us configure settings corresponding to multithreading, error handling, or automatic transactions.
  • Speed simulation – This aids in configuring the network speed by setting the bandwidth value.
  • Streaming – This sets up video buffer retries and timeouts.
  • Download Filters – This lets us filter out unwanted requests coming from any source like a server or URL.
  • Content check – This helps us find known errors in the script at the time of execution.
  • Preferences – This lets us set checkpoints and advanced settings like performance graphs etc.

648. How can you provide the autocorrelation rules created by you to another tester working on different workstation?

你如何将你创建的自动关联规则提供给在不同工作站上工作的其他测试人员?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1c14 | 官方: 否 | 付费: 否

答案:

The autocorrelation rules can be exported to a .cor file and it can be then shared with the teammates. The teammate then has to import this file into autocorrelation rules present in their workstation.

自动关联规则可以导出为一个 .cor 文件,然后可以与团队成员共享。该团队成员随后需要将此文件导入到其工作站的自动关联规则中。

649. Is it feasible to do manual correlation on values requiring correlation when the script is running?

在脚本运行时,对需要关联的值手动进行关联是否可行?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1c17 | 官方: 否 | 付费: 否

答案:

It is not possible to perform manual correlation when the script runs. However, the script can be stopped and then we can make the required changes.

当脚本运行时,不可能执行手动关联。但是,可以停止脚本,然后我们可以做出所需的更改。

650. How can you identify if correlation is needed?

你如何识别是否需要关联?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1c1a | 官方: 否 | 付费: 否

答案:

There are two possible ways to identify if a project requires correlation or not:

有两种可能的方法来识别项目是否需要关联:
  1. Look out for correlation manually and examine what are the list of values that can be subjected to correlation. 2. Record two scripts and compare the results. We can look at the difference between these two results and identify the values which can be correlated.

    1. 手动检查关联,并检查哪些值列表可以进行关联。2. 录制两个脚本并比较结果。我们可以查看这两个结果之间的差异,并识别哪些值可以关联。

651. What is the difference in running the Vuser as a process and as a thread?

将 Vuser 作为进程运行和作为线程运行有什么区别?
  • 知识点: 测试 / 行为与软技能 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1c1d | 官方: 否 | 付费: 否

答案:

When we run Vuser as a process, the same driver program will be loaded into memory for each Vuser. This results in high RAM consumption and restricts how many Vusers we want to execute in that single generator. However, if we run Vuser as a thread, then only one instance of the driver program will be loaded into memory for that many Vusers. This type of multithreading mode allows us to add and run more Vusers on a single generator. Hence, running on the thread is more advantageous.

当我们将 Vuser 作为进程运行时,每个 Vuser 都会将相同的驱动程序加载到内存中。这会导致较高的内存消耗,并限制我们可在单个生成器上执行的 Vuser 数量。然而,如果我们将 Vuser 作为线程运行,则对于多个 Vuser,内存中仅会加载驱动程序的一个实例。这种多线程模式允许我们在单个生成器上添加和运行更多 Vuser。因此,在线程上运行更具优势。

652. Explain Performance Testing Life Cycle.

解释性能测试生命周期。
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1c20 | 官方: 否 | 付费: 否

答案:

The Performance Testing Life Cycle is a systematic process of carrying out non-functional testing of software applications under test. Performance testing helps to identify bottlenecks in performance and gives an overview of how well our system can perform under varying conditions. The lifecycle of performance testing consists of the following steps:

性能测试生命周期是对被测软件应用进行非功能测试的系统化过程。性能测试有助于识别性能瓶颈,并概述我们的系统在不同条件下表现如何。性能测试生命周期包括以下步骤:
  1. Risk Assessment: The main aim of this phase is to see if the components are eligible for performance testing based on evaluating the risk assessment of the application. Typically this is done by the manager or leader assigned to test the performance. 2. Requirement Gathering & Analysis: Here, the non-functional requirements have to be gathered and client expectations have to be understood thoroughly. The end result of this phase is to arrive at a document called “Performance Testing Requirement Document”. 3. Planning: In this phase, the performance testing team has to come up with a test strategy known as a performance test plan that tests the non-functional requirements gathered above. 4. Design and Scripting: Here, the aim is to write test scripts as per the plan approved in the previous phase. 5. Workload Modelling: The Workload scenario has to be modelled and created based on the test scripts and the test plans. 6. Execution & Analysis: Here, the performance tests have to be executed and the results are to be analyzed based on the test findings. 7. Report and Recommend: Finally, the goal is to compile and publish the report on performance testing and based on the findings, recommend possible solutions to avoid any bottlenecks.

    1. 风险评估:此阶段的主要目的是根据对应用的风险评估,判断组件是否符合性能测试的资格。通常由负责测试性能的经理或组长完成。2. 需求收集与分析:在此阶段,需要收集非功能需求并彻底理解客户期望。此阶段的最终成果是形成一份名为“性能测试需求文档”的文件。3. 规划:在此阶段,性能测试团队必须制定一份测试策略,称为性能测试计划,以测试上文收集的非功能需求。4. 设计与脚本编写:此处的目标是根据上一阶段批准的计划编写测试脚本。5. 工作负载建模:需根据测试脚本和测试计划建模并创建工作负载场景。6. 执行与分析:在此阶段,需执行性能测试,并根据测试发现分析结果。7. 报告与建议:最后,目标是整理并发布性能测试报告,并根据发现结果,推荐可能的解决方案以避免任何瓶颈。

653. What do you understand by the Rendezvous point?

你如何理解集合点?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1c23 | 官方: 否 | 付费: 否

答案:

Rendezvous points create intense load (as defined by rendezvous policy) on the server by instructing multiple Vusers to perform certain tasks simultaneously. They also enable the LoadRunner Professional to calculate the performance under this load. For example, if we want to test how a banking system website performs when there are 20 Vusers simultaneously checking for their account information, we emulate this by instructing the Vusers to check their account information at the same time by creating a rendezvous point. When a Vuser arrives at the rendezvous point early, the LoadRunner Controller holds it there as per the rendezvous policy. A rendezvous policy can be configured based on which the Controller can release the Vusers from that rendezvous point when required Vusers arrive or after a specific amount of time has elapsed. The Vusers are released to perform multitasking simultaneously to simulate the load. A rendezvous point is simply a meeting point for the Vusers between transactions.

集合点通过指示多个 Vuser 同时执行特定任务,在服务器上产生高强度负载(根据集合点策略定义)。它们还使 LoadRunner Professional 能够计算在此负载下的性能。例如,如果我们要测试银行系统网站在有 20 个 Vuser 同时检查账户信息时的表现,我们通过创建集合点指示 Vuser 同时检查其账户信息来模拟此情况。当 Vuser 提前到达集合点时,LoadRunner Controller 会根据集合点策略将其保持在那里。集合点策略可配置,Controller 可根据该策略在所需 Vuser 到达或经过特定时间后从集合点释放 Vuser。Vuser 被释放以同时执行多任务,以模拟负载。集合点仅是 Vuser 在事务之间的会合点。

Rendezvous points can be inserted in any one of the below ways: - During recording, we can click on the Rendezvous button present on the Recording toolbar as shown in the image below, and enter the name in the dialog box. Please note that the name is not case-sensitive.

集合点可以通过以下任一方式插入:- 在录制期间,我们可以点击录制工具栏上的集合点按钮(如下图所示),并在对话框中输入名称。请注意,该名称不区分大小写。
  • After recording, to add a rendezvous point, we need to Select Design --> Insert in Script --> Rendezvous --> enter name.
    After insertion of the rendezvous point, VuGen inserts lr_rendezvous("name_of_point") function into Vuser script to mark that point in the script as a rendezvous point.

    插入集合点后,VuGen 会将 lr_rendezvous("point_name") 函数插入到 Vuser 脚本中,以将该点标记为脚本中的集合点。

654. How can you recognize which protocol should be used for testing any application?

如何识别应使用哪种协议来测试任何应用?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8958d557c902bb1c26 | 官方: 否 | 付费: 否

答案:

Earlier, performance testers had to rely mostly on the project development team to understand what protocol the system under test uses to interact with the server. But, from version 9.5 onwards of LoadRunner, we have a protocol advisor that inherently detects what protocol the application uses and suggests to the testers the best protocol using which the script can be created for simulating real user testing.

以前,性能测试人员主要依赖项目开发团队来了解被测系统与服务器交互所使用的协议。但从 LoadRunner 9.5 版本起,我们有了协议顾问,它能自动检测应用使用的协议,并向测试人员建议最佳协议,从而可创建脚本来模拟真实用户测试。

655. How is lr_abort different from lr_exit?

lr_abort 与 lr_exit 有何不同?
  • 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37b8a58d557c902bb1c29 | 官方: 否 | 付费: 否

答案:

The lr_abort() function does the task of aborting the execution of the script after the execution of the “vuser_end” section. It is useful when we require to abort the script manually due to specific error criteria.

lr_abort() 函数在“vuser_end”部分执行后中止脚本的执行。当我们需要根据特定错误条件手动中止脚本时,此函数非常有用。

The lr_exit() function lets the user exit from the script at the time of execution by giving different continuation options like exiting the Vuser or exiting the current iteration and continuing with the next. There are three ways from which script execution can be exited by the LoadRunner. It can be the exit from iteration, action, or the script itself.

lr_exit() 函数允许用户在执行期间退出脚本,并提供不同的继续选项,例如退出 Vuser 或退出当前迭代并继续下一个。LoadRunner 有三种退出脚本执行的方式:可从迭代、操作或脚本本身退出。

The syntax of lr_exit is :

lr_exit 的语法为:

void lr_exit (int continuation_option, int exit_status);

void lr_exit (int continuation_option, int exit_status);
Here, the continuation_option specifies how the script should continue after calling lr_exit and the exit_status (LR_PASS, LR_FAIL, LR_AUTO, or LR_STOP) defines what should be the status of exit of the scenario group.
此处,continuation_option 指定在调用 lr_exit 后脚本应如何继续,而 exit_status(LR_PASS、LR_FAIL、LR_AUTO 或 LR_STOP)定义场景组退出时应具有的状态。

The following are the types of continuation options available: - LR_EXIT_VUSER – This immediately stops script execution and goes to the vuser_end section.

以下是可用的继续选项类型:- LR_EXIT_VUSER – 这会立即停止脚本执行,并进入 vuser_end 部分。
  • LR_EXIT_ACTION_AND_CONTINUE – This stops the current action and continues to go with the next action.
  • LR_EXIT_ITERATION_AND_CONTINUE – This exits the execution of the current iteration and goes to the next iteration.
  • LR_EXIT_VUSER_AFTER_ITERATION – This stops the script execution after the current iteration is complete.
  • LR_EXIT_VUSER_AFTER_ACTION – This stops the script execution after the current action is complete.
    It is interesting to note that if lr_exit is called with LR_EXIT_VUSER as the continuation option and LR_ABORT as exit status, then it equals the lr_abort functionality as both of its aims is to abort the script execution.

    值得注意的是,如果以 LR_EXIT_VUSER 作为继续选项,并以 LR_ABORT 作为退出状态来调用 lr_exit,则该操作等同于 lr_abort 功能,因为两者的目的都是中止脚本执行。

656. Name some of the most popular integration testing tools.

列出一些最流行的集成测试工具名称。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4447 | 官方: 否 | 付费: 否

答案:

Among the most commonly used integration testing tools are: - DBUnit

最常用的集成测试工具包括:- DBUnit
  • Mockito
  • Greenmail
  • REST-Assured
  • JUnit 5
  • H2 Database, etc.

657. What do you mean by Critical bug?

你所说的关键缺陷是什么意思?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb444a | 官方: 否 | 付费: 否

答案:

The term critical bug refers to a bug that affects the majority of an application's functionality. When a critical defect occurs, testing cannot proceed until the defect is fixed. These block the functionality of an entire system or module. An application returning a server error message after an attempt to log in is an example of a critical defect.

关键缺陷一词指的是影响应用程序大部分功能的缺陷。当出现关键缺陷时,测试无法继续进行,直到缺陷被修复。这些缺陷会阻塞整个系统或模块的功能。应用程序在尝试登录后返回服务器错误消息就是一个关键缺陷的例子。

658. What do you mean by Data flow testing?

你所说的数据流测试是什么意思?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4450 | 官方: 否 | 付费: 否

答案:

Data flow testing involves analyzing the flow of data within a program. It is a type of structural testing. It is possible, thus, for a programmer to perform various tests on data values and variables. This method provides a way to identify the variables that are used at every stage of the program's control flow. It helps us in the following ways: - Eliminate or remove variables that are never used after being declared.

数据流测试涉及分析程序内数据的流动。它是一种结构测试。因此,程序员可以对数据值和变量执行各种测试。此方法提供了一种方式来识别程序控制流每个阶段中使用的变量。它通过以下方式帮助我们:- 消除或移除在声明后从未使用的变量。
  • Pinpoint variables that are used but never declared.
  • Deallocate variable before it is used.
  • Pinpoint variables that are defined multiple times before it is used.

659. What are the differences between manual and automated testing?

手动测试和自动化测试之间有什么区别?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4456 | 官方: 否 | 付费: 否

答案:

Manual and automated testing differ in the following ways:

手动测试和自动化测试在以下方面存在差异:
Manual Testing
手动测试
Automated Testing
自动化测试
A human tester tests the software by manually running the test cases and observing and comparing the actual and expected outputs.
人工测试人员通过手动运行测试用例,观察并比较实际输出和预期输出来测试软件。
A tester or a programmer uses scripts and tools that execute the software and compares the actual and expected outputs.
测试人员或程序员使用脚本和工具执行软件,并比较实际输出和预期输出。
A manual test cannot be reproducible and repeated.
手动测试无法重现和重复。
Automated testing can be consistently reproduced and repeated since it is programmed. Testers can run it as many times as they want.
自动化测试可以一致地重现和重复,因为它是编程的。测试人员可以根据需要多次运行。
It is easy for testers to test new features manually, without much configuration or setup.
测试人员可以轻松地手动测试新功能,无需太多配置或设置。
Automated testing requires an initial investment in creating tests and preparing a testing environment.
自动化测试需要初始投资来创建测试和准备测试环境。
A manual test can help identify bugs in the user interface or accessibility issues.
手动测试有助于识别用户界面中的缺陷或可访问性问题。
The automated testing method is more effective at catching bugs that humans would miss, such as software bugs or errors in business logic.
自动化测试方法在捕捉人类可能遗漏的缺陷(如软件错误或业务逻辑错误)方面更有效。
Tests conducted manually are prone to human error and take a long time.
手动执行的测试容易有人为错误,并且耗时长。
Compared to manual testing, automated testing is more reliable since there is no human involvement involved (apart from writing tests). It is significantly faster than manual testing.
与手动测试相比,自动化测试更可靠,因为没有人为参与(除了编写测试外)。它明显比手动测试快。

660. State difference between static and dynamic testing.

说明静态测试和动态测试之间的区别。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4459 | 官方: 否 | 付费: 否

答案:

Static and Dynamic testing differ in the following ways:

静态测试和动态测试在以下方面有所不同:
| Static Testing
静态测试 | Dynamic Testing
动态测试 |
In static testing, software applications are tested without executing any code at the very beginning of the SDLC.
在静态测试中,软件应用在SDLC最开始时无需执行任何代码即可进行测试。
The test checks software functionality, memory/CPU usage, and system performance at the end of the development cycle.
测试在开发周期结束时检查软件功能、内存/CPU使用率和系统性能。
It is performed during the verification stage.
在验证阶段执行。
It is performed during the validation stage.
在确认阶段执行。
This is performed prior to the deployment of the code.
在代码部署之前执行。
Following the deployment of the code, dynamic testing is performed.
在代码部署之后执行动态测试。
A static test prevents defects from occurring.
静态测试能防止缺陷发生。
In dynamic testing, defects are detected and fixed.
在动态测试中,缺陷会被检测并修复。
A walkthrough, technical review, and inspection are all part of this process.
该过程包括走查、技术评审和检查。
Functional and non-functional testing is involved in this process.
该过程涉及功能性和非功能性测试。
Errors are found early in the development process, thereby improving the quality of software applications.
错误在开发过程中早期被发现,从而提高软件应用的质量。
The main objective is to ensure that the software product meets the business requirements.
主要目标是确保软件产品满足业务需求。

661. What is the term ‘quality’ mean when testing?

测试中“质量”一词是什么意思?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb445c | 官方: 否 | 付费: 否

答案:

In general, quality software is usually free of bugs, is delivered on time and on budget, meets most of the requirements and/or expectations, and is easy to maintain. However, 'quality' is a subjective concept. A lot depends on whom the "customer" is as well as the extent to which they are influential in general. For instance, a user may define quality as user-friendliness and bug-free while an accounting department might define quality as profits.

一般来说,质量软件通常没有缺陷、按时在预算内交付、满足大多数要求和/或期望,并且易于维护。然而,“质量”是一个主观概念。很大程度上取决于“客户”是谁以及他们对整体影响力的程度。例如,用户可能将质量定义为用户友好和无缺陷,而会计部门可能将质量定义为利润。

662. What is the difference between Quality Control(QC) and Quality Assurance(QA)?

质量控制(QC)和质量保证(QA)有什么区别?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb445f | 官方: 否 | 付费: 否

答案:

Quality Assurance: - QA stands for Quality Assurance. As part of a software development team, a QA ensures that the software is thoroughly tested before being released to the end-user. It ensures that the shipped software is of high quality.

质量保证: - QA代表质量保证。作为软件开发团队的一部分,QA确保软件在发布给最终用户之前经过全面测试。它确保交付的软件具有高质量。
  • It focuses on improving the software development process and is typically carried out during the development phase. It is possible for testers and quality assurance personnel to be the same person in many software organizations, although the roles may differ depending on the organization's size.
    Quality Control: - QC stands for Quality Control. The main goal of this process is to verify that the developed products meet the required standards.

    质量控制: - QC代表质量控制。此过程的主要目标是验证开发的产品符合所需标准。
  • Software quality-control tests and reviews the functional and non-functional requirements of a software product to ensure its quality. QC activities are typically performed after a product is developed to assess the quality of end products.

Check out more differences here: QA vs QC .

查看此处更多差异:QA vs QC。

663. State difference between alpha testing and beta testing.

说明alpha测试和beta测试之间的区别。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4462 | 官方: 否 | 付费: 否

答案:

Alpha and beta testing differ in the following ways:

Alpha和Beta测试在以下方面有所不同:
Alpha Testing
Alpha测试
Beta Testing
Beta测试
During this type of testing, bugs are identified before the product is released to users. An example of a user acceptance test is Alpha Testing.
在这种测试中,缺陷在产品发布给用户之前被识别。Alpha测试是用户验收测试的一个例子。
The test is conducted by real users of the software application in a real environment. An example of a User Acceptance Test is beta testing.
测试由软件应用的真实用户在真实环境中进行。Beta测试是用户验收测试的一个例子。
Both white box and black box testing are involved in Alpha testing.
Alpha测试涉及白盒和黑盒测试。
A black-box testing is commonly used in beta testing.
Beta测试中通常使用黑盒测试。
In most cases, alpha testing is done by internal testers within an organization.
大多数情况下,Alpha测试由组织内的内部测试人员进行。
Clients who are not affiliated with the organization perform beta testing.
与组织无关联的客户执行Beta测试。
As the activities are performed on the developer's site, they can be controlled.
由于活动在开发人员站点上执行,因此可以进行控制。
Because activities are performed in the real world, in the end, the user's environment, cannot be controlled.
由于活动在现实世界中(即最终用户环境中)执行,因此无法控制。
Alpha testing does not include robustness and security tests.
Alpha测试不包括健壮性和安全性测试。
Beta testing includes robustness and security tests.
Beta测试包括健壮性和安全性测试。
The quality evaluation is the main objective.
质量评估是主要目标。
Customer satisfaction is the main objective.
客户满意度是主要目标。
Alpha testing allows developers to quickly address critical issues.
Alpha测试允许开发人员快速解决关键问题。
Most of the issues or feedback gathered during beta testing will be incorporated into future versions.
Beta测试期间收集的大多数问题或反馈将纳入未来版本。

664. Explain Monkey Testing and Performance Testing.

解释猴子测试和性能测试。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4465 | 官方: 否 | 付费: 否

答案:

Monkey Testing: Monkey testing, also known as Random Testing, is a type of software testing technique in which data is generated randomly using a tool or some automated mechanism. This randomly generated input is used to test the system, and the results are analyzed accordingly. Testing of this type does not follow any rules.

猴子测试:猴子测试,也称为随机测试,是一种软件测试技术,其中数据使用工具或某些自动化机制随机生成。这种随机生成的输入用于测试系统,并相应分析结果。这种测试不遵循任何规则。

Performance Testing: It is a type of non-functional software testing technique that is used to determine the system parameters like speed, scalability, and stability under different workload conditions. Its main purpose is to eliminate performance bottlenecks, not to find bugs. Some of the key parameters of performance testing include: - CPU Utilization

性能测试:这是一种非功能性软件测试技术,用于确定系统参数,如不同工作负载条件下的速度、可扩展性和稳定性。其主要目的是消除性能瓶颈,而不是查找缺陷。性能测试的一些关键参数包括:- CPU利用率
  • Memory Utilization
  • QPS/TPS (Transaction per second)
  • Average load time
  • System throughput, etc.

665. What is the role of documentation in manual testing?

文档在手动手测试中有什么作用?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4468 | 官方: 否 | 付费: 否

答案:

Effective software testing relies heavily on documentation. Documentation should include details such as requirements specifications, business rules, configurations, designs, test plans, code changes, test cases, bug reports, inspection reports, user manuals, etc. As part of software testing, the following documentation artifacts are commonly applied: - Test Plan: It is essentially a dynamic document controlled and monitored by the testing manager. A well-written test plan that describes the scope and activities of software testing is crucial for the success of a testing project. In essence, it serves as a blueprint for all aspects of the testing process, such as what, when, how, and more.

有效的软件测试在很大程度上依赖于文档。文档应包括需求规格说明、业务规则、配置、设计、测试计划、代码变更、测试用例、缺陷报告、检查报告、用户手册等详细信息。作为软件测试的一部分,通常使用以下文档产物: - 测试计划:它本质上是一个动态文档,由测试经理控制和监控。一份编写良好的测试计划,描述软件测试的范围和活动,对测试项目的成功至关重要。本质上,它充当测试过程所有方面(如内容、时间、方式等)的蓝图。
  • Test Scenario: A test scenario is a detailed description of a set of test cases or use cases. It involves testing a software application from the end user's perspective. It is usually the basis for constructing lower-level test cases or use cases. The test scenario can also be referred to as the test condition or the testing possibility. Taking a look at it will help you understand what we need to test.
  • Test Case: As the name implies, a test case is a document that contains test data, expected results, preconditions, and postconditions. The purpose of this document is to ensure the software product meets the specific requirements for a specific test scenario. Manual testing involves executing test cases manually by a tester without relying on automated tools. In the process of developing test cases, it is possible to identify loopholes in the specifications.
  • Traceability Matrix: This is a document, usually contained in a form table, that illustrates the relationship between requirements and other project artifacts from start to finish. To put it simply, it maps customer requirements to test cases.

666. Explain RTM (Requirement Traceability Matrix).

解释RTM(需求追踪矩阵)。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb446b | 官方: 否 | 付费: 否

答案:

The RTM (Requirements Traceability Matrix) is defined as a tool used to identify and track the requirements and deliverables of a project. This is accomplished by establishing a thread for each component. In addition, it manages the overall requirements of the project. There is nothing complicated about this method, and anyone can do it.

RTM(需求追踪矩阵)被定义为一种用于识别和跟踪项目需求及交付物的工具。这是通过为每个组件建立一条线索来实现的。此外,它管理项目的整体需求。这种方法并不复杂,任何人都可以执行。

RTMs come in many forms. A test matrix, for example, proves that tests were conducted. Additionally, it can be used during the software development process to identify issues and requirements.

RTM有多种形式。例如,测试矩阵用于证明测试已进行。此外,它可在软件开发过程中用于识别问题和需求。

667. What is the importance of agile testing?

敏捷测试的重要性是什么?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb446e | 官方: 否 | 付费: 否

答案:

The agile testing process involves software testing that adheres to agile software development principles. The software is evaluated from the customer's perspective. This software development practice involves frequent, automated testing of new code and the immediate fixing of defects as soon as they are discovered. Each feature is tested as it is developed. Among its advantages are: - All testers and developers can work together, boosting performance.

敏捷测试过程涉及遵循敏捷软件开发原则的软件测试。软件从客户的角度进行评估。这种软件开发实践包括对新代码进行频繁的自动化测试,并在发现缺陷后立即修复。每个功能在开发时都会进行测试。其优点包括:- 所有测试人员和开发人员可以一起工作,提升性能。
  • Each feature is tested as it is developed.
  • Ensures a high-quality product that meets customer expectations.
  • Reduces costs and saves time.
  • Highly adaptable and flexible.
  • Assists developers with releasing software as soon as possible and improves product quality.

668. What is the difference between Regression and Retesting?

回归测试和复测有什么区别?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4471 | 官方: 否 | 付费: 否

答案:

  • Regression Testing: Regression testing, also known as generic testing, revolves around re-running functional and non-functional tests. It is especially done to ensure whether previously developed and tested software still performs the same after a change or not. It can be performed either manually or using automated tests
  • Re-testing: Re-testing, also known as planned testing, is used for specific bugs after it has been fixed by the developers. Re-testing is performed to check the scenario under the same environmental conditions after detection has been fixed.

Regression vs Retesting

回归测试与复测
| Regression
回归测试 | Retesting
复测 |
It is performed to make sure that the changes haven't affected the unchanged part.
执行回归测试是为了确保更改未影响未更改的部分。
This is done to ensure that the test cases which were filed during the last execution are passed after the detected bugs have been fixed by developers.
复测是为了确保上次执行中提交的测试用例在开发人员修复检测到的缺陷后能够通过。
It is not carried out to fix specific detects.
它不用于修复特定缺陷。
Usually, it is based on fixing defects.
它通常基于缺陷修复。
It is only the previous version functionality centric.
它仅关注先前版本的功能。
It is current or previous version functionality centric.
它关注当前或先前版本的功能。
It can be performed parallel with retesting.
它可以与复测并行进行。
It is needed to perform before regression testing.
它需要在回归测试之前执行。
It does not include the verification of bugs.
它不包括缺陷的验证。
It includes the verification of bugs.
它包括缺陷的验证。
In this type of testing, test cases can be automated and the testing style is generic.
在此类测试中,测试用例可以自动化,且测试风格是通用的。
In this type of testing, test cases cannot be automated and the testing is done in a planned manner.
在此类测试中,测试用例不能自动化,且测试以计划方式进行。
It is only used for passed test cases.
它仅用于已通过的测试用例。
It is only used for failed test cases.
它仅用于失败的测试用例。

669. What is System testing and Unit Testing? Write the difference between them.

什么是系统测试和单元测试?写出它们之间的区别。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4474 | 官方: 否 | 付费: 否

答案:

  • System Testing: It is a typical black box testing technique that is performed in a complete and fully integrated system to evaluate the system’s compliance with its specific requirements. It must investigate both functional requirements and non-functional requirements. Generally, it is performed by both testers and developers.
  • Unit Testing: In unit testing, each component of the software is individually tested. Generally, unit testing is performed by developers. Those systems that have a lot of interdependencies between their modules cannot be tested by unit testing.

System vs Integration Testing

系统测试与单元测试
| System Testing
系统测试 | Unit Testing
单元测试 |
The system testing method involves treating each module as a separate target for testing, and integrating the modules after each has been tested.
系统测试方法涉及将每个模块作为单独的测试目标,并在每个模块测试后集成这些模块。
The purpose of unit testing is to test only one module at a time, rather than the integrated version of the application.
单元测试的目的是每次只测试一个模块,而不是测试应用的集成版本。
Generally, when it comes to unit testing, a single module testing approach is taken.
通常,在单元测试中,采用单一模块测试方法。
For System test cases, it includes both top-down approach testing and bottom-up approach testing with all modules in integrated mode.
对于系统测试用例,它包括自上而下和自下而上的测试方法,所有模块以集成模式进行。
It focuses on system validation.
它侧重于系统验证。
It focuses on functional verification.
它侧重于功能验证。
It usually follows the requirements specification.
它通常遵循需求规格。
It usually follows the specification of modules.
它通常遵循模块规格。
It is also known as black-box testing.
它也被称为黑盒测试。
It is also known as white-box testing.
它也被称为白盒测试。
It is a low-level test as compared to unit testing.
与单元测试相比,它是一种低级测试。
It is a high-level test as compared to system testing.
与系统测试相比,它是一种高级测试。

670. What are the types of Integration Testing?

集成测试有哪些类型?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4477 | 官方: 否 | 付费: 否

答案:

Integration testing includes the following types: - Big bang testing: It involves integrating all the modules and components at once and then testing them as a whole (single unit). When testing these components together, they are treated as an entity. The integration process will not proceed if all the components of the unit are not completed.

集成测试包括以下类型:- 大爆炸测试:它涉及一次性集成所有模块和组件,然后将它们作为一个整体(单一单元)进行测试。当这些组件一起测试时,它们被当作一个实体处理。如果单元的所有组件未完成,集成过程将不会继续。
  • Bottom-Up Testing: This strategy involves testing lower-level modules first, then moving on to higher-level modules. As long as top-level modules have been tested, the process continues. Upon integrating and testing the lower-level modules, the next level of modules will be created.
  • Top-Down Testing: This strategy involves testing software systems from top to bottom according to the control flow. Tests are conducted first on the higher-level modules, followed by tests and integration of the lower-level modules to verify the functionality of the software. Testing is carried out using stubs when some modules are not yet ready.

671. State the difference between bug leakage and bug release.

说明缺陷泄漏和缺陷发布之间的区别。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb447a | 官方: 否 | 付费: 否

答案:

Bug leakage and bug release differ in the following ways:

缺陷泄漏和缺陷发布在以下方面有所不同:
Bug Leakage
缺陷泄漏
Bug Release
缺陷发布
Bug leakage refers to a defect that exists during testing yet is not discovered by the tester but is eventually discovered by the end-user.
缺陷泄漏指在测试期间存在但未被测试人员发现,最终却被最终用户发现的缺陷。
When a piece of software is released with a known bug(s) or defect(s), it is termed a bug release.
当软件在已知缺陷存在的情况下发布时,称为缺陷发布。
It is usually a high priority/severity bug.
它通常是高优先级/高严重性的缺陷。
It is not a high priority/severity bug.
它不是高优先级/高严重性的缺陷。
The bugs need to be addressed immediately and resolved as soon as possible.
这些缺陷需要立即处理并尽快解决。
Software companies do this when they can afford to release software with bugs, but cannot afford to fix them in that version.
软件公司这样做是当他们能承受发布带有缺陷的软件,但无法在该版本中修复它们时。

672. What is Test Harness and Test Closure?

什么是测试框架和测试收尾?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb447d | 官方: 否 | 付费: 否

答案:

Test Harness: Test harness, also known as the automated test framework, is a collection of software and test data required to unit test software modules during development. It is mostly used by the developers and helps in the automation and execution of unit test cases. It generally includes two main parts as given below: - Test execution engine

测试框架:测试框架,也称为自动化测试框架,是开发过程中用于单元测试软件模块所需的软件和测试数据的集合。它主要由开发者使用,有助于自动化执行单元测试用例。它通常包括以下两个主要部分:- 测试执行引擎
  • Test script repository
    Test Closure: Test closure is basically a document that provides the summary of all the tests that are performed during SDLC. It gives full detailed analysis reports of the bugs that are discovered and removed. It is usually performed prior to the end of the testing process.

    测试收尾:测试收尾基本上是一份文档,提供SDLC期间执行的所有测试的摘要。它给出发现和移除的缺陷的详细分析报告。通常在测试过程结束之前执行。

673. Explain different stages of the defect life cycle.

解释缺陷生命周期的不同阶段。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4480 | 官方: 否 | 付费: 否

答案:

The defect life cycle consists of the following stages: - New: Potential defect that hasn't been validated.

缺陷生命周期包括以下阶段:- 新建:尚未验证的潜在缺陷。
  • Assigned: Assigned to a team for resolution, but not yet resolved.
  • Active: Developers are currently investigating the defect and addressing it. Deferred or Rejected are the two possible outcomes at this stage.
  • Test: The defect has been fixed and can be tested.
  • Verified: The defect has been retested and the results have been verified by QA.
  • Closed: Defect in its final state, which can be closed after retesting by QA or when considered duplicate or not a defect.
  • Reopened: QA reopens/reactivates a defect when it has not been fixed.
  • Deferred: A defect that can't be addressed in the current cycle is deferred to a future release.
  • Rejected: There are three common reasons for rejecting a defect: duplicate, not a defect, and not reproducible.

674. Explain Experienced-based testing techniques.

解释基于经验的测试技术。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4483 | 官方: 否 | 付费: 否

答案:

The experience-based testing technique is a type of testing that is based on the tester’s experience with testing to understand the essential areas of a system. This type of testing is generally used in a low-risk system. Individuals’ information, abilities, and foundation knowledge are prime supporters of the test conditions and experiments in experienced-based techniques. There are four different experienced-based testing techniques as shown below:

基于经验的测试技术是一种基于测试者对系统关键领域的理解和测试经验的测试类型。这种测试通常用于低风险系统。在基于经验的技术中,个人的信息、能力和基础知识是测试条件和实验的主要支持因素。有以下四种不同的基于经验的测试技术,如下所示:

675. Write the difference between smoke testing and sanity testing.

写出冒烟测试和健全性测试之间的区别。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4486 | 官方: 否 | 付费: 否

答案:

  • Smoke Testing: This is a type of testing performed to ensure that the acute functionalities of the program are working well. It acts as a confirmation of whether the quality assurance team can further proceed with testing or not.
  • Sanity Testing: It is an unscripted form of testing performed to ensure that the code changes that are made are working well. It is performed by the test team for some basic tests. This testing focuses on one or a few areas of functionality and is usually narrow and deep.
Smoke Testing
冒烟测试
Sanity Testing
健全性测试
In this test, the test team measures the system's stability before moving on to more rigorous testing.
在此测试中,测试团队在进入更严格的测试之前测量系统的稳定性。
In this testing, the test team measures the rationality of the system before moving on to more rigorous testing.
在此测试中,测试团队在进入更严格的测试之前测量系统的合理性。
Developers or testers usually perform this task.
开发者或测试者通常执行此任务。
Testers usually perform this task.
测试者通常执行此任务。
Both manual and automated methods can be used to execute it.
可以使用手动和自动两种方法执行。
Automated tools cannot be used to execute it; they must be done manually.
不能使用自动化工具执行;必须手动完成。
In most cases, it takes place during the development of a new product.
在大多数情况下,它发生在新产品开发期间。
The test is generally performed after the regression test.
该测试通常在回归测试之后执行。
There is documentation, and it is used to test the application's end-to-end functionality.
有文档,用于测试应用程序的端到端功能。
There is no documentation, and it is used to test only functions that have been modified or have been fixed.
没有文档,仅用于测试已修改或已修复的功能。
It is also considered a subset of acceptance testing.
它也被视为验收测试的子集。
It is also considered a subset of regression testing.
它也被视为回归测试的子集。

Check out More Differences .

查看更多差异。

676. What do you mean by pesticide paradox? What you can do to overcome it.

农药悖论是什么意思?你能做什么来克服它。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb4489 | 官方: 否 | 付费: 否

答案:

The pesticide paradox is basically a phenomenon where the more one tests the software, the more it becomes immune to its tests. To overcome this, testers should always find new strategies, approaches, and test cases, so that they can identify bugs and resolve them. The following methods can be used to prevent the pesticide paradox: - Create a new set of test cases for different components of the software.

农药悖论基本上是一种现象,即软件测试得越多,它对测试就越具有免疫力。为了克服这一点,测试人员应始终寻找新的策略、方法和测试用例,以便识别并解决缺陷。以下方法可用于防止农药悖论:- 为软件的不同组件创建一组新的测试用例。
  • Adding new test cases to the existing test cases.
    The use of these methods can lead to finding more defects in the areas where defect levels have declined.

    使用这些方法可以在缺陷水平下降的区域中发现更多缺陷。

677. Explain the term testbed.

解释术语“测试平台”。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb448c | 官方: 否 | 付费: 否

答案:

Testbed is generally referred to as a digital platform that is used for testing an application. It includes an operating system, database, hardware, network configuration, software application under test, and all other software-related issues.

测试平台通常指用于测试应用程序的数字平台。它包含操作系统、数据库、硬件、网络配置、被测软件应用程序以及所有其他与软件相关的问题。

678. Explain bugs, defects, and errors.

解释错误、缺陷和故障。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc558d557c902bb448f | 官方: 否 | 付费: 否

答案:

  • Error: The error occurs when there is a programming mistake in the code that prevents the program from executing or compiling.
  • Defect: A defect is any variation between the actual result and the expected result determined by a tester or developer. Defects are typically detected after the product enters production and are resolved only during the development phase.
  • Bug: A software bug is detected during the testing phase as a fault or mismatch. This affects the functionality and performance of the software.

679. What is the software testing life cycle?

什么是软件测试生命周期?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc658d557c902bb4492 | 官方: 否 | 付费: 否

答案:

STLC (Software Testing Life Cycle) is a fundamental part of SDLC which is used to test software and ensure that the quality standards are met. Verification and validation are generally involved in this process. In this, different activities are executed in a specific order throughout the software testing process. There are basically six different phases in STLC Model as shown below:

STLC(软件测试生命周期)是SDLC的基本组成部分,用于测试软件并确保达到质量标准。验证和确认通常包含在该过程中。在此过程中,不同的活动在软件测试过程中按特定顺序执行。STLC模型基本上包含六个不同阶段,如下所示:
  • Requirement Analysis: ​​The QA team analyzes the requirements to determine what we are going to test and what the testable requirements are.
  • Test Planning: This phase involves defining the test strategy. This step determines the project's objective and scope.
  • Test Case Development: This stage involves defining and developing detailed test cases. Test data is also prepared by the testing team for testing.
  • Test Environment Setup: This is the software and hardware setup that the testing teams use to execute test cases.
  • Test Execution: This involves executing code and comparing it with the expected results.
  • Test Cycle Closure: This involves calling out a meeting of the testing team members to evaluate and assess cycle completion criteria based on cost, time, test coverage, quality, and critical business objectives and software.

680. What is black-box testing?

什么是黑盒测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc658d557c902bb4495 | 官方: 否 | 付费: 否

答案:

In black-box testing, the tester views the software as a black box, ignoring all the internal structure and behaviour. It is solely concerned with the input provided by the user and the output generated by the system. Black-box testing verifies the program’s behaviour against the specified requirements.

在黑盒测试中,测试人员将软件视为一个黑盒,忽略所有内部结构和行为。它仅关注用户提供的输入和系统生成的输出。黑盒测试根据指定的需求验证程序的行为。

As part of black-box testing, test conditions are created based on the software's functionality without knowing how it works internally. In this approach, the software is tested from the point of view of the end-user and provides a broader view of the entire system. In light of the fact that users are only concerned with whether the software meets their needs, rather than how it works, black-box testing is an excellent way to test software usability and anticipate how customers will use it.

作为黑盒测试的一部分,测试条件基于软件的功能创建,而无需了解其内部工作方式。在这种方法中,软件从最终用户的角度进行测试,并提供对整个系统的更广泛视角。鉴于用户只关心软件是否满足其需求,而非其工作方式,黑盒测试是测试软件可用性和预测客户使用方式的极佳方法。

681. What white-box testing?

什么是白盒测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37bc658d557c902bb4498 | 官方: 否 | 付费: 否

答案:

White-box testing is an alternative to black-box testing that involves viewing the system as a transparent box. It is possible for the testers to observe the internal implementation of the system, which helps them conduct the test. In most cases, white-box testing is performed by the software developers during the development process.

白盒测试是黑盒测试的替代方案,涉及将系统视为透明盒。测试人员可以观察系统的内部实现,这有助于他们进行测试。在大多数情况下,白盒测试由软件开发人员在开发过程中执行。

It is also referred to as closed-box testing.

它也被称为封闭盒测试。

In white-box testing, we assume that the tester has some programming knowledge. The test covers all possible branches a program could follow in a running system. The more you know about the inside of a system, such as its source code and implementation details, the more thoroughly you can test it.

在白盒测试中,我们假设测试人员具备一定的编程知识。测试覆盖程序在运行系统中可能遵循的所有可能分支。你对系统内部(如源代码和实现细节)了解越多,就越能全面地进行测试。

682. What are some of the best tips for conducting performance testing?

进行性能测试的一些最佳技巧是什么?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1558d557c902bb722b | 官方: 否 | 付费: 否

答案:

Following are some of the best tips for conducting performance testing: - The test environment should mirror the production ecosystem as much as possible. If there are any deviations, then the test results might not be accurate and might cause problems when the application goes live.

以下是进行性能测试的一些最佳技巧:- 测试环境应尽可能镜像生产生态系统。如果存在任何偏差,那么测试结果可能不准确,并可能在应用程序上线时引发问题。
  • It is preferred to have a separate environment dedicated to performance testing.
  • The tools selected for testing should automate our test plan in the best possible way.
  • Performance tests should be run several times for obtaining a consistent accurate measure of the performance.
  • The performance test environment should not be modified in between the testing process.
    Conclusion

    结论

Performance testing provides in-depth insights regarding the non-functional application requirements like scalability, speed, availability and reliability of the software under test. These help in identifying and resolving the shortcomings and gaps in performance before the application goes live.

性能测试提供了关于非功能应用需求的深入见解,如被测软件的可扩展性、速度、可用性和可靠性。这些有助于在应用程序上线前识别并解决性能上的缺陷和差距。

Additional Resources

其他资源

683. When should we conduct performance testing for any software?

我们何时应对任何软件进行性能测试?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1558d557c902bb722e | 官方: 否 | 付费: 否

答案:

Performance testing is done for measuring the performance of any action in the application. We can run performance tests for checking the performance of the websites and apps. In case we are following waterfall methodology, we can test every time we release a new software’s version. If we are using agile methodology, then we need to test continuously.

性能测试用于衡量应用程序中任何操作的性能。我们可以运行性能测试来检查网站和应用程序的性能。如果遵循瀑布方法论,我们可以在每次发布新软件版本时进行测试。如果使用敏捷方法论,那么我们需要持续测试。

684. What are the common mistakes committed during performance testing?

性能测试期间常犯的错误有哪些?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1558d557c902bb7234 | 官方: 否 | 付费: 否

答案:

Following are some of the mistakes committed during performance testing: - Unknown or unclear non-functional requirements provided by the business.

以下是性能测试期间会犯的一些错误:- 业务提供的不明确或不清晰的非功能需求。
  • Unclear workload details
  • Directly jumping to multi-user tests
  • Running test cases for a small duration
  • Confusion on an approximation of the concurrent users
  • Difference between the test and production environments
  • Network bandwidth not stimulated properly
  • No clear base-lining of the system configurations.

685. What are the metrics monitored in performance testing?

性能测试中监控的指标有哪些?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1558d557c902bb723b | 官方: 否 | 付费: 否

答案:

Following are the metrics monitored in performance testing:

以下是性能测试中监控的指标:
Metrics
指标
Description
描述
Processor utilization
处理器利用率
Time spent by the processor to execute non-idle threads.
处理器执行非空闲线程所花费的时间。
Memory usage
内存使用量
Amount of physical memory available so that the server can process.
服务器可用的物理内存量。
Disk time
磁盘时间
Time taken by the disk to execute read/write request.
磁盘执行读/写请求所花费的时间。
Bandwidth
带宽
Represented in bits per second (bps) used by network interfaces.
以网络接口使用的比特每秒(bps)表示。
CPU interrupts per second
CPU每秒中断次数
Average number of hardware interrupts received and processed by the processor each second.
处理器每秒接收和处理的中断平均次数。
Response time
响应时间
Time taken to get the first character of the response from the server to the client.
从服务器向客户端获取响应的第一个字符所花费的时间。
Throughput
吞吐量
Rate at which the server or network receives requests per second.
服务器或网络每秒接收请求的速率。
Amount of connection pooling
连接池数量
Number of user requests met by pooled connections. The higher the number, the better is the performance.
由池化连接满足的用户请求数量。数字越高,性能越好。
Maximum active sessions
最大活动会话数
Maximum sessions which are active at once.
同时处于活动状态的最大会话数。
Hits per second
每秒点击次数
Number of hits every second
每秒的点击次数。
Thread counts
线程数量
Number of threads running actively
活动运行的线程数。
Private bytes
私有字节
Number of bytes allocated by the processor which cannot be shared among other processes. They are used for measuring memory leaks and memory usage.
处理器分配的不能被其他进程共享的字节数。它们用于测量内存泄漏和内存使用情况。
Committed memory
提交内存
Amount of virtual memory utilized
已使用的虚拟内存量。
Memory pages/second
内存页/秒
Number of pages read from or written to the disk to resolve page faults.
从磁盘读取或写入磁盘以解决页面错误的页面数。
Page faults/second
页面错误/秒
Overall rate at which fault pages are processed.
处理错误页面的总速率。

686. Can the end-users of the application conduct performance testing?

应用程序的最终用户能进行性能测试吗?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1558d557c902bb723f | 官方: 否 | 付费: 否

答案:

No, end-users cannot conduct performance testing. However, while making use of the software the end-users can discover software bottlenecks. However, that cannot be equated to actual performance testing performed by professional testers. If the end-users want to participate in testing, they can be accommodated in the User Acceptance Testing phase.

不,最终用户不能进行性能测试。然而,在使用软件时,最终用户可能会发现软件瓶颈。但这不能等同于由专业测试人员进行的实际性能测试。如果最终用户想参与测试,他们可以被纳入用户验收测试阶段。

687. What do you mean by concurrent user hits in load testing?

负载测试中的并发用户命中是什么意思?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1558d557c902bb7243 | 官方: 否 | 付费: 否

答案:

Concurrent user hits scenarios arise when more than one user will be hitting or requesting for the same event during the load testing process. This scenario is tested to ensure that multiple users can access the same event requests at the same time in the application.

并发用户命中的场景出现在负载测试过程中,多个用户将同时点击或请求同一事件时。测试此场景是为了确保多个用户能在应用程序中同时访问同一事件请求。

688. What are the best ways for carrying out spike testing?

执行尖峰测试的最佳方法有哪些?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1558d557c902bb7249 | 官方: 否 | 付费: 否

答案:

Spike testing can be carried out by bombarding the application with networking, random connections, data, different operations, firing requests to every single functionality of the application. In this way, the application is pushed to the limits and monitoring can be done to identify if it can work under pressure. The data monitored can be documented and then be analyzed.

尖峰测试可以通过向应用程序发送网络、随机连接、数据、不同操作以及针对应用程序每一项功能发出请求来轰炸应用程序。通过这种方式,应用程序被推至极限,并可进行监控以判断其能否在压力下正常工作。监控到的数据可以记录下来,然后进行分析。

689. How is endurance testing different from spike testing?

耐力测试与尖峰测试有何不同?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1558d557c902bb725f | 官方: 否 | 付费: 否

答案:

  • Endurance testing deals with how long the application can endure and perform well irrespective of the loads. Sometimes when an application is used for a long time, it becomes slow or inactive which is why it becomes important to conduct this testing. Endurance testing analyses all changes in the application by simulating lengthy application usage. For example, endurance testing is conducted on a Banking application where we test if it can perform normally under continuous load or large transactions for a long time.
  • Spike testing deals with pushing the application to the limits by subjecting the software to the highest operation level for identifying the strengths and weaknesses of the application. Spike testing is necessary for instances when eCommerce or shopping sites launch flash sales or holiday discount deals where suddenly a large number of users will be accessing the application. If the application crashes under sudden spike every time, then it would result in a bad user experience and the users would lose faith in the application.

690. How is load testing different from stress testing?

负载测试与压力测试有何不同?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1558d557c902bb726f | 官方: 否 | 付费: 否

答案:

  • Load testing is a type of testing that analyzes the software performance when it is saddled with more than normal workloads. The load can be of any kind - data or users accessing the system or the application itself on the server’s operating system. When the load is increased, some applications tend to perform slowly (degenerate) and in some other cases, the applications run normally. Load testing determines that the applications run at optimal levels irrespective of the load given to them.
  • Stress testing on the other hand has a broader approach to the software’s performance. It considers the amount of data processed, time taken to process it, network connectivity levels and other applications running in the background. When the stress levels are high, software tends to crash or stop working altogether. This testing imitates the stressful environment to test the resistance of the software to operate correctly.

691. What are the pre-requisites to enter and exit a performance test execution phase?

进入和退出性能测试执行阶段有哪些先决条件?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1658d557c902bb727a | 官方: 否 | 付费: 否

答案:

The necessary entry criteria for the execution phase: - Completed automated scripts

执行阶段的必要进入标准:- 已完成的自动化脚本
  • The test environment should be ready
  • Finalized Non-functional requirements (NFR)
  • The latest functionally tested code should be deployed
  • The test input data should be ready.
    The necessary exit criteria would be: - Test cases should cover and meet all the NFRs

    必要的退出标准将是:- 测试用例应覆盖并满足所有非功能需求(NFR)
  • No more performance bottlenecks are present
  • All defects are finalized
  • The behaviour of the application should be consistent and acceptable in heavy and spiked loads.
  • Final reports are submitted and shared.

692. Can we perform spike testing in JMeter? If yes how?

我们能在JMeter中执行尖峰测试吗?如果可以,怎么做?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1658d557c902bb727d | 官方: 否 | 付费: 否

答案:

Spike Testing is conducted to determine how an application behaves when the number of users accessing the system decreases or increases abruptly. This is because generally when the number of users varies abruptly and suddenly (leading to a spike), then the system behaviour will have unexpected changes. This can be tested in JMeter using Synchronizing Timer. This is simulated by jamming the threads by synchronizing the time until the stipulated number of threads have been blocked and once that is achieved, then release the threads suddenly at once to simulate a large load.

尖峰测试用于确定当访问系统的用户数量突然减少或增加时应用程序的行为。这是因为通常当用户数量突然且意外地变化(导致尖峰)时,系统行为会有意想不到的变化。这可以在JMeter中使用同步定时器进行测试。通过同步时间直到指定数量的线程被阻塞来模拟这一过程,一旦达到该数量,然后突然同时释放所有线程以模拟大负载。

The following steps can be performed: - Create a performance test plan

可以执行以下步骤:- 创建性能测试计划
  • Create a thread group within it
  • Add all the JMeter elements specific to business requirements
  • Add listeners to view the results
  • Run the tests
  • Get the results
  • Monitor the behaviour.

693. How can we identify situations that belong to performance bottlenecks?

我们如何识别属于性能瓶颈的情况?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1658d557c902bb7280 | 官方: 否 | 付费: 否

答案:

We can identify performance bottlenecks by monitoring the applications that do not perform well against the stipulated stress and load conditions. We can use LoadRunner software for making use of different monitors that monitor database servers, network delays, firewall monitors etc.

我们可以通过监控那些在规定压力和负载条件下表现不佳的应用程序来识别性能瓶颈。我们可以使用LoadRunner软件利用不同的监视器来监控数据库服务器、网络延迟、防火墙等。

694. On what kind of values can we perform correlation and parameterization in the LoadRunner tool?

在LoadRunner工具中,我们可以对哪些类型的值进行关联和参数化?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1658d557c902bb7283 | 官方: 否 | 付费: 否

答案:

Correlation is performed for dynamic values such as session ids, session states, date values etc that are returned from the server in response to any request. Parameterization is conducted upon static data, such as passwords, usernames etc that are usually entered by the user.

关联是针对动态值进行的,例如会话ID、会话状态、日期值等,这些值是从服务器在响应任何请求时返回的。参数化是针对静态数据进行的,例如用户通常输入的密码、用户名等。

695. Why is it preferred to perform load testing in an automated format?

为什么更倾向于以自动化格式进行负载测试?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1658d557c902bb7286 | 官方: 否 | 付费: 否

答案:

Performing load testing in a manual way has the following disadvantages: - Accuracy cannot be predicted easily regarding the application’s performance.

手动进行负载测试有以下缺点:- 关于应用程序性能的准确性难以预测。
  • Synchronization among various users becomes challenging to coordinate and maintain.
  • In real-time testing, it would require real users to test the application.
  • Additionally, manual testing increases the cost of manual effort required.
    Due to all the above-mentioned reasons, it is preferred to perform load testing in automated form.

    由于上述所有原因,更倾向于以自动化形式执行负载测试。

696. What are the differences between benchmark testing and baseline testing?

基准测试和基线测试之间有什么区别?
  • 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1658d557c902bb7289 | 官方: 否 | 付费: 否

答案:

Benchmark Testing is a testing process conducted to compare the system framework performance against set industry standards that are laid by some organizations. Baseline Testing is a type of testing where the tester runs various tests to know the information about the performance. Whenever a change is done in the future, the result of the baseline testing will be considered as a reference point to the next set of testing.

基准测试是一种测试过程,用于将系统框架的性能与某些组织制定的行业标准进行比较。基线测试是一种测试类型,其中测试人员运行各种测试以了解性能信息。将来每当有变更时,基线测试的结果将被视为下一轮测试的参考点。

697. Does Postman provide a feature to log requests and responses?

Postman 是否提供记录请求和响应的功能?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1a58d557c902bb75cd | 官方: 否 | 付费: 否

答案:

Postman does allow viewing of requests and response parameters in the software application itself. But it is important to see how the request was sent upon applying the pre-request scripts. In such cases, Postman has an additional tool called “Postman Console” which is used for viewing every request and response detail. We can also log the details in the console by using console.log statements in the scripts.

Postman 确实允许在软件应用程序本身中查看请求和响应参数。但重要的是,在应用预请求脚本后,需要查看请求是如何发送的。在这种情况下,Postman 有一个附加工具,名为“Postman 控制台”,用于查看每个请求和响应的详细信息。我们还可以通过脚本中的 console.log 语句将详细信息记录到控制台中。

698. Why is Base64 encoding primarily used in Postman?

为什么 Base64 编码主要用于 Postman?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1a58d557c902bb75d0 | 官方: 否 | 付费: 否

答案:

Base64 encoding is primarily used because it does the task of data transmission in a textual format that is easier to be sent in the requests in HTML form statistics format. Another reason why we use this is that using identical 64 characters for encoding is heavily reliable in any language we use.

Base64 编码主要用于以文本格式进行数据传输,这种格式更容易以 HTML 表单统计格式在请求中发送。使用它的另一个原因是,在我们使用的任何语言中,使用相同的 64 个字符进行编码都非常可靠。

699. What is the purpose of the 304 status code?

304 状态码的目的是什么?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1a58d557c902bb75d3 | 官方: 否 | 付费: 否

答案:

304 status code stands for NOT MODIFIED. This is used for diminishing the bandwidth of the network in cases of restricted GET requests. In such cases, the response body should be empty or blank and the headers should have a date, location, signature etc.

304状态码表示“未修改”。这用于在受限制的GET请求情况下降低网络带宽。在这种情况下,响应体应为空或空白,而头部应包含日期、位置、签名等。

700. Is it preferable to save our work on Postman Cloud?

将我们的工作保存在Postman云上是否更可取?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1a58d557c902bb75d6 | 官方: 否 | 付费: 否

答案:

When working on enterprise-level applications for organizations, it is not preferred to store our work on the Postman cloud because of the required privacy and security. In the Postman cloud, there are chances of security breaches by a skilled hacker.

在为组织开发企业级应用程序时,由于所需的隐私和安全性要求,不建议将我们的工作存储在Postman云上。在Postman云中,存在熟练黑客造成安全漏洞的风险。

701. What are the various variable scopes provided by Postman?

Postman提供了哪些不同的变量作用域?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75d9 | 官方: 否 | 付费: 否

答案:

Postman has the following variable scopes: - Global Variables: Global variables allow data access between different collections, requests, and scripts. They are available throughout the workspace.

Postman具有以下变量作用域:- 全局变量:全局变量允许不同集合、请求和脚本之间访问数据。它们在整个工作区中可用。
  • Environment Variables: These allow us to tailor the requests about different development environments - such as local testing, stage testing, or prod testing.
  • Local Variables: These are temporary variables that are accessible only within the scope of requests scripts. They are either scoped to a single request or single collection, depending on the requirements. These variables are not available after the completion of the script execution.
  • Collection Variables: These variables are scoped to be available for all the requests present in a collection. They are independent of the environment.
  • Data Variables: These variables come from external JSON or CSV files for defining the datasets required to run the collection in Collection Runner or Newman.

702. Is it possible to reuse the authentication token for multiple requests?

是否可以将认证令牌用于多个请求?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75dc | 官方: 否 | 付费: 否

答案:

Yes, it is possible. It can be achieved by creating a collection and adding all the requests having the same authentication token to that collection and then assigning the auth token to the collection. This can be applied to the individual requests by selecting the “Inherit auth from parent” option in the Authorization tab.

是的,这是可能的。可以通过创建一个集合并将具有相同认证令牌的所有请求添加到该集合,然后将认证令牌分配给该集合来实现。这可以通过在授权选项卡中选择“从父级继承认证”选项来应用于各个请求。

703. How do you write test cases for basic authentication in Postman?

如何在Postman中为基本认证编写测试用例?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75df | 官方: 否 | 付费: 否

答案:

Basic Authentication is one of the authentication techniques provided in Postman that ensures that we can set the username and password along with the API requests. We can do this by first setting the credentials of the API by: - Navigating to the Authorization tab.

基本认证是Postman中提供的认证技术之一,它确保我们可以随API请求一起设置用户名和密码。我们可以通过首先设置API的凭据来实现:- 导航到“授权”选项卡。
  • From the dropdown, select Basic Auth.
  • Add the username and password to the API in the input fields given.

The test cases can be written as follows:

测试用例可以编写如下:

pm.test("Is the Request Authenticated?", function () {

pm.test("请求是否已认证?", function () {
var jsonData = pm.response.json();
var jsonData = pm.response.json();
//if authenticated then assert to true
//如果已认证,则断言为真
pm.expect(jsonData.authenticated).to.eql(true);
pm.expect(jsonData.authenticated).to.eql(true);
});
pm.test("Is the Content-Type present?", function () {
pm.test("是否存在Content-Type?", function () {
pm.response.to.have.header("Content-Type");
pm.response.to.have.header("Content-Type");
});
pm.test("Is it a successful POST Request?", function () {
pm.test("这是一个成功的POST请求吗?", function () {
pm.response.to.have.status(200);
pm.response.to.have.status(200);
});

704. How do you set the same headers for all requests in a Postman Collection?

如何在Postman集合中为所有请求设置相同的请求头?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75e2 | 官方: 否 | 付费: 否

答案:

Postman collections allow using pre-request scripts at the individual request level and the collection level. We can add any script that applies to all requests in the collection in the pre-request scripts. We can do it by following the below steps: - Right-click on the collection, navigate to the pre-request tab.

Postman集合允许在单个请求级别和集合级别使用预请求脚本。我们可以在预请求脚本中添加适用于集合中所有请求的任何脚本。我们可以通过以下步骤来实现:- 右键单击集合,导航到预请求选项卡。
  • Add the below lines of code in the script to add a request header for all the requests present in the collection.
    pm.request.headers.add({

    pm.request.headers.add({
    key: 'TestHeader',
    key: 'TestHeader',
    value: 'testValue'
    value: 'testValue'
    }); - Click on Update for saving the script.
    }); - 点击更新以保存脚本。
  • Execute the request in the collection and check if the headers are added to the request in the Postman console.
    Header from Pre-Request Script:

    来自预请求脚本的请求头:

705. What are workspaces in Postman? What are their uses?

Postman中的工作区是什么?它们有什么用途?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75e5 | 官方: 否 | 付费: 否

答案:

Workspaces are the areas/space given by Postman for team collaboration to work on a specific or set of collections. It provides a way to logically separate requests or collections that are personal to the developer or the team so that the maintenance of requests is made easy.

工作区是Postman提供的区域/空间,用于团队协作处理特定或一组集合。它提供了一种方式,将开发人员或团队个人的请求或集合进行逻辑分离,从而简化请求的维护。

There are two types of workspaces in Postman: - Personal Workspace:These workspaces are useful when we are working simultaneously on multiple projects and we require logical separation between the requests to handle the requests better.

Postman中的工作区有两种类型:- 个人工作区:当我们同时处理多个项目,并且需要对请求进行逻辑分离以便更好地管理请求时,这些工作区非常有用。
  • Team Workspace:
    These are created for team collaboration so that more than one person can be part of testing requests. We can invite new users for collaborating on our collections by sharing the email id of the users. Once the invite is accepted, the new users can start contributing to the workspace by adding or modifying the requests.

    这些是为团队协作而创建的,以便多个人可以参与测试请求。我们可以通过分享用户的电子邮件ID来邀请新用户协作我们的集合。一旦邀请被接受,新用户就可以通过添加或修改请求开始为工作区做出贡献。

We can create a new workspace by clicking on the Workspace icon and then clicking on “Create New”.

我们可以通过点击工作区图标,然后点击“创建新”来创建一个新的工作区。

We can select our workspace to be personal or team workspace by configuring the properties in the create window.

我们可以在创建窗口中配置属性,将工作区选择为个人或团队工作区。

706. How will you stop the execution of upcoming requests or execution of the collections?

如何停止即将到来的请求或集合的执行?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75e8 | 官方: 否 | 付费: 否

答案:

We can use the below code to stop the execution of the next request: pm.setNextRequest(null);

我们可以使用下面的代码来停止下一次请求的执行:pm.setNextRequest(null);

707. What do you understand by the pre-request script?

你对预请求脚本有什么理解?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75eb | 官方: 否 | 付费: 否

答案:

Pre-request scripts are those scripts that are used for executing Javascript code before a request is run. It is used for performing pre-processing tasks like setting variables, parameters, headers, body data, etc.

预请求脚本是在请求运行前用于执行JavaScript代码的脚本。它用于执行预处理任务,如设置变量、参数、头部、请求体数据等。

708. How can we use Custom Javascript libraries in our scripts with an example?

我们如何在脚本中使用自定义JavaScript库,并举例说明?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75ee | 官方: 否 | 付费: 否

答案:

Postman provides a lot of built-in tools and libraries that we can use to add in our pre-request or post-request scripts or test cases. Let us take the example of using the moment.js library. It provides a lot of useful functions to format data around time. Consider that we have a POST request that needs to specify the created date to the user which expects the format “DD/MM/YYYY”. We can use the moment library to perform this using a single line of code. In our pre-request script, we need to add the below lines of code to get the correctly formatted data and then store that in an environment variable:

Postman提供了许多内置的工具和库,我们可以在预请求或后请求脚本或测试用例中使用它们。让我们以使用moment.js库为例。它提供了许多关于格式化时间数据的有用函数。假设我们有一个POST请求,需要向用户指定创建日期,这期望格式为“DD/MM/YYYY”。我们可以使用moment库,通过一行代码来实现这一点。在我们的预请求脚本中,我们需要添加以下代码行来获取正确格式化的数据,然后将其存储在环境变量中:

var moment = require('moment');

var moment = require('moment');
pm.environment.set('createdDate',moment().format('DD/MM/YYYY'));
pm.environment.set('createdDate',moment().format('DD/MM/YYYY'));
There are a lot of other useful libraries like crypto.js that are useful for converting text to encrypted values which can further be used anywhere in the request body.
还有许多其他有用的库,比如crypto.js,它对于将文本转换为加密值很有用,这些加密值可以进一步在请求体的任何地方使用。

709. If we have a global and a local variable of the same name, which one will be given the most preference in Postman?

如果我们在Postman中有一个同名的全局变量和局部变量,哪一个会被优先考虑?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75f1 | 官方: 否 | 付费: 否

答案:

In such cases, the higher precedence is given to the local variable by overwriting the value of the global variable.

在这种情况下,局部变量具有更高的优先级,它会覆盖全局变量的值。

710. Does Postman allow flexibility to make use of the command-line?

Postman是否允许灵活性来使用命令行?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75f4 | 官方: 否 | 付费: 否

答案:

Postman provides a command-line tool called Newman using which we can run any Postman collection. It is a NodeJS based package that requires a node environment for executing collections using Newman Collection Runner. It has full parity with Postman’s Collection Runner i.e it provides support for running assertions, pre-request scripts, or other request scripts linked with the requests that belong to the collection.

Postman提供了一个名为Newman的命令行工具,使用它我们可以运行任何Postman集合。它是一个基于NodeJS的包,需要Node环境来使用Newman Collection Runner执行集合。它与Postman的Collection Runner完全一致,即它支持运行断言、预请求脚本或与属于该集合的请求相关联的其他请求脚本。

We can use Newman by following the below steps: - Install Node

我们可以按照以下步骤使用Newman: - 安装Node
  • Install Newman package using npm command as: npm install -g newman
  • To run the collection, first export the environment to JSON format in Postman. Then run the below command for running the collection in Newman:
    newman run {{path to collection json}} -e {{path to environment json}}

    newman run {{集合json的路径}} -e {{环境json的路径}}

711. How will you generate random numbers of a given range in Postman?

你如何在Postman中生成给定范围的随机数?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75f7 | 官方: 否 | 付费: 否

答案:

Suppose you want to generate numbers between the range 1 to N, then it can be done in the pre-request script as follows:

假设你想生成1到N之间的数字,那么这可以在预请求脚本中如下完成:

pm.globals.set('randomNumber', Math.floor(Math.random() * N));

pm.globals.set('randomNumber', Math.floor(Math.random() * N));
We can then use this variable in the URL as: {{randomNumber}}
然后,我们可以在 URL 中使用这个变量,例如:{{randomNumber}}

712. What do you understand by Scratch Pad?

你对“便签板”有何理解?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75fa | 官方: 否 | 付费: 否

答案:

Scratch Pad is a space provided by Postman that helps us to work without being connected to Postman servers. It provides the flexibility of utilizing some of the features of postman offline. The features include- collection creation, creating requests and the ability to send requests. These are stored locally and once logged in, the work is saved into the workspace.

“便签板”是 Postman 提供的一个空间,帮助我们在未连接 Postman 服务器的情况下进行工作。它提供了离线使用 Postman 某些功能的灵活性。这些功能包括:创建集合、创建请求以及发送请求的能力。这些内容会存储在本地,一旦登录,工作成果便会保存到工作区中。

713. How do you get the cURL command based on the details of REST API obtained from Postman?

如何根据从 Postman 获取的 REST API 详细信息,得到相应的 cURL 命令?
  • 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c1b58d557c902bb75fd | 官方: 否 | 付费: 否

答案:

We can obtain the cURL command equivalent by following the below steps: - Click on the Code icon as shown below:

我们可以通过以下步骤获得对应的 cURL 命令:- 点击如下图所示的代码图标:
  • You will get the cURL command of the REST API request sent as shown in the screenshot below:
  • We can also get the command for the request in different languages like C#, Javascript, NodeJs, PHP, etc by selecting the option that we require from the drop-down as shown in the image below:

Conclusion

结论
Postman has become the most popular and beloved tool for API testing. Hence, hands-on experience with the Postman tool has become very important for any backend developer.
Postman 已成为 API 测试中最流行且最受欢迎的工具。因此,对于任何后端开发人员来说,掌握 Postman 工具的实际操作经验变得非常重要。

Recommended Resources: - API Testing

推荐资源:- API 测试
  • REST API
  • Software Testing
  • Web Services
  • JMeter

714. What do you understand about regression testing? Which test cases should be selected for regression testing?

你对回归测试有何理解?应选择哪些测试用例进行回归测试?
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fd4 | 官方: 否 | 付费: 否

答案:

Regression Testing is a sort of software testing used to ensure that a recent program or code modification hasn't broken existing functionality. Regression Testing is just a full or partial re-execution of previously executed test cases to confirm that current functionality is working properly. This testing ensures that new code modifications do not have unintended consequences for current functionality. It ensures that the old code continues to function after the most recent code modifications have been made.

回归测试是一种软件测试,用于确保最近的程序或代码修改没有破坏现有功能。回归测试只是对先前执行的测试用例进行全部或部分重新执行,以确认当前功能正常运行。该测试确保新的代码修改不会对当前功能产生意外后果,并确保旧代码在最近的代码修改后继续工作。

According to industry data, a large proportion of defects reported by customers were caused by last-minute bug patches that had unintended consequences, making selecting the Test Case for regression testing an art and not an easy task. The following test scenarios can be used to create effective regression tests : - Test scenarios with a high number of flaws

根据行业数据,客户报告的大部分缺陷是由最后一刻的错误修补程序引起的,这些修补程序产生了意外后果,这使得选择回归测试用例成为一门艺术而非易事。以下测试场景可用于创建有效的回归测试:- 具有大量缺陷的测试场景
  • Test cases covering features that are more visible to the users
  • Test cases that test the product's fundamental features
  • Test cases of functionalities that have experienced significant and recent alterations
  • All Test Cases for Integration
  • All Complex Test Cases
  • Cases of boundary value tests.

715. Explain risk in the context of quality assurance. What are the five dimensions of risk?

在质量保证的背景下解释风险。风险的五个维度是什么?
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fd7 | 官方: 否 | 付费: 否

答案:

When it comes to software testing, Risks are potential issues that could jeopardise the project stakeholders' goals. It's the likelihood of a bad or unfavourable result. A risk is something that has not yet occurred and may never occur; it is a potential concern. The likelihood of a risk becoming an outcome is proportional to the degree of risk linked with the potential for negative consequences.

在软件测试中,风险是可能危及项目利益相关者目标的潜在问题。这是不良或不利结果的可能性。风险是尚未发生且可能永远不会发生的事情;它是一个潜在问题。风险成为结果的可能性与潜在负面后果相关的风险程度成正比。

Most people, for example, are expected to have a cold at some point in their lives, frequently multiple times. A healthy person, on the other hand, is spared any major effects. As a result, this individual's overall risk of catching a cold is low. On the other hand, for an elderly person with breathing issues, the risk of catching a cold is significant. As a result, the overall chance of catching a cold in his instance is significant.

例如,预计大多数人在一生中的某个时候会感冒,通常多次发生。另一方面,健康的人不会受到任何重大影响。因此,该人总体患感冒的风险较低。另一方面,对于一个有呼吸问题的人来说,患感冒的风险是显著的。因此,在他这种情况下,总体感冒几率是显著的。

Following are the five dimensions of risks: - Schedule: Unrealistic schedules, the omission of important activities when drafting a schedule, and other factors could stymie project completion on time. If testing is done from a remote place, an unstable communication link can be regarded as a possible danger.

以下是风险的五个维度:- 时间表:不现实的时间表、在起草计划时遗漏重要活动以及其他因素可能会阻碍项目按时完成。如果从远程位置进行测试,不稳定的通信链路可被视为潜在危险。
  • Client: Ambiguous requirements description, lack of clarity on issues, frequent changes to requirements, and other factors could lead to chaos throughout project execution.
  • Human Resources: Insufficient resources with the required skill level are not available for the project; Resource attrition - Appropriate training schedules for resources must be designed to balance the knowledge level with resources quitting. Underestimating the training effort could have a negative influence on project completion.
  • System Resources: The inability to obtain or the delay in obtaining all key computer resources, such as hardware and software tools, or software licences, will have a negative impact.
  • Quality: A combination of issues such as a shortage of resources, a tight delivery timetable, and frequent changes to requirements will have an impact on the product tested quality.

716. What do you understand about severity and priority of a defect in the context of quality assurance? Differentiate between them.

在质量保证的背景下,你对缺陷的严重性和优先级有何理解?区分它们。
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fda | 官方: 否 | 付费: 否

答案:

  • Severity: The severity of a flaw is defined as the degree to which it can affect the software. The severity of a defect is a metric that indicates how serious it is and how much it affects the software's functionality.
  • Priority: Priority is a parameter that determines which defects should be addressed in what order. The higher-priority defects should be addressed first.

The following table lists the differences between severity and priority :

下表列出了严重性和优先级之间的差异:
Severity
严重性
Priority
优先级
The severity of a software defect is a measure that indicates how serious it is.
软件缺陷的严重性是衡量其严重程度的指标。
Priority is a criterion used to determine which defects should be addressed first.
优先级是用于确定应首先处理哪些缺陷的标准。
The degree of severity is proportional to the quality standard.
严重程度与质量标准成正比。
Priority is linked to the timetable for resolving the issue.
优先级与解决该问题的时间表有关。
The defect's severity level is determined by the testing engineer.
缺陷的严重性级别由测试工程师确定。
The defect priorities are set by the product manager.
缺陷优先级由产品经理设定。
The severity of a fault refers to how much it affects the functionality.
缺陷的严重性指其对功能的影响程度。
Priority refers to how quickly a defect must be fixed.
优先级指缺陷必须修复的速度。
It has objective worth.
它具有客观价值。
It's worth is a matter of opinion.
它的价值是主观判断。
Its value remains constant over time.
其价值随时间保持恒定。
Its value fluctuates over time.
其价值随时间波动。
Critical, Major, Moderate, Minor, and Cosmetic are the five levels of severity.
严重性分为五个级别:严重、重大、中等、轻微和外观性。
Priority is divided into three categories: low, medium, and high.
优先级分为三类:低、中和高。

717. What do you mean by quality audit in the context of quality assurance?

在质量保证的背景下,质量审计是什么意思?
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fdd | 官方: 否 | 付费: 否

答案:

An audit is an on-site verification activity of a processor quality system, such as inspection or examination. An internal or external quality auditor, or an audit team, conducts a systematic analysis of a quality system as part of a quality audit. Quality audits are conducted at predetermined intervals to ensure that the institution's internal system monitoring methods are well defined and linked to successful action. Audits are an important management tool for confirming objective proof of processes.

审计是对处理器质量系统的现场验证活动,例如检查或审查。内部或外部质量审计员或审计团队作为质量审计的一部分,对质量系统进行系统分析。质量审计在预定时间间隔内进行,以确保机构的内部系统监控方法定义明确并与成功行动相关联。审计是确认流程客观证据的重要管理工具。

In other words, a quality audit is a verification effort aimed at determining the degree of compliance of a product, design, process, or system to a standard specification or procedure. The quality audit includes two parts: the first is an examination of the system in which the products or services are created, known as the quality system audit. The other is a product or service quality audit, which is an examination of the products themselves.

换句话说,质量审计是一项验证工作,旨在确定产品、设计、流程或系统符合标准规范或程序的程度。质量审计包括两部分:第一部分是对产品或服务创建所在系统的检查,称为质量系统审计。另一部分是产品或服务质量审计,这是对产品本身的检查。

718. How do you figure out how much testing each piece of software requires in the context of Quality Assurance?

在质量保证的背景下,你如何确定每件软件需要多少测试?
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fe0 | 官方: 否 | 付费: 否

答案:

The Cyclomatic Complexity can be used to determine how much testing each piece of software requires in our application. The technique aids in the identification of the three questions listed below for the programs/features. - Is it possible to test the feature or programme?

圈复杂度可用于确定我们应用程序中每项软件需要多少测试。这种技术有助于识别以下针对程序/功能的三个问题:- 是否能够测试该功能或程序?
  • Is everyone aware of the feature/program?
  • Is the feature/program trustworthy?
    We can use this technique to determine the "level" of testing required for our application. It is standard practice to consider a piece of functionality to be complex if the cyclomatic complexity result is greater than or equal to a certain number, and to conclude as a tester that the piece of code/functionality requires in-depth testing. If the Cyclomatic Complexity result is a lesser value, we conclude as QA that the functionality is of lower complexity and adjust the scope accordingly. Understanding the full testing life cycle is critical, and we should be prepared to suggest modifications to our approach if necessary. The goal is to deliver high-quality software, so a QA should take all necessary steps to improve the testing process and the manner the testing team conducts the tests.

    我们可以使用这项技术来确定应用程序所需的测试“级别”。标准做法是,如果圈复杂度计算结果大于或等于某个数值,则认为该功能块较为复杂,并作为测试人员得出结论:该代码/功能需要深入测试。如果圈复杂度结果较小,我们作为QA则会判断该功能复杂度较低,并相应调整测试范围。理解完整测试生命周期至关重要,如有必要,我们应准备好建议修改测试方法。目标是交付高质量软件,因此QA应采取一切必要步骤来改进测试流程以及测试团队执行测试的方式。

719. Differentiate between load testing and stress testing.

区分负载测试和压力测试。
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fe3 | 官方: 否 | 付费: 否

答案:

  • Load Testing: Load testing is a type of performance testing that assesses a system's, software product's, or software application's performance under realistic load situations. It also demonstrates how the application would behave when there is increased network traffic on the application and multiple users are accessing the application.
  • Stress Testing: Stress testing is a sort of software testing that ensures the system's stability and dependability. Under extremely heavy load conditions, this test examines the system's robustness and error handling.

The following table lists the differences between load testing and stress testing:

下表列出了负载测试和压力测试之间的区别:
Load Testing
负载测试
Stress Testing
压力测试
Load testing is used to set the application's SLA (Service Level Agreement) and see how the system handles a heavy load to determine the system's upper limit.
负载测试用于设定应用程序的SLA(服务级别协议),并查看系统如何处理重载以确定系统上限。
Stress testing is used to determine the system's or software application's robustness under excessive stress and how it recovers from failure.
压力测试用于确定系统或软件应用在过度压力下的鲁棒性以及从故障中恢复的能力。
The load limit is the point at which a break occurs in load testing.
负载测试中发生故障的临界点即负载极限。
The load limit in stress testing is higher than the break threshold.
压力测试中的负载极限高于故障阈值。
Load testing involves putting the software through its paces with a large number of users.
负载测试涉及让大量用户测试软件的性能。
Stress testing involves putting the system through its paces with varying volumes of data.
压力测试涉及让不同数据量的数据测试系统的性能。
Load testing is used to determine a system's or application's maximum capacity.
负载测试用于确定系统或应用的最大容量。
Stress testing is used to determine how a system behaves when it is put under pressure.
压力测试用于确定系统在压力下的行为。
Performance is the factor that is evaluated during load testing.
性能是负载测试中评估的因素。
Robustness and stability are the factors that are examined during stress testing.
鲁棒性和稳定性是压力测试中检查的因素。
Load testing determines a system's or application's operating capacity.
负载测试确定系统或应用的操作容量。
System security is ensured by stress testing.
压力测试确保系统安全性。

720. Differentiate between functional and non functional testing.

区分功能测试和非功能测试。
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fe6 | 官方: 否 | 付费: 否

答案:

  • Functional Testing: Functional testing is a sort of software testing that involves comparing the system to its functional requirements and specifications. Functional testing guarantees that the application meets all of the criteria or standards as specified in the specification requirement sheet. This form of testing is focused on the end product of the processing. It focuses on simulating actual system utilisation but makes no assumptions about system structure.
  • NonFunctional Testing: Non-functional testing is a sort of software testing that verifies the application's non-functional requirements. It determines whether the system's behaviour is in accordance with the requirements. It examines all aspects that aren't covered by functional testing.

The following table lists the differences between functional and non-functional testing:

下表列出了功能测试和非功能测试之间的区别:
Functional Testing
功能测试
Non-functional Testing
非功能测试
It verifies an application's activities and actions.
它验证应用程序的活动和操作。
It verifies an application’s behaviour.
它验证应用程序的行为。
It is based on the needs of the customer.
它基于客户的需求。
It is based on the customer's expectations.
它基于客户的期望。
It aids in improving the application's functionality.
它有助于改进应用程序的功能。
It aids in the enhancement of the application's performance.
它有助于增强应用程序的性能。
Manual functional testing is simple to carry out.
手动功能测试易于执行。
Manually performing non-functional testing is difficult.
手动执行非功能测试较为困难。
It evaluates the product's functionality.
它评估产品的功能。
It explains what the product is capable of.
它说明产品具备哪些能力。
The basis for functional testing is the business requirement.
功能测试的基础是业务需求。
The performance requirement is the basis for non-functional testing.
性能需求是非功能测试的基础。
Example: Unit Testing, Regression Testing, Smoke Testing.
示例:单元测试、回归测试、冒烟测试。
Example: Load Testing, Stress Testing, Performance Testing.
示例:负载测试、压力测试、性能测试。

721. What do you understand by black box and white box testing? Differentiate between them.

你对黑盒测试和白盒测试有何理解?并区分它们。
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fe9 | 官方: 否 | 付费: 否

答案:

  • White box testing: White box testing examines the inside structures of the software, including the employed data structures, internal design, code structure, and how it works, rather than just the functionality, as black-box testing does. It's also known as structural testing, clear box testing, or glass box testing.
  • Black box testing: Black box testing is a sort of software testing when the software's internal functionality is unknown. The testing is carried out with no knowledge of the products' internal workings. The following methods can be used to conduct black-box testing:

Syntax Driven Testing: This method of testing is used on systems that may be represented syntactically by a language. Compilers, for example, are a type of language that can be described using a context-free grammar. The test cases are created in such a way that each grammatical rule is applied at least once.

语法驱动测试:这种测试方法用于那些可以用语言进行语法表示的系统。例如,编译器是一种可以使用上下文无关文法描述的语言类型。测试用例的创建方式确保每条语法规则至少被应用一次。
Equivalence partitioning: Many types of inputs work similarly, so rather than give them all separately, we can group them together and test only one of each group's inputs. The aim is to divide the system's input domain into a number of equivalence classes, each of which works in a similar fashion, i.e., if a test case in one class results in an error, other test cases in other classes will also result in an error.
等价类划分:许多类型的输入行为相似,因此与其分别给出所有输入,我们可以将它们分组,只测试每组中的一个输入。目的是将系统的输入域划分为多个等价类,每个类中的行为相似,即如果一个类中的测试用例导致错误,其他类中的测试用例也会导致错误。

The following table illustrates the differences between white box and black box testing:

下表说明了白盒测试和黑盒测试之间的区别:
White-box testing
白盒测试
Black box testing
黑盒测试
It's a testing method in which the tester is aware of the system's internal structure.
这是一种测试方法,测试人员了解系统的内部结构。
It's a method of testing software that doesn't require knowledge of the program's or application's internal structure.
这是一种无需了解程序或应用内部结构的软件测试方法。
It is also known as Structural testing, clear box testing, code-based testing, or glass box testing.
它也被称为结构测试、透明盒测试、基于代码的测试或玻璃盒测试。
Data-driven, box testing, data-, and functional testing are all terms used to describe this type of testing.
数据驱动测试、盒测试、数据和功能测试都是用于描述这种测试类型的术语。
Because the internal workings of the system are known, the tester may test accordingly.
由于系统的内部工作机制已知,测试人员可以相应地进行测试。
The application's internal behaviour is unclear, therefore testing is based on exterior expectations.
应用的内部行为不明确,因此测试基于外部预期。
Testing is better suited to lower-level testing such as Unit and Integration testing.
测试更适合于较低级别的测试,如单元测试和集成测试。
Higher stages of testing, such as System Testing and Acceptance Testing, benefit from this sort of testing.
较高级别的测试,如系统测试和验收测试,受益于这种测试类型。
White Box testing necessitates a working grasp of programming.
白盒测试需要掌握基本的编程知识。
Black Box testing does not necessitate programming knowledge.
黑盒测试不需要编程知识。
It's simple to automate white box testing.
白盒测试易于自动化。
Because the test and programmer are so intertwined, automating them is difficult.
由于测试和程序员之间的紧密关联,自动化较为困难。
The fundamental goal of White Box testing is to ensure that the code is of high quality.
白盒测试的基本目标是确保代码质量。
The major goal of this testing is to determine what functions the system under test has.
这种测试的主要目标是确定被测系统具备哪些功能。
After completing the Detail design document, testing can begin.
完成详细设计文档后即可开始测试。
Following the preparation of the requirement specification paper, testing can begin.
编制需求规格说明书后即可开始测试。
To execute white box testing, you'll need an expert tester with a lot of expertise.
执行白盒测试需要具有丰富经验的专业测试人员。
Low-skilled testers can test the application without having any prior understanding of the programming language or operating system implementation.
低技能测试人员无需事先了解编程语言或操作系统实现即可测试应用。

722. What do you understand about bug/ defect triage in the context of quality assurance?

在质量保证背景下,你对缺陷/缺陷分诊有何理解?
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fec | 官方: 否 | 付费: 否

答案:

Defect triage is a method of prioritising bugs based on their severity, frequency, risk, and other factors. The term "triage" is used in software testing and quality assurance to describe the severity and importance of new faults. Bug triage's purpose is to review, prioritise, and assign defect solutions. The team must confirm the severity of the fault, make necessary changes, conclude defect resolution, and assign resources. This method is primarily utilised in agile project management. The frequency of the Defect Triage Meeting isn't set in stone. It is dependent on the circumstances of the project.

缺陷分诊是一种根据严重性、频率、风险等因素对缺陷进行优先级排序的方法。在软件测试和质量保证中,“分诊”一词用于描述新缺陷的严重性和重要性。缺陷分诊的目的是审查、优先排序并分配缺陷解决方案。团队必须确认缺陷的严重性,进行必要修改,得出缺陷解决方案,并分配资源。这种方法主要用于敏捷项目管理。缺陷分诊会议的频率并非固定不变,它取决于项目的具体情况。

The following are some key elements that influence the frequency of Defect Triage Meetings: - According to the project's schedule.

以下是一些影响缺陷分诊会议频率的关键因素:- 根据项目进度安排。
  • The number of flaws in the system.
  • The impact on the availability of team members' schedules.
  • The state of the project as a whole.

723. What do you understand about stubs and drivers? Differentiate between them.

你对桩模块和驱动模块有什么理解?请区分它们。
  • 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2a58d557c902bb7fef | 官方: 否 | 付费: 否

答案:

  • Stub: Stubs are created by software developers to be used in place of modules if the respective modules have not been constructed, are missing in the development stage, or are currently unavailable during Top-down testing. A stub is a module that mimics the functionality of an unavailable module. Stubs are used when lower-level modules are required but are currently unavailable. For instance, suppose you have three different modules: Login, Home, and User. Assume that the login module is ready for testing, but the two minor modules Home and User, which are invoked by the login module, are not. At this point, a piece of fake code is written to replicate the Home and User functions. The stubs are the dummy parts of the code.
  • Driver: Drivers are similar to stubs in that they serve the same goal, but they are more complicated and are utilised in Bottom-up integration testing. Drivers are also used to operate in the absence of essential modules when some modules are absent and unavailable at the time of testing a specific module due to unforeseen circumstances. When high-level modules are missing, drivers are utilised. They can also be used when lower-level modules are missing.Let's use the same example as before. Assume that the User and Home modules are ready to test this time, but the Login module is not. Because the Login module returns data to Home and User, a dummy piece of code is developed to emulate the Login.

The following table lists the differences between Stub and Driver:

下表列出了桩模块和驱动模块之间的区别:
Stub
桩模块
Driver
驱动模块
In Top-Down Integration Testing, stubs are employed.
在自顶向下集成测试中,采用桩模块。
In Bottom-Up Integration Testing, drivers are used.
在自底向上集成测试中,使用驱动模块。
Stubs are analogous to software modules that are in the development stage.
桩模块类似于处于开发阶段的软件模块。
Drivers are accustomed to invoking the component that must be tested.
驱动模块用于调用必须被测试的组件。
Stubs are primarily utilised when low-level modules are unavailable.
桩模块主要在低级模块不可用时使用。
Drivers are mostly used to replace high-level modules, they can also be used to replace low-level modules in specific cases.
驱动模块主要用于替换高级模块,在特定情况下也可用于替换低级模块。
They are also referred to as “called programs”.
它们也被称为“被调用程序”。
They are also referred to as “calling programs”.
它们也被称为“调用程序”。
To test the features and functionality of the modules, stubs are used.
桩模块用于测试模块的特性和功能。
If the core module of the software is not developed for testing, the drivers are used.
如果软件的核心模块尚未开发用于测试,则使用驱动模块。
If upper-level module testing is completed but lower-level module development is ongoing, the stubs are taken into consideration.
如果上级模块测试已完成,但下级模块开发仍在进行中,则考虑使用桩模块。
If lower-level module testing is completed while upper-level module development is underway, the drivers are taken into consideration.
如果下级模块测试已完成,而上级模块开发正在进行中,则考虑使用驱动模块。
Stubs are used to test the main module when lower-level modules are unavailable or in a partially completed state.
当低级模块不可用或处于部分完成状态时,桩模块用于测试主模块。
When higher-level modules are absent or in a partially built state and we wish to test the lower(sub)-module, we use drivers.
当高级模块缺失或处于部分构建状态,且我们希望测试较低级(子)模块时,我们使用驱动模块。

724. What is your daily routine as quality control?

作为质量控制,你的日常工作是什么?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb801f | 官方: 否 | 付费: 否

答案:

As a quality control, here are some daily tasks: - Monitoring and inspecting the operations running for specific products is one of your daily tasks.

作为质量控制人员,以下是一些日常任务:- 监控和检查特定产品的运行操作是你的日常任务之一。
  • Likewise, you'll also need to document any changes or testing done on the products.
  • Besides these, you always need to ensure that the products you deliver adhere to regulations at the state or federal levels.
    Conclusion

    结论

Quality control is the process by which companies ensure that their products remain in compliance with their standards. Quality control includes many roles and responsibilities, such as Quality Control Manager, Inspector, Coordinator, Analyst, and Administrator. Each of these roles requires exceptional communication, interpersonal, and attention to detail skills, as well as the ability to maintain high standards and meet strict deadlines.

质量控制是企业确保其产品符合标准的过程。质量控制包括多种角色和职责,如质量控制经理、检查员、协调员、分析师和管理员。这些角色中的每一个都需要出色的沟通能力、人际交往能力和注重细节的技能,以及保持高标准和满足严格截止日期的能力。

In this article, we have covered the top 30 QC interview questions and answers for freshers and experienced candidates so that you can excel in your next QC interview. These questions are quick and insightful, and they provide a wealth of information that is vital to the interview process.

在本文中,我们涵盖了针对初级和有经验候选人的前30个QC面试问题及答案,以便你在下一次QC面试中脱颖而出。这些问题简明而富有洞察力,提供了对面试过程至关重要的丰富信息。

Reviewing these frequently asked questions and answers increases the likelihood of getting hired. Additionally, you will be asked various behavioural-type questions during your Quality Control interview. Review all the questions and answers carefully.

回顾这些常见问题及答案能增加获得录用机会的可能性。此外,在质量控制面试中,你还会被问到各种行为类问题。请仔细审阅所有问题和答案。

Hopefully, we have clarified your doubts and directed you in the right direction. Good luck to all applicants.

希望我们已解答了你的疑问,并为你指明了正确方向。祝所有申请者好运。

Additional Interview Preparation Resources - QA Interview Questions

额外面试准备资源 - QA面试问题
  • Difference Between Quality Assurance and Quality Control
  • Software Testing Interview Questions
  • Smoke Testing vs Sanity Testing

725. When you find a bug or error in production, how do you handle it?

当你在生产中发现错误或缺陷时,你会如何处理?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8022 | 官方: 否 | 付费: 否

答案:

Whenever you find a bug or error, be positive about the situation. Finding inconsistencies is an essential part of working quality control.

每当你发现错误或缺陷时,要对情况保持积极态度。发现不一致性是质量控制工作的重要组成部分。

Whenever you find bugs or errors, be sure to document them and communicate them to your superiors so they can relay the information to the production team, who can adjust and modify their own procedures in order to ensure a bug-free product.

每当你发现错误或缺陷时,务必将其记录在案并传达给上级,以便他们能将信息转达给生产团队,后者可以调整和改进自己的流程,从而确保产品无缺陷。

726. Running our operation as lean as possible is important. As a QC manager, what are your responsibilities in reducing waste?

尽可能精益地运营我们的业务很重要。作为QC经理,你在减少浪费方面有哪些职责?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8025 | 官方: 否 | 付费: 否

答案:

The role of a quality control specialist revolves around quality, but in reality, they play a significant role in resource and labour efficiency as well.

质量控制专家的角色围绕质量展开,但事实上,他们在资源和劳动力效率方面也发挥着重要作用。

One of the core responsibilities of QC specialists is to analyze defect rates and compare them with benchmarks. If they are lacking, quality control specialists can identify and suggest ways to make them up to par, saving the organization time, money, and resources.

QC专家的核心职责之一是分析缺陷率并将其与基准进行比较。如果存在不足,质量控制专家可以识别并提出改进方法,使其达到标准,从而为组织节省时间、资金和资源。

727. What is the best way to manage quality control when you have workers spread over multiple shifts?

当你的工人分布在多个班次时,管理质量控制的最佳方式是什么?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8028 | 官方: 否 | 付费: 否

答案:

The quality control process does not end when the clock hits 5 p.m. In today's 24/7 world of production, it is imperative to have processes that guarantee consistency, no matter what shift it is produced on.

质量控制过程不会在时钟指向下午5点时结束。在当今全天候的生产世界中,必须建立确保一致性的流程,无论产品是在哪个班次生产的。

The key to working with workers across shifts is communication. The best way to keep things consistent from shift to shift is to put standardized processes into place so that each shift can seamlessly carry on where the last one left off. Moreover, every inspector should work on a shift at least once to get a sense of the scope of operations.

跨班次与工人协作的关键在于沟通。保持各班组之间一致性的最佳方式是建立标准化流程,使每个班次都能无缝衔接上一班次的工作。此外,每位检验员至少应在一个班次中工作一次,以了解整体作业范围。

728. What is your approach to a newly assigned quality control project?

你对新分配的质量控制项目的方法是什么?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb802b | 官方: 否 | 付费: 否

答案:

Using the right standards is key to quality control. As part of any quality control project, the first step is to define quality and the standards that should be followed to achieve it. This is critical because, without it, we cannot establish benchmarks for any future inspections. A quality control specialist must comprehend the importance of adhering to rigorous quality control standards and protocols.

使用正确的标准是质量控制的关键。作为任何质量控制项目的一部分,第一步是定义质量以及为实现质量而应遵循的标准。这至关重要,因为没有它,我们就无法为未来的任何检查建立基准。质量控制专家必须理解严格遵守严格质量控制标准和协议的重要性。

729. Consider the situation in which we were rushing to meet a deadline, but there was a defect that prevented us from meeting that target. How would you handle it?

考虑这种情况:我们正急于赶在截止日期前完成任务,但存在一个缺陷阻碍我们达成目标。你会如何处理?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb802e | 官方: 否 | 付费: 否

答案:

The quality control process is stressful, and it is often done under strict deadlines. To be effective, quality control managers must balance the demands of their role with the deadlines of the company and their clients. - First, they would flag the issue as soon as possible so that they could begin taking corrective action.

质量控制过程压力很大,且通常要在严格期限内完成。为了有效工作,质量控制经理必须在自身职责要求与公司和客户的截止日期之间取得平衡。- 首先,他们会尽快标记问题,以便开始采取纠正措施。
  • Once the defect has been identified, they gather as much information as possible regarding the defect, its potential solutions, and how each will affect timelines.
  • By doing so, they can present the most viable options to their stakeholders in the most thorough manner possible, so that the best decision can be made to mitigate the damage.
    A good QC specialist would rather miss a deadline for a high-quality, safe product than deliver a defective one on the schedule.

    优秀的QC专员宁愿错过交付高质量、安全产品的期限,也不愿按计划交付有缺陷的产品。

730. What should be covered in a process qualification?

工艺鉴定应涵盖哪些内容?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8031 | 官方: 否 | 付费: 否

答案:

Process qualification ensures your manufacturing processes are able to produce a certain volume consistently over time. In the absence of these, production processes will break down, leading to missed deadlines and unfulfilled orders. As part of the process qualification, we evaluate the facility, materials, hardware/equipment, software applications, personnel, risk, and quality monitoring tools.

工艺鉴定确保你的制造工艺能够随着时间持续稳定地生产一定数量的产品。如果没有这些鉴定,生产流程将会中断,导致错过截止日期和无法完成订单。作为工艺鉴定的一部分,我们评估设施、材料、硬件/设备、软件应用、人员、风险和质量监控工具。

731. What are the top Quality Management Principles (QMP) that should be focused on?

应重点关注哪些顶级质量管理原则(QMP)?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8034 | 官方: 否 | 付费: 否

答案:

Following are a few of the most important quality management principles to focus on:

以下是一些需要重点关注的最重要的质量管理原则:
  • Customer Focus: Quality management aims to meet and exceed the needs or expectations of customers.
  • Leadership: Leaders create a sense of unity and commitment among staff and ensure that the quality objectives of an organization are met.
  • Engagement of People: A thriving organization requires people who are empowered, competent, and engaged to deliver value. A high-performing, empowered and engaged workforce enhances the organization's ability to create value.]
  • Process Approach: By understanding and managing activities as interconnected processes that function as a cohesive system, we can achieve more predictable and consistent results more effectively.
  • Improvement: Improved performance is a priority for successful organizations. A continuous focus on improvement is therefore crucial.
  • Evidence-based Decision Making: Data-driven decisions have a better chance of producing the desired results than those based on guesswork and intuition. Results are more likely to be achieved when decisions are made based on data analysis and evaluation.
  • Relationship Management: Organizations must manage their relationships with stakeholders, such as suppliers, for sustained success.

732. State difference between load testing and stress testing.

说明负载测试和压力测试之间的区别。
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8037 | 官方: 否 | 付费: 否

答案:

Load testing and system testing are among the most common types of quality control testing. - Load testing: Performing load tests will allow you to understand how a system will perform under real-life load conditions. Load testing measures how well a system performs for example when it experiences high demand, such as multiple users at the same time.

负载测试和系统测试是最常见的质量控制测试类型。- 负载测试:执行负载测试可以让你了解系统在真实负载条件下的表现。负载测试衡量系统在高需求下的性能,例如同时有多个用户使用时。
  • Stress testing: A stress test is meant to determine the maximum capacity of a system under heavy load conditions such as Slashdot effect, DDoS attack, or other scenarios. The test verifies the system's reliability and stability.

733. Which tools do testers use during QC tests? OR What is your favourite QC tool?

测试人员在QC测试期间使用哪些工具?或者你最喜欢的QC工具是什么?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb803a | 官方: 否 | 付费: 否

答案:

Quality control specialists leverage a variety of tools for analytics, compliance monitoring, customer satisfaction management, and more. New technology is introduced every year, but some tools have become industry standards. In the long run, quality control specialists must be flexible and willing to learn new technology.

质量控制专员利用各种工具进行数据分析、合规监控、客户满意度管理等。每年都会引入新技术,但一些工具已成为行业标准。从长远来看,质量控制专员必须灵活并愿意学习新技术。

Almost all quality control managers and specialists have their preferred methods or tools for inspecting quality. Seven main tools for quality control are Pareto chart (80/20 Rule), Stratification (Divide and Conquer), Cause-and-effect diagram (“fishbone” or Ishikawa diagram), Scatter diagram (Shewhart Chart), Check Sheet (Tally Sheet), Histogram, and Control chart. Known as the Seven Basic Tools of Quality, these tools could be applied by anyone with a very basic understanding of statistics and were simple to apply to resolve quality-related complex issues. Good candidates should be able to explain the tools that they use most frequently.

几乎所有的质量控制经理和专员都有他们首选的检查质量的方法或工具。质量控制的七种主要工具是帕累托图(80/20法则)、分层法(分而治之)、因果图(“鱼骨图”或石川图)、散布图(休哈特图)、检查表(计数表)、直方图和控制图。这些被称为“质量七大基本工具”,任何对统计学有基本了解的人都可以应用,并且它们简单易用,能解决与质量相关的复杂问题。优秀候选人应该能够解释他们最常使用的工具。

734. List the different software control views.

列出不同的软件控制视图。
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb803d | 官方: 否 | 付费: 否

答案:

Following are the different Software Control Views: - User View: A product's quality is determined by how well it meets the needs of the user.

以下是不同的软件控制视图:- 用户视图:产品的质量取决于它满足用户需求的程度。
  • Product View: A product's quality is determined by its characteristics.
  • Value-based View: A product's quality is determined by the number of customers willing to pay for it.
  • Development View: A product's quality is determined by its conformance to its requirement specifications.

735. What quality control factors help to ensure the quality of products and systems?

哪些质量控制因素有助于确保产品和系统的质量?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8040 | 官方: 否 | 付费: 否

答案:

In determining the software quality of a system or a product, there are different factors as given below: - Usability: How easy it is to use or operate the software.

在确定系统或产品的软件质量时,存在以下不同的因素:- 可用性:软件易于使用或操作的程度。
  • Portability: The capability for a software product to be used in different environments or locations.
  • Maintainability: The ease of updating and maintaining a software product.
  • Reliability: How long a product can operate without any downtime or defects.
  • Efficiency: A product's ability to meet the requirements effectively or how well it performs.

736. Explain PDCA Model.

解释PDCA模型。
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8043 | 官方: 否 | 付费: 否

答案:

PDCA (Plan-Do-Check-Action) model/cycle is also known as PDSA ( Plan-Do-Study-Act), the "Deming Wheel," and "Shewhart Cycle". A PDCA cycle fosters the methodical, rigorous implementation of solutions to problems. It is a four-step process that assists teams in avoiding recurring mistakes and improving development processes. In the same way that a circle is infinite, PDCA should be repeated indefinitely to improve continuously.

PDCA(计划-执行-检查-处理)模型/循环也被称为PDSA(计划-执行-研究-处理)、“戴明环”和“休哈特循环”。PDCA循环促进了对问题解决方案的有条不紊、严谨的实施。它是一个四步过程,帮助团队避免重复错误并改进开发流程。正如圆是无限的一样,PDCA应不断重复以持续改进。
  • Plan: The first step is to identify and understand your opportunity or problem, and then plan how to proceed. Planning takes a significant amount of your team's time, depending on the project's size. A proper plan usually consists of smaller steps so that there is a lower possibility of failure.
  • Do: Once you have agreed on a plan, it is time to take action. In this step, you put into practice all the things you considered in the previous stage. At this stage, unforeseen problems can occur. In an ideal scenario, you should first test your plan on a small scale and in a controlled environment.
  • Check: If you wish to develop a clear plan, avoid making the same mistakes, and use continuous improvement effectively, you should pay close attention to the check phase. You need to examine your plan's execution result and determine whether it was successful. Moreover, your team will be capable of identifying problematic parts of the current process and eliminating them in the future. Try experimenting with more changes, and repeat the Do and Check phases. If something goes wrong during the process, you need to figure out the problem's root cause. In any case, if your original plan doesn't work, you ought to start over with the planning phase.
  • Act: The previous steps were to develop, apply, and check your plan. Now it's time to act. As long as everything appears to be working well and your team was successful in achieving the original goals, you can proceed and implement your original plan. In this instance, your PDCA model becomes your new benchmark. Whenever you repeat a standardized plan, ask your team to go through all steps again and improve the care.

737. Describe the characteristics of Quality Control provided by ISO standards?

描述ISO标准提供的质量控制有哪些特征?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8046 | 官方: 否 | 付费: 否

答案:

Different standards are developed and implemented by organizations around the world to improve software quality. When releasing products, several ISO standards must be met. Some of the characteristics as per ISO standards are environmental management, risk management, quality management, auditing. Other ISO standards for quality control include reliability, usability, efficiency, and maintainability.

世界各地组织制定并实施了不同的标准来提高软件质量。在发布产品时,必须满足多个ISO标准。根据ISO标准,一些特征包括环境管理、风险管理、质量管理和审计。其他关于质量控制的ISO标准包括可靠性、可用性、效率和可维护性。

738. Describe the characteristics of Quality Control.

描述质量控制的特征。
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8049 | 官方: 否 | 付费: 否

答案:

Quality control entails several specific characteristics, including: - Adopting a different set of processes.

质量控制包含几个具体特征,包括:- 采用一套不同的流程。
  • To deliver a high-quality product.
  • Providing quality products to customers at an affordable price.
  • Improving quality by implementing processes from different organizations and standards.
  • To ensure proper execution of the test plan.
  • Make sure the execution is planned with the proper review process.
  • The effectiveness and efficiency with which a product or system can be modified in order to improve, correct, or adapt to a changing environment.

739. What are quality control skills?

什么是质量控制技能?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb804c | 官方: 否 | 付费: 否

答案:

A good quality control specialist needs to have some important skills like effective management skills, good communication skills, strong attention to detail, integrity, logical thinking, problem-solving skills, and interpersonal skills.

一位优秀的质量控制专家需要具备一些重要技能,如有效的管理技能、良好的沟通技能、高度的细致关注、诚信、逻辑思维、解决问题的能力和人际交往技能。

740. What is the salary of a QC engineer?

QC工程师的薪资是多少?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb804f | 官方: 否 | 付费: 否

答案:

The salary range for QA/QC Software Engineers in India is between Rs 2.5 Lakhs and 15 Lakhs, with an average annual salary of Rs 6-7 Lakhs. As you gain experience, your salary increases.

在印度,QA/QC软件工程师的薪资范围在25万卢比到150万卢比之间,平均年薪为60万至70万卢比。随着经验的积累,你的薪资会增加。

741. How can I become a QC engineer?

如何成为一名QC工程师?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8052 | 官方: 否 | 付费: 否

答案:

For a career in QC engineering, you must first earn a Mtech in QC/QA, and then you will find enormous opportunities in all fields. You should also develop your problem-solving and organizational skills, as you have to interact with various clients and workers. You can also enrol in a certified course. After that, it would be easy for you to get a job in any industry, or even get a promotion in your current job, or learn the professional skills that are actually needed on the job.

要从事QC工程职业,你必须先获得QC/QA的硕士学位,然后你会在所有领域找到巨大的机会。你还应培养解决问题和组织能力,因为你必须与各种客户和工人互动。你也可以报名参加认证课程。之后,你将很容易在任何行业找到工作,甚至在当前工作中获得晋升,或学习工作中真正需要的专业技能。

742. Is QC a good career?

QC是一个好的职业吗?
  • 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c2b58d557c902bb8055 | 官方: 否 | 付费: 否

答案:

Yes, Quality Control is an excellent career choice. Quality control involves determining whether a software product or service conforms to requirements, or is "fit for use." In almost every IT industry, qualified quality-control professionals are needed to oversee the quality of software and suggest necessary changes. The demand for quality control specialists is always high, and they always get good pay. The role involves a lot of analytical work, has good employment opportunities, is well-paid, and has an evenly distributed workload.

是的,质量控制是一个极好的职业选择。质量控制涉及确定软件产品或服务是否符合要求,或是否“适合使用”。在几乎所有IT行业中,都需要合格的质量控制专业人员来监督软件质量并提出必要的更改建议。对质量控制专家的需求一直很高,他们总能获得良好的报酬。这个角色涉及大量分析工作,就业机会良好,薪酬优厚,且工作量分配均匀。

743. Explain the high-level architecture of the robot framework.

解释机器人框架的高级架构。
  • 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: system-design
  • 分类: fullstack
  • id: 69b37c3758d557c902bc666f | 官方: 否 | 付费: 否

答案:

Robot Framework is a framework that is application and technology agnostic. Its architecture is highly modular, as shown in the diagram below:

机器人框架是一个与应用程序和技术无关的框架。其架构高度模块化,如下图中所示:

The test data is presented in a simple, editable tabular format. Robot Framework processes data, conduct test cases, and generates logs and reports when it is started. The core framework has no knowledge of the target under test, and libraries manage all interactions with it. Libraries can leverage lower-level test tools as drivers or directly employ application interfaces.

测试数据以简单、可编辑的表格格式呈现。机器人框架在启动时处理数据、执行测试用例,并生成日志和报告。核心框架对被测目标没有任何了解,与它的所有交互都由库来管理。库可以利用较低级别的测试工具作为驱动程序,或直接采用应用程序接口。

744. What do you understand about test setup and teardown in the context of the robot framework?

在机器人框架的上下文中,你对测试设置和拆卸有何理解?
  • 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c3758d557c902bc6672 | 官方: 否 | 付费: 否

答案:

Many additional test automation frameworks provide a similar test setup and teardown capability as Robot Framework. In a nutshell, a test setup occurs prior to the execution of a test case, whereas a test teardown occurs after the execution of a test case. Setups and teardowns in the Robot Framework are essentially regular keywords with arguments.

许多其他测试自动化框架提供了与机器人框架类似的测试设置和拆卸功能。简而言之,测试设置发生在测试用例执行之前,而测试拆卸发生在测试用例执行之后。机器人框架中的设置和拆卸本质上是带参数的正规关键字。

The terms "setup" and "teardown" are always used interchangeably. It is feasible to develop higher-level user keywords for this purpose if they need to handle numerous independent jobs. Alternatively, you can use the BuiltIn keyword Run Keywords to execute several keywords.

术语“设置”和“拆卸”经常互换使用。如果它们需要处理多个独立的作业,可以为此开发更高级的用户关键字。或者,你可以使用内置关键字 Run Keywords 来执行多个关键字。

In two ways, the test teardown is unique. For example, it is executed even if a test case fails, so it can be used for cleanup tasks that must be completed regardless of the status of the test case. Furthermore, even if one of the keywords in the teardown fails, all of the others are executed.

测试拆卸在两个方面具有独特性。例如,即使测试用例失败,它也会执行,因此可用于无论测试用例状态如何都必须完成的清理任务。此外,即使拆卸中的一个关键字失败,其他所有关键字也会被执行。

The Test Setup and Test Teardown settings in the Setting section are the simplest way to specify a setup or teardown for test cases in a test case file. Each test case may additionally have its own setup and teardown. They are defined in the test case section with the [Setup] or [Teardown] parameters, and they override any conceivable Test Setup and Test Teardown options. There is no setup or teardown if there is no keyword after a [Setup] or [Teardown] setting. The value NONE can also be used to indicate that a test has no setup or teardown.

在测试用例文件中,设置部分中的测试设置和测试拆卸设置是为测试用例指定设置或拆卸的最简单方式。每个测试用例还可以有自己的设置和拆卸。它们在测试用例部分中使用 [Setup] 或 [Teardown] 参数定义,并覆盖任何可能的测试设置和测试拆卸选项。如果在 [Setup] 或 [Teardown] 设置之后没有关键字,则没有设置或拆卸。值 NONE 也可用于表示测试没有设置或拆卸。

745. What are the different test case styles in the context of the robot framework?

在 Robot Framework 的上下文中,不同的测试用例风格有哪些?
  • 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c3758d557c902bc6675 | 官方: 否 | 付费: 否

答案:

There are various alternative approaches to writing test cases. Test cases describing a workflow can be built using either a keyword-driven or a behaviour-driven approach. Using a data-driven approach, you may evaluate the same workflow with different input data. - Keyword-driven style: Workflow tests, like the Valid Login test, are made up of a number of keywords and their possible arguments. In the Valid Login example, the system is first put into the initial state (Open Login Page), then something is done to it (Input Name, Input Password, Submit Credentials), and lastly the system is confirmed to have performed as intended (Welcome Page Should Be Open).

编写测试用例有多种替代方法。描述工作流的测试用例可以采用关键字驱动或行为驱动的方法来构建。使用数据驱动方法,您可以使用不同的输入数据来评估同一工作流。- 关键字驱动风格:像有效登录测试这样的工作流测试由多个关键字及其可能的参数组成。在有效登录示例中,系统首先被置于初始状态(打开登录页面),然后对其执行操作(输入名称、输入密码、提交凭据),最后确认系统按预期执行(欢迎页面应该打开)。
  • Data-driven design: Another technique to writing test cases is the data-driven approach, which hides the real test workflow by using only one higher-level keyword, commonly created as a user keyword. When you need to test the same scenario with varied input and/or output data, these tests come in handy. Although it would be possible to utilise the same keyword in each test, the test template functionality allows you to define the keyword just once.
  • Behaviour-driven design: Test cases can also be written as requirements that non-technical project stakeholders must comprehend. The cornerstone of a technique known as Acceptance Test-Driven Development (ATDD) or Specification by Example is a set of executable criteria.The Given-When-Then approach, popularized by Behavior Driven Development, is one technique to construct these requirements/tests (BDD). The initial state is commonly specified with a keyword beginning with the word Given, the actions with a keyword beginning with When, and the expectations with a keyword beginning with Then when constructing test cases in this style. If a phase has multiple actions, a keyword beginning with And or But can be used.

Successful Tech Career for FREE!

免费开启成功的科技职业生涯!

Successful Tech Career!

成功的技术职业生涯!

Interview Process

面试流程

CTC & Designation

CTC与职位级别

Projects on the Job

工作项目

Referral System

推荐系统

Try It Out

试试看

2 Lakh+ Roadmaps Created

已生成20万+职业规划

746. What do you understand about Jenkins Freestyle Project?

你对 Jenkins Freestyle Project 有何理解?
  • 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c3758d557c902bc6678 | 官方: 否 | 付费: 否

答案:

When it comes to robot framework interview questions, this is a basic question; yet, it is critical. Jenkins' project will become increasingly important as you progress up the corporate ladder to the firm that recruited you. Jenkins' project is nothing more than a series of tasks that can be run repeatedly to obtain similar outcomes, and these stages also include the activities that must be taken once the build is finished.

在 Robot Framework 面试问题中,这是一个基本问题;然而,它至关重要。随着你在公司晋升到录用你的企业,Jenkins 项目将变得越来越重要。Jenkins 项目不过是一系列任务,可以重复运行以获得相似结果,这些阶段还包括构建完成后必须执行的活动。

Freestyle refers to improvised or unrestricted performance. In Jenkins, a freestyle project is one that spans numerous operations. It could be a pipeline, a build, or a script run.

Freestyle 指的是即兴或不受限制的表现。在 Jenkins 中,freestyle 项目是涵盖众多操作的项目。它可以是流水线、构建或脚本运行。

A freestyle project is a common build job or assignment, according to the Jenkins wiki. Running tests, creating or packaging an application, producing a report, or even running commands are all examples of this. Data is collected before any tests are done. Jenkins can also help with this. Jenkins collects data in a variety of ways, depending on what is being accomplished and the data's intended use.

根据 Jenkins 维基,freestyle 项目是一种常见的构建作业或任务。运行测试、创建或打包应用程序、生成报告,甚至运行命令都是此类示例。在任何测试执行之前会收集数据。Jenkins 在这方面也能提供帮助。Jenkins 根据所执行的任务和数据的预期用途,以多种方式收集数据。

For example, a real-world scenario would entail collecting application artifacts following builds. In terms of management, Jenkins enables us to send reports at any defined stage, which may include artifact information or application logs being sent to a log management entity like Elasticsearch.

例如,一个真实场景会涉及在构建后收集应用程序工件。在管理方面,Jenkins 使我们可以将报告发送到任何定义的阶段,这可能包括将工件信息或应用程序日志发送到如 Elasticsearch 之类的日志管理实体。

747. Differentiate between Robot Framework and Selenium.

区分 Robot Framework 和 Selenium。
  • 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c3758d557c902bc667b | 官方: 否 | 付费: 否

答案:

  • Robot Framework: Robot Framework is an open-source automation framework with a wide range of applications. It can be used to automate test processes and robotic processes (RPA). Robot Framework is a flexible and open framework. To construct powerful and versatile automation solutions, Robot Framework may be connected with nearly any other tool. Robot Framework is free to use and does not require a license.
  • Selenium: Selenium is a popular open-source Web automation testing framework. It was created in 2004 as an internal tool at Thought Works by Jason Huggins. Selenium is a browser automation tool that works with a variety of browsers, platforms, and computer languages. Selenium can run on a variety of platforms, including Windows, Linux, Solaris, and Macintosh. Furthermore, it supports mobile operating systems such as iOS, Windows Mobile, and Android. Selenium supports a wide range of programming languages through the use of language-specific drivers. Selenium supports the following languages: C#, Java, Perl, PHP, Python, and Ruby. Selenium Web driver is currently the most popular with Java and C#. Selenium test scripts can be written in any of the supported programming languages and run in most recent browsers directly. Selenium supports Internet Explorer, Mozilla Firefox, Google Chrome, and Safari browsers.

The following table lists the differences between robot framework and selenium:

下表列出了 Robot Framework 和 Selenium 之间的差异:
| Robot Framework | Selenium |
Robot is a Python acceptance/functional testing framework. Robot is a simple plain text-based automated test framework that may be readily extended with Python or Java frameworks. It can run on both the. net-based IronPython and the Java-based Jython.
Robot 是一个 Python 验收/功能测试框架。Robot 是一个简单的纯文本自动化测试框架,可以轻松地用 Python 或 Java 框架扩展。它可以在基于 .NET 的 IronPython 和基于 Java 的 Jython 上运行。
Selenium is an open-source web application testing tool. Selenium is a robust testing tool that can transmit common Python commands to a variety of browsers, regardless of design differences. It also includes extensions to simulate user interaction with browsers, as well as a distribution server for scaling browser allocation and infrastructure for W3C WebDriver implementations, which allow you to develop interchangeable code for all major web browsers.
Selenium 是一个开源 Web 应用程序测试工具。Selenium 是一个强大的测试工具,可以将常见的 Python 命令发送到各种浏览器,无论设计差异如何。它还包括模拟用户与浏览器交互的扩展,以及用于扩展浏览器分配的分发服务器和 W3C WebDriver 实现的基础设施,允许您为所有主要 Web 浏览器开发可互换的代码。
Robot has a large library and can be readily coupled with Selenium to automate the testing of front-end components in the browser.
Robot 拥有大型库,可以轻松与 Selenium 集成,以自动化测试浏览器中的前端组件。
It's mostly a front-end component and functionality testing tool for browsers.
它主要是一个浏览器前端组件和功能测试工具。
In Robot, there is no built-in way to work with fixtures, but it can be integrated with unittest and used that way.
在 Robot 中,没有内置的方式处理 fixtures,但可以集成 unittest 并使用这种方式。
By using PyTest to write your Selenium WebDriver tests, you gain access to Pytest's rich fixture model.
通过使用 PyTest 编写 Selenium WebDriver 测试,您可以访问 Pytest 丰富的 fixture 模型。
Robot Framework allows you to define a set of fixed, particular data states for a collection of tests (group-fixtures) by combining it with unittest.
Robot Framework 允许您通过结合 unittest 为一组测试定义固定、特定的数据状态(组 fixtures)。
When using Pytest's fixture model, one can group fixtures.
使用 Pytest 的 fixture 模型时,可以对 fixtures 进行分组。
Test data generators are supported. Input data for tests is generated by data generators. The test is then performed for each piece of input data generated in this manner. The Robot Framework Faker library is a library created by Robot. It has 147 keywords that are used to generate random test data.
支持测试数据生成器。数据生成器生成测试的输入数据。然后,对以这种方式生成的每个输入数据执行测试。Robot Framework Faker 库是 Robot 创建的库。它有 147 个关键字,用于生成随机测试数据。
Selenium can generate test data by making use of a library like Faker or Fake-factory.
Selenium 可以使用像 Faker 或 Fake-factory 这样的库来生成测试数据。
Mocks are objects that mimic the actions of real-world items. Using mocks allows you to test a specific section of code in isolation (with other parts mocked when needed). For mocking, Robot Framework can use Python's mock library.
Mock 是模仿真实世界对象行为的对象。使用 mock 允许您隔离地测试代码的特定部分(在需要时其他部分被 mock)。对于模拟,Robot Framework 可以使用 Python 的 mock 库。
By default, Selenium has support for mocking.
默认情况下,Selenium 支持 mock。

748. Differentiate between Robot Framework and Cucumber.

区分 Robot Framework 和 Cucumber。
  • 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c3758d557c902bc667e | 官方: 否 | 付费: 否

答案:

  • Robot Framework: Acceptance Testing, Acceptance Test-Driven Development (ATTD), and Robotic Process Automation (RPA) are all supported by the Robot Platform open-source automation framework. It employs a keyword-driven testing technology method, and testing libraries written in Python or Java can be used to expand its capabilities.
  • Cucumber: Cucumber is a behaviour-driven development (BDD) testing tool (BDD). It provides a method for writing tests that anyone, regardless of technical knowledge, can comprehend. Before developers write their programs, users (business analysts, product owners) submit scenarios or acceptance tests that describe the system's behaviour from the customer's perspective for assessment and approval by the product owners. The Ruby programming language is used in the Cucumber framework.

The following table lists the differences between Robot Framework and Cucumber:

下表列出了 Robot Framework 和 Cucumber 之间的差异:
| Robot Framework | Cucumber |
It is based on the Python programming language.
它基于 Python 编程语言。
It is based on the Ruby programming language.
它基于 Ruby 编程语言。
The robot is a Python acceptance/functional testing framework. The robot is a simple plain text-based automated test framework that may be readily extended with Python or Java frameworks. It can run on both the. net-based IronPython and the Java-based Jython.
Robot 是一个 Python 验收/功能测试框架。Robot 是一个简单的纯文本自动化测试框架,可以轻松地用 Python 或 Java 框架扩展。它可以在基于 .NET 的 IronPython 和基于 Java 的 Jython 上运行。
Cucumber is a behaviour-driven development automation tool. The specifications are written in plain English, making them understandable to all parties involved. Cucumber Framework can also be used with languages other than Ruby, such as Java, JavaScript, and Scala.
Cucumber 是一个行为驱动开发自动化工具。规格以纯英文编写,使所有相关方都能理解。Cucumber Framework 也可以与 Ruby 以外的语言一起使用,如 Java、JavaScript 和 Scala。
The robot framework allows you to test code on a client, such as a web browser. The robot has a large library and can be readily coupled with Selenium to automate the testing of front-end components in the browser.
Robot Framework 允许您在客户端(如 Web 浏览器)上测试代码。Robot 拥有大型库,可以轻松与 Selenium 集成,以自动化测试浏览器中的前端组件。
Cucumber and Selenium can be used to test the front-end, such as the GUI; they work well together to test your front-end.
Cucumber 和 Selenium 可用于测试前端,如 GUI;它们很好地协同工作来测试您的前端。
In Robot Framework, group fixtures can be made by integrating them with the unit tests.
在 Robot Framework 中,可以通过与单元测试集成来创建组 fixtures。
Group Fixtures may be made in two steps using the cucumber extension Aruba:
使用 Cucumber 扩展 Aruba 可以通过两步创建组 Fixtures:

Create a fixtures-directory. Create fixture files in this directory. | | The Robot Framework has Apache License 2.0. | The Cucumber Framework has an MIT License. | | The Robot Framework can be used to generate a test suite. | Cucumber allows you to arrange tests using tag Cucumber feature files or individual tests. Then, during test execution, you may specify the tag (grouped) tests to execute using a Cucumber tagged expression. |

创建一个 fixtures 目录。在此目录中创建 fixture 文件。 | | Robot Framework 使用 Apache License 2.0。 | Cucumber Framework 使用 MIT 许可证。 | | Robot Framework 可用于生成测试套件。 | Cucumber 允许您使用标签 Cucumber 功能文件或单个测试来安排测试。然后,在测试执行期间,您可以使用 Cucumber 标签表达式指定要执行的(分组)标签测试。 |

749. Explain with an example how you would test a web application using the robot framework. What are the various .robot files that you would use in such a case?

用一个例子说明如何使用 Robot Framework 测试 Web 应用程序。在这种情况下,您会使用哪些各种 .robot 文件?
  • 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c3758d557c902bc6681 | 官方: 否 | 付费: 否

答案:

Let us consider a very simple application that has just a login page in it, wherein submitting correct credentials leads to a successful welcome page and submitting incorrect credentials leads to an error page.

让我们考虑一个非常简单的应用程序,它只有一个登录页面,其中提交正确的凭据会成功进入欢迎页面,而提交不正确的凭据会导致错误页面。

Let us assume that the site looks somewhat like this:

让我们假设该网站大致如下所示:

We will consider the following resource file for our testing: - resource.robot

我们将考虑以下资源文件进行测试:- resource.robot
Settings
设置
Documentation A resource file with reusable keywords and variables.
Documentation 一个包含可重用关键字和变量的资源文件。
...
... The system specific keywords created here form our own
... 这里创建的系统特定关键字构成了我们自己的
... domain specific language. They utilize keywords provided
... 领域特定语言。它们使用了由
... by the imported SeleniumLibrary.
... 导入的 SeleniumLibrary 提供的关键字。
Library SeleniumLibrary
Library SeleniumLibrary
Variables
Variables
${SERVER} localhost:3000
${SERVER} localhost:3000
${BROWSER} Chrome
${BROWSER} Chrome
${DELAY} 0
${DELAY} 0
${VALID USER} user
${VALID USER} user
${VALID PASSWORD} password
${VALID PASSWORD} password
${LOGIN URL} http://${SERVER}/
${LOGIN URL} http://${SERVER}/
${WELCOME URL} http://${SERVER}/welcome.html
${WELCOME URL} http://${SERVER}/welcome.html
${ERROR URL} http://${SERVER}/error.html
${ERROR URL} http://${SERVER}/error.html

Keywords

关键字

Open Browser To Login Page

打开浏览器至登录页面
Open Browser ${LOGIN URL} ${BROWSER}
打开浏览器 ${LOGIN URL} ${BROWSER}
Maximize Browser Window
最大化浏览器窗口
Set Selenium Speed ${DELAY}
设置 Selenium 速度 ${DELAY}
Login Page Should Be Open
登录页面应已打开
Login Page Should Be Open
登录页面应已打开
Title Should Be Login Page
标题应为 登录页面

Go To Login Page

跳转到登录页面
Go To ${LOGIN URL}
跳转到 ${LOGIN URL}
Login Page Should Be Open
登录页面应已打开

Input Username

输入用户名
[Arguments] ${username}
[参数] ${username}
Input Text username_field ${username}
输入文本 用户名字段 ${username}

Input Password

输入密码
[Arguments] ${password}
[参数] ${password}
Input Text password_field ${password}
输入文本 password_field ${password}

Submit Credentials

提交凭据
Click Button login_button
点击按钮 login_button

Welcome Page Should Be Open

欢迎页面应该打开
Location Should Be ${WELCOME URL}
位置应该是 ${WELCOME URL}
Title Should Be Welcome Page
标题应该是 欢迎页面

In this file, we specify the browser to be used, the URL to be accessed and all the necessary information required.

在此文件中,我们指定要使用的浏览器、要访问的URL以及所有必要的信息。

Next, we declare a test suite named valid_login.robot which has a single test case in it. We input the correct credentials and check if the welcome page opens or not. - valid_login.robot

接下来,我们声明一个名为valid_login.robot的测试套件,其中包含一个测试用例。我们输入正确的凭据,并检查欢迎页面是否打开。- valid_login.robot
Settings
设置
Documentation A test suite with a single test for valid login.
文档 一个包含单个有效登录测试的测试套件。
...
... This test has a workflow that is created using keywords in
... 该测试有一个使用以下关键字创建的工作流
... the imported resource file.
... 在导入的资源文件中。
Resource resource.robot
资源文件 resource.robot

Test Cases

测试用例
Valid Login
有效登录
Open Browser To Login Page
打开浏览器至登录页面
Input Username demo
输入用户名 demo
Input Password mode
输入密码 mode
Submit Credentials
提交凭据
Welcome Page Should Be Open
欢迎页面应该打开
[Teardown] Close Browser
[拆解] 关闭浏览器

Next, we declare a test suite named invalid_login.robot which has several test cases in it. We input incorrect credentials and check if the error page opens or not. - invalid_login.robot

接下来,我们声明一个名为 invalid_login.robot 的测试套件,其中包含多个测试用例。我们输入错误凭据,并检查错误页面是否打开。 - invalid_login.robot
Settings
设置
Documentation A test suite containing tests related to invalid login.
文档 一个包含无效登录相关测试的测试套件。
...
... These tests are data-driven by their nature. They use a single
... 这些测试本质上是数据驱动的。它们使用一个
... keyword, specified with Test Template setting, that is called
... 关键字,由测试模板设置指定,该关键字
... with different arguments to cover different scenarios.
... 以不同参数调用以覆盖不同场景。
...
... This suite also demonstrates using setups and teardowns in
... 此套件还演示了在不同层级使用设置和拆解。
... different levels.
...不同层次。
Suite Setup Open Browser To Login Page
套件设置 打开浏览器至登录页面
Suite Teardown Close Browser
套件拆解 关闭浏览器
Test Setup Go To Login Page
测试设置 前往登录页面
Test Template Login With Invalid Credentials Should Fail
测试模板 使用无效凭据登录应失败
Resource resource.robot
资源文件 resource.robot

Test Cases USER NAME PASSWORD

测试用例 用户名 密码
Invalid Username invalid ${VALID PASSWORD}
无效用户名 invalid ${VALID PASSWORD}
Invalid Password ${VALID USER} invalid
无效密码 ${VALID USER} invalid
Invalid Username And Password invalid whatever
无效用户名和密码 invalid whatever
Empty Username ${EMPTY} ${VALID PASSWORD}
空用户名 ${EMPTY} ${VALID PASSWORD}
Empty Password ${VALID USER} ${EMPTY}
空密码 ${VALID USER} ${EMPTY}
Empty Username And Password ${EMPTY} ${EMPTY}
空用户名和密码 ${EMPTY} ${EMPTY}

Keywords

关键字
Login With Invalid Credentials Should Fail
使用无效凭据登录应失败
[Arguments] ${username} ${password}
[参数] ${username} ${password}
Input Username ${username}
输入用户名 ${username}
Input Password ${password}
输入密码 ${password}
Submit Credentials
提交凭据
Login Should Have Failed
登录本应失败

Login Should Have Failed

登录本应失败
Location Should Be ${ERROR URL}
位置应为 ${ERROR URL}
Title Should Be Error Page
标题应为 错误页面

Conclusion:

结论:
If you are appearing for an interview for a role that requires expertise in the robot framework, you can expect general questions based on automated testing as well. Do not worry, we got you covered.
如果你正在参加一个要求具备机器人框架专业知识的面试,你也会遇到基于自动化测试的通用问题。别担心,我们已经为你准备好了。

Useful Interview Resources: - Automation Testing

有用的面试资源:- 自动化测试
  • API Testing
  • Selenium WebDriver
  • Cucumber
  • Automation Testing Tools
  • Python
  • UiPath

750. What do you understand about Risk based testing?

你对基于风险的测试有什么理解?
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6eed | 官方: 否 | 付费: 否

答案:

Risk-based testing (RBT) is a method of software testing that is based on risk likelihood. It entails analyzing the risk based on software complexity, business criticality, frequency of use, and probable Defect areas, among other factors. Risk-based testing prioritizes testing of software programme aspects and functions that are more important and likely to have flaws.

基于风险的测试(RBT)是一种基于风险可能性的软件测试方法。它涉及根据软件复杂性、业务关键性、使用频率和可能的缺陷区域等因素来分析风险。基于风险的测试优先测试软件程序方面和功能中更重要且可能存在缺陷的部分。

Risk is the occurrence of an unknown event that has a positive or negative impact on a project's measured success criteria. It could be something that happened in the past, something that is happening now, or something that will happen in the future. These unforeseen events might have an impact on a project's cost, business, technical, and quality goals.

风险是未知事件的发生,它对项目衡量的成功标准有正面或负面影响。它可能是过去发生的事情、现在正在发生的事情,或将来会发生的事情。这些不可预见的事件可能会影响项目的成本、业务、技术和质量目标。

Risks can be positive or negative. Positive risks are referred to as opportunities, and they aid in the long-term viability of a corporation. Investing in a new project, changing corporate processes, and developing new products are just a few examples.

风险可以是正面的或负面的。正面风险称为机会,它们有助于企业的长期生存能力。投资新项目、改变公司流程和开发新产品只是一些例子。

Negative risks are also known as threats, and strategies to reduce or eliminate them are necessary for project success.

负面风险也称为威胁,为了项目成功,必须采取策略来减少或消除它们。

751. What do you understand about white box testing and black box testing? Differentiate between them.

你对白盒测试和黑盒测试有什么理解?请区分它们。
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6ef0 | 官方: 否 | 付费: 否

答案:

  • Black Box Testing: The customer's statement of requirements is the most common source of black-box testing. It's a different kind of manual testing. It's a software testing technique that looks at the software's functionality without knowing anything about its internal structure or coding. It does not necessitate any software programming knowledge. All test cases are created with the input and output of a certain function in mind. The test engineer examines the programme against the specifications, detects any faults or errors, and returns it to the development team.
  • White Box Testing: The term "clear box," "white box," or "transparent box" refers to the capacity to see into the inner workings of software through its outside shell. It is carried out by developers, after which the software is handed to the testing team for black-box testing. The fundamental goal of white-box testing is to examine the infrastructure of an application. It is carried out at a lower level, as unit testing and integration testing are included. It necessitates programming skills because it primarily focuses on a program's or software's code structure, routes, conditions, and branches. The main purpose of white-box testing is to concentrate on the flow of inputs and outputs via the software while also ensuring its security.

The following table lists the differences between black box and white box testing:

下表列出了黑盒测试和白盒测试之间的区别:
| Black Box Testing
黑盒测试 | White Box Testing
白盒测试 |
It's a software testing technique that looks at how the software works without knowing anything about its core structure or coding.
它是一种软件测试技术,查看软件如何工作,而无需了解其核心结构或编码。
In white-box testing, the tester is aware of the software's internal structure.
在白盒测试中,测试人员了解软件的内部结构。
Functional testing, data-driven testing, and closed-box testing are all terms used to describe Black Box Testing.
黑盒测试也被称为功能测试、数据驱动测试和闭盒测试。
It is also known as structural testing, clear box testing, code-based testing, and transparent testing.
它也被称为结构测试、透明盒测试、基于代码的测试和透明测试。
There is minimal programming knowledge necessary in black-box testing.
黑盒测试中所需的编程知识很少。
There is a demand for programming skills in white-box testing.
白盒测试需要编程技能。
It's not the best tool for testing algorithms.
它不是测试算法的最佳工具。
It's ideal for algorithm testing and comes highly recommended.
它适合算法测试,并且深受推荐。
It is carried out at the higher stages of testing, such as system and acceptability testing.
它在测试的较高阶段进行,如系统和验收测试。
It is carried out at the unit and integration testing stages of testing.
它在单元和集成测试阶段进行。
It is primarily carried out by software testers.
它主要由软件测试人员执行。
Developers are the ones who do it the most.
开发者是主要执行者。
It takes less time to complete. The amount of time spent on black-box testing is determined by the availability of functional specifications.
它花费的时间较少。黑盒测试所花费的时间取决于功能规格的可用性。
It takes a longer time. Because of the large code, creating test cases takes a long time.
它需要更长的时间。由于代码量大,创建测试用例需要很长时间。
External expectations serve as the foundation for this testing.
外部期望是此测试的基础。
The foundation of this testing is code, which is in charge of internal operations.
此测试的基础是代码,代码负责内部操作。
There is no need for implementation knowledge in black-box testing.
黑盒测试不需要实现知识。
There is a demand for implementation knowledge in white-box testing.
白盒测试需要实现知识。
Once the code is ready, flaws are found via black-box testing.
代码准备好后,通过黑盒测试发现缺陷。
White box testing allows for the early detection of faults.
白盒测试可以早期检测缺陷。
Functional testing, Non-Functional testing, and Regression testing are the three main types of black-box testing.
黑盒测试的主要类型是功能测试、非功能测试和回归测试。
Path testing, Loop testing, and Condition testing are types of white box testing.
白盒测试的类型包括路径测试、循环测试和条件测试。

752. Differentiate between walkthrough and inspection.

区分走查和审查。
  • 知识点: 测试 / 行为与软技能 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6ef3 | 官方: 否 | 付费: 否

答案:

Walkthrough - A walkthrough is a technique for doing a quick group or individual review. In a walkthrough, the author describes and explains his work product to his peers or supervisor in an informal gathering to receive comments. The legitimacy of the suggested work product solution is checked here. It is less expensive to make adjustments while the design is still on paper rather than during conversion. A walkthrough is a form of quality assurance that is done in a static manner. Walkthroughs are casual gatherings with a purpose.

走查——走查是一种进行快速小组或个人审查的技术。在走查中,作者在非正式聚会上向其同事或主管描述并解释其工作产品,以获取评论。这里检查建议的工作产品解决方案的合法性。在设计还在纸上时进行修改比在转换期间更便宜。走查是一种以静态方式进行的质量保证形式。走查是有目的的随意聚会。

The following table lists the differences between walkthrough and inspection -

下表列出了走查和审查之间的区别:
Walkthrough
走查
Inspection
审查
It is informal in nature.
它本质上是非正式的。
It is formal in nature.
它本质上是正式的。
The developer starts it.
开发者启动它。
The project team starts it.
项目团队启动它。
The developer of the product takes the lead throughout the walkthrough.
产品开发者在整个走查过程中起主导作用。
The inspection is conducted by a group of people from several departments. The tour is usually attended by members of the same project team.
审查由来自多个部门的一组人进行。走查通常由同一项目团队的成员参加。
The walkthrough does not employ a checklist.
走查不使用检查清单。
A checklist is used to identify flaws.
使用检查清单来识别缺陷。
Overview, little or no preparation, little or no preparation examination (real walkthrough meeting), rework, and follow up are all part of the walkthrough process.
走查过程包括概述、很少或没有准备、准备工作检查(实际走查会议)、返工和跟进。
Overview, preparation, inspection, rework, and follow-up are all part of the inspection process.
审查过程包括概述、准备、检查、返工和跟进。
In the steps, there is no set protocol.
步骤中没有固定协议。
Each phase has a formalized protocol.
每个阶段都有正式的协议。
Because there is no specific checklist to evaluate the programme, the walkthrough takes less time.
因为没有特定的检查清单来评估程序,走查花费的时间较少。
An inspection takes longer since the checklist items are checked off one by one.
审查需要更长时间,因为检查清单项目会逐项勾选。
It is generally unplanned in nature.
它通常本质上是无计划的。
Scheduled meeting with fixed duties allocated to all participants.
计划会议,所有参与者都有固定的职责分配。
Because it is unmoderated, there is no moderator.
因为它不受调节,所以没有主持人。
The responsibility of the moderator is to ensure that the talks stay on track.
主持人的责任是确保讨论保持在正轨上。

753. What do you understand about a test script? Differentiate between test case and test script.

你对测试脚本有什么理解?区分测试用例和测试脚本。
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6ef6 | 官方: 否 | 付费: 否

答案:

Test scripts are a line-by-line description of the system transactions that must be done in order to validate the application or system under test. Each step should be listed in the test script, along with the intended outcomes. This automation script enables software testers to thoroughly test each stage on a variety of devices. The actual items to be executed, as well as the expected results, must be included in the test script.

测试脚本是对系统交易的逐行描述,这些交易必须执行以验证被测应用程序或系统。每一步都应列在测试脚本中,并附带预期结果。此自动化脚本使软件测试人员能够在各种设备上全面测试每个阶段。要执行的实际项目以及预期结果必须包含在测试脚本中。

The following table lists the differences between test case and test script :

下表列出了测试用例和测试脚本之间的区别:
Test Case
测试用例
Test Script
测试脚本
A test case is a detailed technique for testing an application.
测试用例是测试应用程序的详细技术。
A test script is a set of instructions for autonomously testing an application.
测试脚本是用于自主测试应用程序的一组指令。
In a manual testing environment, Test Cases are employed.
在手动测试环境中,使用测试用例。
In the automation testing environment, Test Script is employed.
在自动化测试环境中,使用测试脚本。
It's done by hand.
它是手工完成的。
It is carried out in accordance with the scripting format.
它按照脚本格式执行。
Test ID, test data, test technique, actual and predicted outcomes, and so on are all included in the test case template.
测试用例模板中包含测试ID、测试数据、测试技术、实际和预期结果等。
To create a script in Test Script, we can utilise a variety of commands.
要创建测试脚本中的脚本,我们可以使用各种命令。

754. What do you understand about fuzz testing? What are the types of bugs detected by fuzz testing?

你对模糊测试理解多少?模糊测试能检测出哪些类型的错误?
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6efa | 官方: 否 | 付费: 否

答案:

Fuzz Testing is a software testing technique that utilizes erroneous, unexpected, or random data as input and then looks for exceptions like crashes and memory leaks. It's a type of automated testing that's used to define system testing techniques that use a randomized or dispersed approach. During fuzz testing, a system or software program may have a variety of data input problems or glitches.

模糊测试是一种软件测试技术,它利用错误、意外或随机的数据作为输入,然后寻找异常,如崩溃和内存泄漏。它是一种自动化测试,用于定义使用随机或分散方法的系统测试技术。在模糊测试期间,系统或软件程序可能会遇到各种数据输入问题或故障。

Following are the different phases of Fuzz Testing:

以下是模糊测试的不同阶段:
  • Identify the Target System: The system or software application that will be tested is identified. The target system is the name given to that system. The testing team determines the target system.
  • Identify Inputs: Once the target system is determined, random inputs are generated for testing purposes. The system or software application is tested using these random test scenarios as inputs.
  • Generate Fuzzed Data: After receiving unexpected and invalid inputs, these invalid and unexpected inputs are turned to fuzzed data. Fuzzed data is essentially random data that has been transformed into fuzzy logic.
  • Use fuzzed data to run the test: The fuzzed data testing process is now being used. Basically, the code of the programme or software is executed in this portion by providing random input, i.e. fuzzed data.
  • Monitor System Behavior: After the system or software application has completed its execution, check for any crashes or other anomalies, such as potential memory leaks. The random input is used to test the system's behaviour.
  • Log Flaws: In the final phase, defects are detected and rectified in order to produce a higher-quality system or software program.

Following are the different types of bugs detected by fuzz testing :

以下是模糊测试检测出的不同类型的错误:
  • Failures in assertions and memory leaks - This practice is often employed in large applications where defects compromise memory safety, which is a serious flaw.
  • Invalid data - Fuzzers are used in fuzz testing to generate faulty input that is used to test error-handling methods, which is critical for software that does not have control over its input. Simple fuzzing is a technique for automating negative testing.
  • Correctness bugs - Some forms of "correctness" flaws can also be detected using fuzzing. For example, a corrupted database, inadequate search results, and so on.

755. Given the urgency with which a crucial hotfix must be deployed - What kind of testing technique would you use if you were in charge of the project?

考虑到必须紧急部署一个关键热修复 - 如果你负责这个项目,你会使用哪种测试技术?
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6f0b | 官方: 否 | 付费: 否

答案:

In this case, the interviewer is most interested in learning more about you. - What types of test strategies can you conceive of and how do you plan to implement them?

在这种情况下,面试官最感兴趣的是进一步了解你。- 你能想到哪些类型的测试策略,以及你计划如何实施它们?
  • What kind of coverage would you provide in the event of a hotfix?
  • How would you test the hotfix after it's been deployed? etc.
    If you can relate to the problem, you can use real-life circumstances to answer such questions. You should also explain that you would not be willing to deliver any code to production without proper testing. When it comes to essential fixes, you should always collaborate with the developer to figure out what areas they might affect and set up a non-production environment to test the change. It's also worth noting that you'll continue to monitor the fix (using monitoring tools, dashboards, logs, and so on) after it's been deployed to look for any anomalous behaviour in the production environment and ensure that the fix hasn't had any negative consequences.

    如果你能关联到这个问题,你可以用现实生活中的情况来回答此类问题。你还应解释,在没有适当测试的情况下,你不会愿意将任何代码交付到生产环境。对于关键修复,你应始终与开发人员合作,弄清楚它们可能影响的领域,并设置一个非生产环境来测试更改。还值得注意的是,你会在修复部署后继续监控它(使用监控工具、仪表板、日志等),以查找生产环境中的任何异常行为,并确保修复没有产生任何负面影响。

756. Would you forego thorough testing in order to release a product quickly?

你会为了快速发布产品而放弃全面测试吗?
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6f13 | 官方: 否 | 付费: 否

答案:

These questions usually ask the interviewer to grasp your thinking as a leader, as well as what you would compromise on and whether you would be prepared to produce a flawed product in exchange for less time. Answers to these questions should be supported by the candidate's actual experiences.

这些问题通常要求面试官理解你作为领导者的思维,以及你会妥协什么,是否愿意用更少的时间换取有缺陷的产品。对这些问题的回答应基于候选人的实际经验来支持。

For example , you may say that in the past, you had to make a decision to release a hotfix, but it couldn't be tested since the integration environment was unavailable. So you rolled it out in stages, starting with a small proportion and then monitoring logs/events before launching the complete rollout, and so on.

例如,你可以说,过去你不得不决定发布一个热修复,但由于集成环境不可用,它无法测试。所以你在启动完全部署之前分阶段推出它,先从一小部分开始,然后监控日志/事件,等等。

757. How would you go about creating an Automation Strategy for a product that doesn't have any automation tests?

你会如何为一个没有任何自动化测试的产品创建自动化策略?
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6f16 | 官方: 否 | 付费: 否

答案:

These types of questions are open-ended, so you may take the conversation in any direction you desire. You can also highlight your strong talents, knowledge, and technological areas.

这类问题是开放式的,所以你可以将对话引向你想要的任何方向。你还可以突出你的强项、知识和技术领域。

You can, for example, use instances of the Automation Strategy you used while constructing a product in a previous capacity to respond to these types of inquiries.

例如,你可以使用你在之前职位中构建产品时使用的自动化策略实例来回答这些类型的问题。

For example, you could say things like, - Because the product necessitated starting automation from the ground up, you had plenty of time to consider and design an appropriate automation framework, opting for a language/technology that the majority of people were familiar with in order to avoid introducing a new tool and instead leverage existing knowledge.

例如,你可以这样说——由于产品需要从零开始构建自动化,你有充足的时间考虑和设计合适的自动化框架,选择大多数人熟悉的语言/技术,以避免引入新工具,而是利用现有知识。
  • You began by automating the most basic functional scenarios, which were referred to as P1 scenarios (without which no release could go through).
  • You also considered using automated test tools like JMETER, LoadRunner, and others to test the system's performance and scalability.
  • You considered automating the application's security features as outlined in the OWASP Security guidelines.
  • For early feedback and other reasons, you included automated tests into the build workflow.

758. What is Equivalence Partitioning, and how does it work? Use an example to demonstrate your point.

什么是等价类划分,它是如何工作的?用一个例子来证明你的观点。
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6f19 | 官方: 否 | 付费: 否

答案:

Equivalence Class Partitioning (ECP) is another name for the Equivalence Partitioning Method. It is a software testing technique, often known as black-box testing, that splits the input domain into data classes from which test cases can be constructed. An ideal test case identifies a type of error that may necessitate the execution of a large number of arbitrary test cases before a general error is detected. Equivalence classes are evaluated for given input conditions in equivalence partitioning. When any input is given, the type of input condition is examined, and the Equivalence class defines or explains a collection of valid or invalid states for this input condition. - Example 1 - Let's take a look at a typical college admissions procedure. There is a college that admits students depending on their grade point average. Consider a percentage field that will only accept percentages between 50 and 90%; anything higher or lower will result in the program redirecting the visitor to an error page. If the user enters a percentage that is less than 50% or greater than 90%, the equivalence partitioning technique will display an invalid percentage. The equivalence partitioning method will show a valid percentage if the percentage entered is between 50 and 90%.

等价类划分法(ECP)是等价划分方法的另一个名称。它是一种软件测试技术,通常称为黑盒测试,将输入域划分为数据类,从中可以构建测试用例。理想测试用例能识别一种错误类型,这种错误可能在检测到一般错误之前需要执行大量任意测试用例。在等价划分中,对于给定的输入条件评估等价类。当给定任何输入时,检查输入条件的类型,等价类定义或解释该输入条件的一组有效或无效状态。- 示例1 - 让我们看一个典型的大学录取流程。有一所大学根据学生的平均绩点来录取学生。考虑一个百分比字段,只接受50%到90%之间的百分比;任何高于或低于此范围的值都会导致程序将访问者重定向到错误页面。如果用户输入的百分比小于50%或大于90%,等价划分技术将显示无效百分比。如果输入的百分比在50%到90%之间,等价划分方法将显示有效百分比。
  • Example 2 - Consider the following software application as an example. A software application has a function that accepts only a certain number of numbers, not even larger or fewer than that number. Consider an OTP number with only six digits; anything more or less than six numbers will be rejected, and the application will route the customer or user to an error page. If the user's password is fewer than or equal to six characters, the equivalence partitioning method will display an invalid OTP. The equivalence partitioning technique will display a valid OTP if the password given is precisely six characters.

759. Explain some expert opinions on how a tester can determine whether a product is ready to be used in a live environment.

解释一些专家关于测试人员如何确定产品是否可用于真实环境的观点。
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6f1c | 官方: 否 | 付费: 否

答案:

Because this is such a crucial decision, it has never been taken by a single individual or by junior guys. This choice is not made solely by the developer and tester; senior management is involved on a regular basis. Management tests primarily ensure that product delivery is bug-free by validating the following: - Validating the bug reports that the tester has submitted. How the bug was fixed and whether or not the tester retested it.

因为这是一个至关重要的决定,它从未由单个个人或初级人员做出。这个选择不由开发人员和测试人员单独决定,高级管理层定期参与其中。管理测试主要通过验证以下内容来确保产品交付无缺陷:- 验证测试人员提交的缺陷报告。缺陷是如何修复的,以及测试人员是否重新测试了它。
  • Validating all of the test cases written by the tester for that specific functionality, as well as the documentation and confirmation received from the tester.
  • Run automated test cases to ensure that new features do not interfere with existing features.
  • Validating test coverage report, which confirms that all of the developing component's test cases have been written.

760. What do you understand about performance testing and load testing? Differentiate between them.

你对性能测试和负载测试有什么理解?区分它们。
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6f1f | 官方: 否 | 付费: 否

答案:

  • Performance Testing: Performance testing is a sort of software testing that guarantees that software programmes function as expected under certain conditions. It is a method of determining system performance in terms of sensitivity, reactivity, and stability when subjected to a specific workload. The practice of examining a product's quality and capability is known as performance testing. It's a means of determining how well a system performs in terms of speed, reliability, and stability under various loads. Perf Testing is another name for performance testing.
  • Load Testing: Load testing is a type of performance testing that assesses a system's, software product's, or software application's performance under realistic load situations. Load testing determines how a programme behaves when several users use it at the same time. It is the system's responsiveness as assessed under various load conditions. Load testing is done under both normal and excessive load circumstances.

The following table lists the differences between Performance Testing and Load Testing :

下表列出了性能测试和负载测试之间的区别:
| Performance Testing
性能测试 | Load Testing
负载测试 |
The process of determining a system's performance, which includes speed and reliability under changing loads, is known as performance testing.
确定系统性能(包括在不同负载下的速度和可靠性)的过程称为性能测试。
The practice of determining how a system behaves when several people access it at the same time is known as load testing.
确定系统在多人同时访问时行为方式的做法称为负载测试。
The load on which the system is evaluated is normal in terms of performance.
性能测试中评估的系统负载是正常的。
In load testing, the maximum load is used.
在负载测试中,使用最大负载。
It examines the system's performance under regular conditions.
它检查系统在常规条件下的性能。
It examines the system's performance under heavy load.
它检查系统在高负载下的性能。
The limit of load in performance testing is both below and above the break threshold.
性能测试中的负载限制既低于又高于中断阈值。
The limit of load in load testing refers to the point at which a break occurs.
负载测试中的负载限制指的是发生中断的点。
It verifies that the system's performance is satisfactory.
它验证系统性能是否令人满意。
It determines the system's or software application's working capacity.
它确定系统或软件应用程序的工作容量。
During performance testing, speed, scalability, stability, and reliability are all examined.
在性能测试期间,检查速度、可扩展性、稳定性和可靠性。
During load testing, only the system's long-term viability is examined.
在负载测试期间,仅检查系统的长期可行性。
Tools for performance testing are less expensive.
性能测试工具更便宜。
Load testing equipment is expensive.
负载测试设备昂贵。

761. Mention some of the software testing tools used in the industry and their key features.

提到一些行业中使用的软件测试工具及其关键特性。
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6f22 | 官方: 否 | 付费: 否

答案:

Following are some of the software testing tools used in the industry : - TestRail - TestRail is a web-based test case management system that is scalable and flexible. Our cloud-based/SaaS solution may be set up in minutes, or you can install your own server on TestRail.

以下是行业中使用的几种软件测试工具:- TestRail - TestRail 是一个基于Web的可扩展且灵活的测试用例管理系统。我们的云基础/SaaS解决方案可以在几分钟内设置完成,或者您可以在TestRail上安装自己的服务器。
  • Testpad - Testpad is a more straightforward and accessible manual testing tool that emphasizes pragmatism over method. It employs checklist-inspired test plans that may be modified to a broad range of approaches, including exploratory testing, the manual side of Agile, syntax-highlighted BDD, and even traditional test case management, rather than handling cases one at a time.
  • Xray - Xray is a full-featured tool that exists inside Jira and works flawlessly with it. Its mission is to assist businesses in improving the quality of their products through efficient and effective testing.
  • Practitest - PractiTest is a complete test management solution. It provides comprehensive visibility into the testing process and a better, broader understanding of testing outcomes by serving as a common meeting ground for all QA stakeholders.
  • SpiraTest - SpiraTest is a cutting-edge Test Management solution for both large and small teams. Spiratest allows you to handle requirements, plans, tests, issues, tasks, and code in a unified environment, fully embracing the agile method of working. SpiraTest is ready to use right out of the box and adapts to your needs, methodology, workflows, and toolchain.
  • TestMonitor - Every firm can benefit from TestMonitor's end-to-end test management capabilities. It is a straightforward and intuitive way to test. TestMonitor has you covered whether you're adopting corporate software, need QA, produce a quality app, or just need a helping hand with your test project.

762. Differentiate between Alpha testing and Beta testing.

区分Alpha测试和Beta测试。
  • 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4558d557c902bc6f25 | 官方: 否 | 付费: 否

答案:

The following table lists the differences between alpha testing and beta testing:

下表列出了Alpha测试和Beta测试之间的区别:
Alpha testing
Alpha测试
Beta testing
Beta测试
Both white box and black box testing are used in alpha testing.
Alpha测试同时使用白盒和黑盒测试。
Black box testing is used in beta testing.
Beta测试使用黑盒测试。
Alpha testing is frequently done by testers who are inside employees of the company.
Alpha测试通常由公司内部员工测试人员执行。
Clients who are not employees of the company undertake beta testing.
不是公司员工的客户执行Beta测试。
Alpha testing takes place on the developer's premises.
Alpha测试在开发人员的工作地点进行。
Beta testing is done on the product's end-users.
Beta测试在产品最终用户处进行。
Alpha testing does not include any reliability or security testing.
Alpha测试不包括任何可靠性或安全性测试。
During beta testing, reliability, security, and robustness are examined.
在Beta测试期间,检查可靠性、安全性和健壮性。
Before moving on to beta testing, alpha testing verifies that the product is of high quality.
在进入Beta测试之前,Alpha测试验证产品质量是否高。
Beta testing focuses on the product's quality as well as gathering user feedback and ensuring that the product is ready for real-world use.
Beta测试关注产品质量,同时收集用户反馈并确保产品准备好用于实际使用。
Alpha testing necessitates the use of a lab or a testing environment.
Alpha测试需要使用实验室或测试环境。
Beta testing does not necessitate the use of a testing setting or laboratory.
Beta测试不需要使用测试环境或实验室。
Alpha testing could necessitate a lengthy execution cycle.
Alpha测试可能需要较长的执行周期。
Only a small amount of time is required for beta testing.
Beta测试只需要少量时间。

763. State the major difference between “assert” and “verify” commands in Selenium.

说明Selenium中“assert”和“verify”命令的主要区别。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4658d557c902bc704f | 官方: 否 | 付费: 否

答案:

Both “assert” and “verify” commands check whether the given condition is true or false and the only difference between them is that: - Assert: Assert condition stops the execution of the testing if the given condition is false else would continue with the further tests.

“assert”和“verify”命令都检查给定条件是否为真或假,它们之间的唯一区别是:- Assert:如果给定条件为假,Assert条件会停止测试执行,否则将继续进行后续测试。
  • Verify: Verify the condition doesn’t stop the flow of execution irrespective of the condition being true or false.

764. Explain the same-origin policy and how Selenium handles it?

解释同源策略以及Selenium如何处理它?
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4658d557c902bc7052 | 官方: 否 | 付费: 否

答案:

The same Origin policy is a feature adopted for security purposes that allows a web browser to run scripts from one webpage to access the contents of another webpage provided both pages have the same origin. The URL scheme, hostname, and port number combo are referred to as the origin. This policy was introduced to prevent access to sensitive data on one webpage by another for ill purposes. Consider a Java program used by scaler.com, the program can access domain pages like scaler.com/mentors, scaler.com/courses but none from different domains like facebook.com.

同源策略是为安全目的而采用的一项功能,它允许网页浏览器中的一个网页脚本访问另一个网页的内容,前提是这两个页面具有相同的源。URL协议、主机名和端口号的组合被称为源。该策略旨在防止一个网页出于恶意目的访问另一个网页上的敏感数据。考虑一个由scaler.com使用的Java程序,该程序可以访问scaler.com/mentors、scaler.com/courses等域页面,但不能访问如facebook.com等不同域的内容。

The Selenium Server (Selenium RC) acts as a client-configured HTTP proxy and "tricks" the browser into believing that Selenium Core and the web application being tested come from the same origin.

Selenium Server(Selenium RC)充当客户端配置的HTTP代理,并“欺骗”浏览器,使其认为Selenium Core和被测Web应用程序来自同一源。

765. Explain the pause feature in Selenium IDE.

解释Selenium IDE中的暂停功能。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4658d557c902bc7055 | 官方: 否 | 付费: 否

答案:

The pause feature is built to handle exceptions in the test script by allowing the user to pause at the statement causing the exception and enter the debug mode by clicking on the pause icon on the top right corner of the IDE. This feature prevents the entire test case's failure and gives the user a chance to correct the error instantly.

暂停功能旨在处理测试脚本中的异常,允许用户在引起异常的语句处暂停,并通过点击IDE右上角的暂停图标进入调试模式。此功能防止整个测试用例失败,并给用户立即纠正错误的机会。

766. With the help of code snippets, explain how we can create right-click and mouse hover actions in Selenium.

借助代码片段,解释如何在Selenium中创建右键单击和鼠标悬停操作。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4658d557c902bc7058 | 官方: 否 | 付费: 否

答案:

The following code can replicate right-click action:

以下代码可以模拟右键单击操作:

actions action = newActions(driver);

actions action = newActions(driver);
WebElement element = driver.findElement(By.id("elementId"));
WebElement element = driver.findElement(By.id("elementId"));
action.contextClick(element).perform();
action.contextClick(element).perform();
The following code can replicate the mouse hover action:
以下代码可以模拟鼠标悬停操作:

actions action = newActions(driver);

actions action = newActions(driver);
WebElement element = driver.findElement(By.id("elementId"));
WebElement element = driver.findElement(By.id("elementId"));
action.moveToElement(element).perform();
action.moveToElement(element).perform();

767. Can we handle a windows-based pop-up in Selenium, and if not, then what are the alternatives?

我们能否在Selenium中处理基于Windows的弹出窗口,如果不能,那么有哪些替代方案?
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4658d557c902bc705b | 官方: 否 | 付费: 否

答案:

No, Selenium doesn’t support windows-based pop-ups as it’s an automated testing tool built for web application-based testing. However, with the support of third-party tools like AutoIT, Robot class, etc., windows-based pop-ups can be handled in selenium.

不能,Selenium不支持基于Windows的弹出窗口,因为它是一个为基于Web应用程序测试而构建的自动化测试工具。然而,借助AutoIT、Robot类等第三方工具,可以在Selenium中处理基于Windows的弹出窗口。

768. Can you capture a screenshot using Selenium? If yes, write a simple code to illustrate the same.

能否使用Selenium捕获屏幕截图?如果可以,请编写一个简单代码来演示。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37c4658d557c902bc705e | 官方: 否 | 付费: 否

答案:

Yes, using a web driver in Selenium, we can capture the screenshot. Following is the code to do the same:

是的,使用 Selenium 中的 Web 驱动程序,我们可以捕获屏幕截图。以下是实现此操作的代码:

import org.junit.After;

import org.junit.After;
import org.junit.Before;
import org.junit.Before;
import org.junit.Test;
import org.junit.Test;
import java.io.File;
import java.io.File;
import java.io.IOException;
import java.io.IOException;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class TakeScreenshot {
public class TakeScreenshot {
WebDriver drv;
WebDriver drv;
@ Before
@ Before
public void setUp() throws Exception {
public void setUp() throws Exception {
driver = new FirefoxDriver();
driver = new FirefoxDriver();
drv.get("https://google.com");
drv.get("https://google.com");
}
@ After
@ After
public void tearDown() throws Exception {
public void tearDown() throws Exception {
drv.quit();
drv.quit();
}
@ Test
@ Test
public void test() throws IOException {
public void test() throws IOException {
// Capture the screenshot
// 捕获截图
File scrFile = ((TakeScreenshot)drv).getScreenshotAs(OutputType.FILE);
File scrFile = ((TakeScreenshot)drv).getScreenshotAs(OutputType.FILE);
// Code for pasting screenshot to a user-specified location
// 将截图粘贴到用户指定位置的代码
FileUtils.copyFile(scrFile, new File("C:\Screenshot\Scr.jpg"))
FileUtils.copyFile(scrFile, new File("C:\Screenshot\Scr.jpg"))
}
}

769. Explain different types of framework and connection of Selenium with Robot Framework.

解释不同类型的框架以及Selenium与Robot Framework的连接方式。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4658d557c902bc7061 | 官方: 否 | 付费: 否

答案:

The following are the different types of frameworks: - Behavior-Driven Development Framework: This type of framework provides a readable and easily understandable format to Business Analysts, Developers, Testers, etc.

以下是不同类型的框架:- 行为驱动开发框架:这种类型的框架为业务分析师、开发人员、测试人员等提供了一种可读且易于理解的格式。
  • Data-Driven Testing Framework: This type of framework helps separate test data from the test-script logic by storing test data in some external database in the form of key-value pairs. These keys can be used for accessing as well as populating data into the test scripts.
  • Keyword-Driven Testing Framework: This type of framework is an extension of the data-driven testing framework. In addition to separating test data and the test-script logic, it also separates a part of the test script code by storing it in an external data file.
  • Library Architecture Testing Framework: This type of framework groups common steps into functions under a library and calls these functions as and when required.
  • Module-Based Testing Framework: This type of framework divides each test application into several isolated and logical modules, with each module having its distinct test script.
  • Hybrid Testing Framework: This type of framework is a combination of the above-mentioned frameworks leveraging all their good features.
    Robot Framework is a modular open-source automation framework that can interact with 3rd party libraries and functions. To execute a web testing library such as Selenium, a test automation runner or an automation wrapper is required, which is provided to it in the form of Robot Framework. Other popular test runners to serve the same purpose are MSTest, TestNG, Nunit, Junit, etc.

    Robot Framework是一个模块化的开源自动化框架,可以与第三方库和函数交互。要执行诸如Selenium之类的Web测试库,需要一个测试自动化运行器或自动化包装器,而这以Robot Framework的形式提供给它。其他用于相同目的的流行测试运行器包括MSTest、TestNG、Nunit、Junit等。

The below diagram shows the connection of the Robot framework to the Selenium library:

下图展示了Robot框架与Selenium库的连接方式:

770. Demonstrate usage of Selenium through a test application.

通过测试应用程序演示Selenium的用法。
  • 知识点: 测试 / 行为与软技能 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4658d557c902bc7064 | 官方: 否 | 付费: 否

答案:

You need the following prerequisites to run a demo Selenium test script: - Java SDK in your respective Operating System.

要运行演示Selenium测试脚本,您需要以下先决条件:- 在您各自的操作系统中安装Java SDK。
  • A Java-based IDE such as Eclipse or IntelliJ.
  • A Selenium WebDriver is to be added as a dependency to Java IDE.
    package scalerAcademy;

    package scalerAcademy;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.firefox.FirefoxDriver;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebDriver;
    public class MyFirstTestClass {
    public class MyFirstTestClass {
    public static void main(String[] args) throws InterruptedException {
    public static void main(String[] args) throws InterruptedException {
    //It sets the system property to the given value.
    //它将系统属性设置为给定值。
    System.setProperty("webdriver.gecko.driver","D:\Softwares\geckodriver.exe”);
    System.setProperty("webdriver.gecko.driver","D:\Softwares\geckodriver.exe”);
    WebDriver driver = new FirefoxDriver();
    WebDriver driver = new FirefoxDriver();
    driver.get("https://www.google.com/");
    driver.get("https://www.google.com/");
    //Launch website in the browser
    //在浏览器中启动网站
    driver.manage().window().maximize();
    driver.manage().window().maximize();
    //The sleep pauses the execution of the thread for 5000 ms.
    //休眠会暂停线程的执行5000毫秒。
    Thread.sleep(5000);
    Thread.sleep(5000);
    driver.quit();
    driver.quit();
    }
    }

Once you run the above script in a Java IDE, you’ll get the following execution logs displayed in your IDE window.

一旦你在Java IDE中运行上述脚本,你将在IDE窗口中看到以下执行日志。

771. Explain basic steps of Selenium testing and its widely used commands via a practical application.

通过一个实际应用,解释Selenium测试的基本步骤及其广泛使用的命令。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4658d557c902bc7067 | 官方: 否 | 付费: 否

答案:

Selenium testing can be divided into the following seven basic elements:

Selenium测试可以分为以下七个基本要素:
  • Creating an instance of a Webdriver : This is the first step for all the usages of a Selenium webdriver API. An instance of a webdriver interface is created using a constructor of a particular browser. This webdriver instance is used to invoke methods and access other interfaces. The following are the most commonly used commands for initializing a web driver:

Firefox:

Firefox:
WebDriver driver = new FirefoxDriver();
WebDriver driver = new FirefoxDriver();
Chrome:
Chrome:
WebDriver driver = new ChromeDriver();
WebDriver driver = new ChromeDriver();
Safari Driver:
Safari驱动程序:
WebDriver driver = new SafariDriver();
WebDriver driver = new SafariDriver();
Internet Explorer:
Internet Explorer:
WebDriver driver = new InternetExplorerDriver();
WebDriver driver = new InternetExplorerDriver();
  • Navigating to a webpage: The second step after initializing an instance of a webdriver, is to navigate to a particular webpage you want to test. The following are the most commonly used commands for webpage navigation:

Navigate to URL:

导航到URL:
driver.get(“https://www.interviewbit.com”)
driver.get(“https://www.interviewbit.com”)
driver.navigateo.to(“https://www.interviewbit.com”)
driver.navigateo.to(“https://www.interviewbit.com”)
Refresh page:
刷新页面:
driver.navigate().refresh()
driver.navigate().refresh()
Navigate forward in browser history:
在浏览器历史记录中向前导航:
driver.navigate().forward()
driver.navigate().forward()
Navigate backward in browser history:
在浏览器历史记录中向后导航:
driver.navigate().backward()
driver.navigate().backward()
  • Locating an HTML element on the webpage: To interact with a web element and perform actions on it like clicking a button or entering text, we first need to locate the desired elements such as the button or the textbox on the web page. The following are the most commonly used commands for web element navigation:

Locating by ID:

通过ID定位:
driver.findElement(By.id("q")).sendKeys("Selenium 3");
driver.findElement(By.id("q")).sendKeys("Selenium 3");
Location by Name:
通过名称定位:
driver.findElement(By.name("q")).sendKeys ("Selenium 3");
driver.findElement(By.name("q")).sendKeys ("Selenium 3");
Location by Xpath:
通过Xpath定位:
driver.findElement(By.xpath("//input[@id==’q’])).sendKeys("Selenium 3");
driver.findElement(By.xpath("//input[@id==’q’])).sendKeys("Selenium 3");
Locating Hyperlinks by Link Text:
通过链接文本定位超链接:
driver.FindElement(By.LinkText("edit this page")).Click();
driver.FindElement(By.LinkText("edit this page")).Click();
Locating by ClassName
通过ClassName定位
driver.findElement(By.className("profileheader"));
driver.findElement(By.className("profileheader"));
Locating by TagName
通过TagName定位
driver.findElement(By.tagName("select')).click();
driver.findElement(By.tagName("select')).click();
Locating by LinkText
通过LinkText定位
driver.findElement(By.linkText("NextPage")).click();
driver.findElement(By.linkText("NextPage")).click();
Locating by PartialLinkText
通过部分链接文本定位
driverlindElement(By.partialLinkText(" NextP")).click();
driverlindElement(By.partialLinkText(" NextP")).click();
  • Performing actions on an HTML element: Once we have located the HTML element, the next step is interacting with it. The following are the most commonly used commands for performing actions on an HTML elements:

Entering a username

输入用户名
usernameElement.sendKeys("InterviewBit");
usernameElement.sendKeys("InterviewBit");
Entering a password
输入密码
passwordElement.sendKeys("Raw");
passwordElement.sendKeys("Raw");
Submitting a text input element
提交文本框元素
passwordElement.submit();
passwordElement.submit();
Submitting a form element:
提交表单元素:
formElement.submit();
formElement.submit();
  • Anticipating browser response from the action: Once an action is performed, anticipating a response from the browser to test comes under this step. It takes a second or two for the action to reach the browser, and hence wait is often required for this step. There are two main types of wait conditions:

Implicit Wait: It sets a fixed, definite time for all the webdriver interactions. It’s slightly unreliable as web driver response times are usually unpredictable. Eg:

隐式等待:它为所有WebDriver交互设置一个固定的、确定的时间。这有点不可靠,因为WebDriver响应时间通常是不可预测的。例如:
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Explicit Wait: This type of wait condition sets an expected condition to occur on the web page or a maximum wait time for all the webdriver interactions. Eg:
显式等待:这种等待条件设置了网页上预期要发生的事件,或为所有WebDriver交互设置了最长等待时间。例如:

WebElement messageElement = wait.until( ExpectedConditions.presenceOfElementLocated(By.id("loginResponse")) );

WebElement messageElement = wait.until( ExpectedConditions.presenceOfElementLocated(By.id("loginResponse")) );
  • Running tests and recording their results using a test framework: in this step, we run tests in an automated test script to evaluate an application's function and performance. Various test frameworks are used for this step, such as:
  1. JUnit for Java

    1. JUnit用于Java
  2. NUnit for C#

    1. NUnit用于C#
  3. Unittest or Pyunit for Python

    1. Python 的 Unittest 或 Pyunit
  4. RUnit for Ruby

    1. Ruby 的 RUnit
      Most frameworks use some sort of asset statement to verify their test results from the expected results. Eg:
      大多数框架使用某种断言语句来验证测试结果是否符合预期结果。例如:

assertEquals (expectedMessage, actualMessage);

assertEquals(预期消息, 实际消息);
  • Concluding a test: In this step, we conclude a test by invoking a quit method on the driver variable. This step closes all the webpages, quits the WebDriver server, and releases the driver. Eg:

driver.quit();

driver.quit();
The following is an example of an app that covers all the steps mentioned above:
以下是一个涵盖上述所有步骤的应用程序示例:

import org.openqa.selenium.By,

import org.openqa.selenium.By,
import org.openqa.selenium.WebElement,
import org.openqa.selenium.WebElement,
import org.openqa.selenium.support.ni.ExpectedConditiof, import org.openqa.selenium.support.ni.WebOriverWait,
import org.openqa.selenium.support.ni.ExpectedConditiof, import org.openqa.selenium.support.ni.WebOriverWait,
import org.junit.Assert;
import org.junit.Assert;
public class Example {
public class Example {
public static void main(String[] args) {
public static void main(String[] args) {
// Creating a driver instance
// 创建驱动程序实例
WebDriver driver = new FirefoxDriver(),
WebDriver driver = new FirefoxDriver(),
// Navigate to a web page
// 导航到网页
­driver.get("http://www.foo.com");
­driver.get("http://www.foo.com");
// Enter text to submit the form
// 输入文本以提交表单
WebElement usernameElement = driver.findElement( By.name("username"));
WebElement usernameElement = driver.findElement( By.name("username"));
WebElement passwordElement = driver.findElement(By.name(”password"));
WebElement passwordElement = driver.findElement(By.name(”password"));
WebElement formElement = driver.findElement(By.id(”loginForm"));
WebElement formElement = driver.findElement(By.id(”loginForm"));
usernameElement.sendKeys("Scaler Academy");
usernameElement.sendKeys("Scaler Academy");
passwordElement.sendKeys("Raw");
passwordElement.sendKeys("Raw");
formElement.submit(); // submit by form element
formElement.submit(); // 通过表单元素提交

//Putting an explicit wait

// 放置显式等待
WebDriverWait wait = new WebDriverWait(driver, 10);
WebDriverWait wait = new WebDriverWait(driver, 10);
WebElement messageElement = wait.until(
WebElement messageElement = wait.until(
ExpectedConditions.presenceofElementLocated(By.id(”loginResponse"))
ExpectedConditions.presenceofElementLocated(By.id(”loginResponse"))
) ;
// Run a test
// 运行一个测试
String message = messageElement.getrept();
String message = messageElement.getrept();
String successMsg = "Welcome to foo. You logged in successfully.”;
String successMsg = "Welcome to foo. You logged in successfully.”;
Assert.assertEquals (message, successMsg);
Assert.assertEquals (message, successMsg);
// Conclude a test
// 结束一个测试
driver.quit();
driver.quit();
}
}

772. What do you understand about the Page Object Model in the context of Selenium? What are its advantages?

关于Selenium中的Page Object Model,你了解什么?它的优点是什么?
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4658d557c902bc706a | 官方: 否 | 付费: 否

答案:

Page Object Model (POM) is a design pattern that generates an Object Repository for web UI elements and is widely used in test automation. The paradigm has the advantage of reducing code duplication and improving test maintenance. According to this paradigm, each web page in the application should have its own Page Class. This Page class will identify the web page's WebElements and also has Page methods that operate on those WebElements. The names of these methods should correspond to the tasks they perform, for example, if a loader is waiting for the payment gateway to appear, the POM method name could be waitForPaymentScreenDisplay() .

Page Object Model(POM)是一种为Web UI元素生成对象仓库的设计模式,广泛应用于测试自动化中。该范式具有减少代码重复和改善测试维护的优点。根据该范式,应用程序中的每个网页都应有自己的页面类。这个页面类将识别网页的WebElements,并包含对这些WebElements进行操作的页面方法。这些方法的名称应与其执行的任务相对应,例如,如果加载器在等待支付网关出现,POM方法名可以是waitForPaymentScreenDisplay()。

The following are the advantages of the Page Object Model (POM) : - According to the Page Object Design Pattern, user interface activities and flows should be separated from verification. Our code is clearer and easier to understand as a result of this notion.

以下是Page Object Model(POM)的优点:- 根据Page Object设计模式,用户界面活动和流程应与验证分离。由于这一理念,我们的代码更清晰、更易于理解。
  • The second advantage is that the object repository is independent of test cases, allowing us to reuse the same object repository with different tools. For example, we can use Selenium to combine Page Object Model with TestNG/JUnit for functional testing and JBehave/Cucumber for acceptability testing.
  • Because of the reusable page methods in the POM classes, code gets less and more efficient.
  • Methods are given more realistic names that can be easily associated with the UI operation. If we land on the home page after clicking the button, the function name will be 'gotoHomePage()'.

773. What is Jenkins and what are the benefits of using it with Selenium?

什么是Jenkins?它与Selenium一起使用有什么好处?
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4758d557c902bc706d | 官方: 否 | 付费: 否

答案:

Hudson Lab's Jenkins is the most popular open-source continuous integration technology. It's cross-platform, meaning it can run on Windows, Linux, Mac OS, and Solaris. Jenkins is a Java application. Jenkin's main purpose is to keep track of any job, such as SVN (Apache Subversion) checkouts, cron jobs, or application states. When a specific event in an application occurs, it triggers pre-configured actions. Learn More .

Hudson Lab的Jenkins是最流行的开源持续集成技术。它是跨平台的,意味着它可以在Windows、Linux、Mac OS和Solaris上运行。Jenkins是一个Java应用程序。Jenkins的主要目的是跟踪任何任务,例如SVN(Apache Subversion)检出、cron作业或应用程序状态。当应用程序中的特定事件发生时,它会触发预配置的操作。了解更多。

The following are the features of Jenkins : - Jenkins generates a list of all changes made in SVN repositories, for example.

以下是Jenkins的特性:- 例如,Jenkins会生成SVN仓库中所有更改的列表。
  • Jenkins gives permanent links to the most recent build or failed build, which can be utilized for convenient communication.
  • Jenkins is simple to install using either a direct installation file (exe) or a war file for deployment via the application server.
  • Jenkins can be set up to send the content of the build status to an email address.
  • Simple Configuration: Jenkins makes it simple to set up multiple tasks.
  • Jenkins can be configured to run the automated test build on TestNg following every SVN build.
  • Jenkins documents the details of the jar, its version, and the mapping of build and jar numbers.
  • Plugins: Jenkins can be set to utilize features and additional functionality provided by third-party plugins.
    Following are the reasons we use Jenkins with Selenium : - When you run Selenium tests in Jenkins, you can run them every time your program changes, and when the tests pass, you may deploy the software to a new environment.

    以下是我们将Jenkins与Selenium一起使用的原因:- 当你在Jenkins中运行Selenium测试时,你可以在程序每次更改时运行它们,当测试通过时,你可以将软件部署到新环境中。
  • Jenkins may execute your tests at a predetermined time.
  • The execution history as well as the Test Reports can be saved.
  • Jenkins allows you to develop and test a project in continuous integration using Maven.

774. How will you select a date from a datepicker in a webpage using Selenium for automated testing? Explain with a proper code.

你如何在使用Selenium进行自动化测试时,从网页上的datepicker中选择日期?请用合适的代码解释。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4758d557c902bc7070 | 官方: 否 | 付费: 否

答案:

In such types of questions, the interviewer wants to assess how clear your understanding is of the framework. It is a good practice to explain the code while you write it so that the interviewer is engaged at all points and does not feel left out. We will be considering an example on MakeMyTrip.

在这类问题中,面试官想要评估你对框架的理解有多清晰。边写代码边解释是一个好做法,这样面试官在各个环节都能参与其中,不会感到被忽视。我们将以MakeMyTrip为例进行考虑。

Here, we will be using the chrome browser and so we will be implementing the code for the chrome browser only. You can implement similar code for firefox and other browsers as well.

这里,我们将使用Chrome浏览器,因此我们只为Chrome浏览器实现代码。你也可以为Firefox和其他浏览器实现类似的代码。

First of all, we create a package named browserSelection which contains a class defined for handling different types of browsers such as chrome, firefox that we may want to use.

首先,我们创建一个名为browserSelection的包,其中包含一个用于处理不同类型的浏览器(如我们可能想要使用的Chrome、Firefox)的类。

package browserSelection;

package browserSelection;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class SelectBrowser
public class SelectBrowser
{
static WebDriver driver;
static WebDriver driver;
public static WebDriver useChrome()
public static WebDriver useChrome()
{
System.setProperty("webdriver.chrome.driver", "E:\SeleniumLibs\\chromedriver_win32\chromedriver.exe");
System.setProperty("webdriver.chrome.driver", "E:\SeleniumLibs\\chromedriver_win32\chromedriver.exe");
driver = new ChromeDriver();
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().window().maximize();
return driver;
return driver;
}
}
Next, we create a package named datepicker which will contain a class containing methods defined for selecting a specific date on the website of MakeMyTrip. We need to import this package into our driver class and call the respective methods.
接下来,我们创建一个名为 datepicker 的包,其中包含一个类,该类定义了在 MakeMyTrip 网站上选择特定日期的方法。我们需要将此包导入到我们的驱动程序类中,并调用相应的方法。

package datepicker;

package datepicker;
import java.awt.AWTException;
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.Robot;
import java.awt.event.KeyEvent;
import java.awt.event.KeyEvent;
import java.util.List;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebDriverException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.WebElement;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.testng.annotations.Test;
import browserSelection.SelectBrowser;
import browserSelection.SelectBrowser;
public class DatePick
public class DatePick
{
WebDriver driver;
WebDriver driver;
@BeforeMethod
@BeforeMethod
public void startBrowser()
public void startBrowser()
{
driver = SelectBrowser.useChrome();
driver = SelectBrowser.useChrome();
}
@Test
@Test
public void selectDateUtil() throws InterruptedException, AWTException
public void selectDateUtil() throws InterruptedException, AWTException
{
//Modify Wait time as per the Network Ability in the Thread Sleep method
//根据网络能力在Thread Sleep方法中调整等待时间
driver.get("https://www.makemytrip.com/");
driver.get("https://www.makemytrip.com/");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
Thread.sleep(5000);
Thread.sleep(5000);
try
try
{
driver.findElement(By.xpath("//input[@id='hp-widget__depart']")).click();
driver.findElement(By.xpath("//input[@id='hp-widget__depart']")).click();
Thread.sleep(2000);
线程.睡眠(2000);
Date sampleDate = new Date(); // initialising the date object with the current date
Date sampleDate = new Date(); // 使用当前日期初始化日期对象
SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM yyyy");
SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM yyyy");
String date = formatter.format(sampleDate); // formatting the date object in dd-MMM yyyy format
String date = formatter.format(sampleDate); // 以dd-MMM yyyy格式格式化日期对象
String splitter[] = date.split("-");
String splitter[] = date.split("-");
String monthYear = splitter[1]; // storing the month and year concatenated string excluding the day number
String monthYear = splitter[1]; // 存储不含日号的月份和年份拼接字符串
String day = splitter[0]; // storing the day number in the current date
String day = splitter[0]; // 存储当前日期中的日号
System.out.println(monthYear);
System.out.println(monthYear);
System.out.println(day);
System.out.println(day);

selectDate(monthYear,day); // function invocation

selectDate(monthYear,day); // 函数调用
Thread.sleep(3000);
Thread.sleep(3000);

public void selectDate(String monthYear, String select_day) throws InterruptedException

public void selectDate(String monthYear, String select_day) throws InterruptedException
{
List elements = driver.findElements(By.xpath("//div[@class='ui-datepicker-title']/span[1]"));
List elements = driver.findElements(By.xpath("//div[@class='ui-datepicker-title']/span[1]"));
for (int i=0; i<elements.size();i++)
for (int i=0; i<elements.size();i++)
{
System.out.println(elements.get(i).getText());
System.out.println(elements.get(i).getText());
//Selecting the month
//选择月份
if(elements.get(i).getText().equals(monthYear))
if(elements.get(i).getText().equals(monthYear))
{
//Selecting the date
//选择日期
List days = driver.findElements(By.xpath("//div[@class='ui-datepicker-inline ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-datepicker-multi ui-datepicker-multi-2']/div[2]/table/tbody/tr/td/a"));
List days = driver.findElements(By.xpath("//div[@class='ui-datepicker-inline ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-datepicker-multi ui-datepicker-multi-2']/div[2]/table/tbody/tr/td/a"));
for (WebElement d:days)
for (WebElement d:days)
{
System.out.println(d.getText());
System.out.println(d.getText());
if(d.getText().equals(select_day))
if(d.getText().equals(select_day))
{
d.click();
d.click();
Thread.sleep(10000);
Thread.sleep(10000);
return;
return;
}
}
}
}
// if we do not find the matching month and year, we click on the arrow button to load new months.
// 如果我们找不到匹配的月份和年份,就点击箭头按钮以加载新的月份。
driver.findElement(By.xpath("//div[@class='ui-datepicker-inline ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-datepicker-multi ui-datepicker-multi-2']/div[2]/div/a/span")).click();
driver.findElement(By.xpath("//div[@class='ui-datepicker-inline ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-datepicker-multi ui-datepicker-multi-2']/div[2]/div/a/span")).click();
selectDate(monthYear,select_day); // function invocation
selectDate(monthYear,select_day); // 函数调用
}
@AfterMethod
@AfterMethod
public void endBrowser()
public void endBrowser()
{
driver.quit();
driver.quit();
}
}
}
}
In the above code, the function startBrowser() is used to invoke the useChrome() method from the imported package browserSelection. The function selectDateUtil() is used to select the current date from the date picker of the sample web page. The endBrowser() function is used to close the driver connections by invoking the quit() method.
在上述代码中,函数startBrowser()用于从导入的包browserSelection中调用useChrome()方法。函数selectDateUtil()用于从示例网页的日期选择器中选择当前日期。函数endBrowser()用于通过调用quit()方法关闭驱动程序连接。

775. What do you understand about broken links? How can you detect broken links in Selenium? Explain properly with code.

你对失效链接有何理解?如何在Selenium中检测失效链接?请用代码正确解释。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4758d557c902bc7073 | 官方: 否 | 付费: 否

答案:

Links or URLs that are not reachable are known as broken links. They may be unavailable or inoperable due to a server issue. A URL's status will always be 2xx, indicating that it is legitimate. There are a variety of HTTP status codes, each with its own set of functions. HTTP status 4xx and 5xx indicate an invalid request. The 4xx class of status codes is used for client-side errors, while the 5xx class is used for server response errors.

无法访问的链接或URL被称为失效链接。它们可能因服务器问题而不可用或无法操作。URL的状态码通常为2xx,表示其合法。HTTP状态码有多种,每种都有各自的功能。HTTP状态码4xx和5xx表示无效请求。4xx类状态码用于客户端错误,而5xx类用于服务器响应错误。

You should always check for broken links on your site to ensure that the user does not end up on an error page. If the rules aren't updated appropriately, or the requested resources aren't available on the server, the error will occur. Manual link checking is a time-consuming task because each web page may have a huge number of links, and the process must be performed for each page.

你应该始终检查网站上的失效链接,以确保用户不会最终进入错误页面。如果规则未适当更新,或请求的资源在服务器上不可用,就会出现错误。手动检查链接是一项耗时任务,因为每个网页可能有大量链接,并且必须对每个页面执行该过程。

To find broken links in Selenium, follow the instructions below. - Using the (anchor) tag, collect all of the links on a web page.

要在Selenium中查找失效链接,请按照以下说明操作。- 使用(锚点)标签收集网页上的所有链接。
  • For each link, send an HTTP request.
  • Make that the HTTP response code is correct.
  • Based on the HTTP response code, determine whether the link is genuine or not.
  • Repeat the procedure for all of the links that were captured in the first step.
    package SeleniumPackage;

    package SeleniumPackage;
    import java.io.IOException;
    import java.io.IOException;
    import java.net.HttpURLConnection;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.net.URL;
    import java.util.Iterator;
    import java.util.Iterator;
    import java.util.List;
    import java.util.List;
    import org.openqa.selenium.By;
    import org.openqa.selenium.By;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.openqa.selenium.chrome.ChromeOptions;
    import org.openqa.selenium.chrome.ChromeOptions;
    public class BrokenLinks {
    public class BrokenLinks {

public static void main(String[] args) {

public static void main(String[] args) {

String pageURL = "http://www.interviewbit.com";

String pageURL = "http://www.interviewbit.com";
String url = "";
String url = "";
HttpURLConnection huc = null;
HttpURLConnection huc = null;
int responseCode = 200;
int responseCode = 200;
System.setProperty("webdriver.chrome.driver", "C:\Users\user\Downloads\selenium\chromedriver_win32\chromedriver.exe");
System.setProperty("webdriver.chrome.driver", "C:\Users\user\Downloads\selenium\chromedriver_win32\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
ChromeOptions options = new ChromeOptions();
options.addArguments("--headless", "--disable-gpu", "--window-size=1920,1200","--ignore-certificate-errors", "--silent");
options.addArguments("--headless", "--disable-gpu", "--window-size=1920,1200","--ignore-certificate-errors", "--silent");
WebDriver driver = new ChromeDriver(options);//Creating an instance of the WebDriver class
WebDriver driver = new ChromeDriver(options);//创建WebDriver类的实例

driver.manage().window().maximize();

driver.manage().window().maximize();

driver.get(pageURL);

driver.get(pageURL);

List links = driver.findElements(By.tagName("a")); // getting hold of all the elements having the anchor tag

List links = driver.findElements(By.tagName("a")); // 获取所有具有锚标签的元素

Iterator it = links.iterator();

Iterator it = links.iterator();
// Iterating over the obtained list of elements and checking them one by one
// 遍历获取的元素列表,并逐一检查它们
while(it.hasNext()){
while(it.hasNext()){

url = it.next().getAttribute("href");

url = it.next().getAttribute("href");

System.out.println(url);

System.out.println(url);

if(url == null || url.isEmpty()){

if(url == null || url.isEmpty()){
System.out.println("The linked element has invalid href url.");
System.out.println("链接元素包含无效的href URL。");
continue;
continue;
}

if(!url.startsWith(pageURL)){

if(!url.startsWith(pageURL)){
System.out.println("URL belongs to another domain, skipping it.");
System.out.println("URL属于另一个域,跳过它。");
continue;
continue;
}

try {

try {
huc = (HttpURLConnection)(new URL(url).openConnection());
huc = (HttpURLConnection)(new URL(url).openConnection());

huc.setRequestMethod("HEAD");

huc.setRequestMethod("HEAD");

huc.connect(); // connecting to the url

huc.connect(); // 连接到url

responseCode = huc.getResponseCode(); // reading the response code on firing the url

responseCode = huc.getResponseCode(); // 读取触发url时收到的响应代码

if(responseCode >= 400){

if(responseCode >= 400){
System.out.println(url+" is a broken link");
System.out.println(url+" 是一个损坏的链接");
}
else{
否则{
System.out.println(url+" is a valid link");
System.out.println(url+" 是一个有效的链接");
}

} catch (MalformedURLException e) {

} catch (MalformedURLException e) {
e.printStackTrace();
e.printStackTrace();
} catch (IOException e) {
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace();
}
}

driver.quit();

driver.quit();
}
}

Explanation - In the above code, we first set up the system properties and then initialize a webdriver object. We find all the elements in the web page having the anchor tag with the help of the findElements() method. Then, we iterate over the list obtained one by one and fire up the URL and read the response code received to check if it is a broken link or not.

解释 - 在上述代码中,我们首先设置系统属性,然后初始化一个webdriver对象。我们借助findElements()方法查找网页中所有带锚标签的元素。然后,我们逐一遍历获得的列表,触发URL并读取收到的响应代码,以检查它是否是损坏的链接。

776. What do you understand about window handle in the context of automated testing? How can you handle multiple windows in Selenium?

在自动化测试的语境下,你对窗口句柄有何理解?在 Selenium 中如何管理多个窗口?
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4758d557c902bc7076 | 官方: 否 | 付费: 否

答案:

The window handle is a one-of-a-kind identifier that contains the addresses of all of the windows. Consider it a window pointer that returns the string value. Each browser will presumably have its own window handle. This window handle function aids in the retrieval of all window handles. Syntax: - get.windowhandle(): This function is used to retrieve the current window's handle.

窗口句柄是一种独一无二的标识符,其中包含所有窗口的地址。可以将其视为一个返回字符串值的窗口指针。每个浏览器大概都有自己的窗口句柄。此窗口句柄函数有助于获取所有窗口的句柄。语法:get.windowhandle():此函数用于获取当前窗口的句柄。
  • get.windowhandles(): This function is useful for retrieving the handles of all the windows that have been opened.
  • set: This method allows you to set the window handles as a string. set set= driver.get.windowhandles()
  • switch to: This method aids in the switching of windows.
  • action: This method aids in the execution of specific window actions.
    Let us consider an example code to understand better. We will open the website of InterviewBit and then click on all the links available on the web page. Then, we will switch from the parent window to multiple different child windows and then switch back to the parent window at last.

    让我们考虑一个示例代码,以便更好地理解。我们将打开 InterviewBit 的网站,然后点击网页上所有可用的链接。随后,我们将从父窗口切换到多个不同的子窗口,最后再切换回父窗口。

package SeleniumPackage;

package SeleniumPackage;
import java.util.Iterator;
import java.util.Iterator;
import java.util.Set;
import java.util.Set;
import org.openqa.selenium.By;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class WindowHandle_Demo {
public class WindowHandle_Demo {
public static void main(String[] args) throws Exception {
public static void main(String[] args) throws Exception {

System.setProperty("webdriver.chrome.driver", "C:\Users\user\Downloads\selenium\chromedriver_win32\chromedriver.exe");

System.setProperty("webdriver.chrome.driver", "C:\Users\user\Downloads\selenium\chromedriver_win32\chromedriver.exe");
WebDriver driver = new ChromeDriver();
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().window().maximize();
// Loading the website
// 加载网站
driver.get("http://www.interviewbit.com/");
driver.get("http://www.interviewbit.com/");
String parent=driver.getWindowHandle(); // storing the parent window name as a string
String parent=driver.getWindowHandle(); // 将父窗口名称存储为字符串
List links = driver.findElements(By.tagName("a")); // storing the list of all the elements having an anchor tag
List links = driver.findElements(By.tagName("a")); // 存储所有具有锚标签的元素的列表
Iterator it = links.iterator();
Iterator it = links.iterator();
// Iterating over the list elements one by one and clicking all the links to open new child windows
// 逐一迭代列表中的元素并点击所有链接以打开新的子窗口
while(it.hasNext()){
while(it.hasNext()){
it.next().click();
it.next().click();
}
Set s = driver.getWindowHandles(); // Storing the list of all the child windows
Set s = driver.getWindowHandles(); // 存储所有子窗口的列表
Iterator I1= s.iterator();
Iterator I1= s.iterator();
// Iterating over the list of child windows
// 迭代子窗口列表
while(I1.hasNext())
while(I1.hasNext())
{
String child_window=I1.next();
String child_window=I1.next();
if(!parent.equals(child_window))
if(!parent.equals(child_window))
{
driver.switchTo().window(child_window);
driver.switchTo().window(child_window);
System.out.println(driver.switchTo().window(child_window).getTitle());
System.out.println(driver.switchTo().window(child_window).getTitle());
driver.close();
driver.close();
}
}
//switch to the parent window
//切换到父窗口
driver.switchTo().window(parent);
driver.switchTo().window(parent);
}
}
In the above code, we open the landing page of interviewbit and then find all the elements having the anchor tag and click them to open multiple child windows. Then, we iterate over each of the child windows and print them as a string. Finally, having traversed over the entire list, we break from the loop and switch back to the parent window.
在上述代码中,我们打开了interviewbit的登录页面,然后找到所有带有锚标签的元素并点击它们以打开多个子窗口。接着,我们遍历每个子窗口并将它们作为字符串打印出来。最后,遍历完整个列表后,我们跳出循环并切换回父窗口。

777. What are the new features introduced in Selenium 4? How is it different from Selenium 3?

Selenium 4中引入了哪些新特性?它与Selenium 3有何不同?
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4858d557c902bc713d | 官方: 否 | 付费: 否

答案:

Selenium 4 introduced architectural and API-level improvements aligned with modern browser standards.

Selenium 4引入了与现代浏览器标准一致的架构和API级别的改进。
  • W3C WebDriver Protocol (Standardization)

Selenium 4 fully adopts the W3C WebDriver Protocol and removes the legacy JSON Wire Protocol.

Selenium 4完全采用W3C WebDriver协议,并移除了旧的JSON Wire协议。
In Selenium 3: - Commands were converted between JSON Wire and W3C format.
在Selenium 3中:- 命令在JSON Wire和W3C格式之间进行转换。
  • Extra encoding/decoding caused inconsistencies.
    In Selenium 4: - Direct communication with browsers using W3C standard.

    在Selenium 4中:- 使用W3C标准与浏览器直接通信。
  • Better cross-browser compatibility.
  • Reduced protocol-level failures.
  • Relative Locators
    Selenium 4 introduced spatial element location strategies.

    Selenium 4引入了空间元素定位策略。

Example:

示例:

WebElement emailField = driver.findElement(By.id("email"));

WebElement emailField = driver.findElement(By.id("email"));

WebElement passwordField = driver.findElement(

WebElement passwordField = driver.findElement(
RelativeLocator.with(By.tagName("input"))
RelativeLocator.with(By.tagName("input"))
.below(emailField)
.below(emailField)
);
Supported methods: - above(element)
支持的方法:- 位于元素上方(element)
  • below(element)
  • toLeftOf(element)
  • toRightOf(element)
  • near(element, distance)
    These are useful when elements do not have unique IDs. 3. Chrome DevTools Protocol (CDP) Integration

    当元素没有唯一ID时,这些方法非常有用。3. Chrome DevTools协议(CDP)集成

Selenium 4 provides direct access to Chrome DevTools Protocol for advanced browser control.

Selenium 4提供了对Chrome DevTools协议的直接访问,以实现高级浏览器控制。

Use cases: - Network interception

用例:- 网络拦截
  • Performance monitoring
  • Console log capture
  • Geolocation emulation
  • New Window/Tab API
    Selenium 4 introduced a clean API for opening new tabs or windows:

    Selenium 4引入了一个用于打开新标签页或窗口的简洁API:

driver.switchTo().newWindow(WindowType.TAB);

driver.switchTo().newWindow(WindowType.TAB);

driver.get("https://example.com");

driver.get("https://example.com");

This removes the need for manual window handle management when opening new tabs.

这消除了打开新标签页时手动管理窗口句柄的需要。
  • Selenium Grid 4 (Rewritten Architecture)

Grid 4 was completely redesigned.

Grid 4 被完全重新设计了。
Key improvements: - Better distributed execution
关键改进:- 更好的分布式执行
  • Docker support
  • GraphQL support
  • Improved UI
  • Selenium Manager (4.6+)
    Built-in driver management tool that automatically downloads and configures browser drivers.

    内置驱动管理工具,可自动下载和配置浏览器驱动程序。

Selenium 3 vs Selenium 4

Selenium 3 与 Selenium 4 对比
Feature
特性
Selenium 3Selenium 4
Protocol
协议
JSON Wire + W3CW3C only
仅 W3C
Relative Locators
相对定位器
Not available
不可用
Available
可用
CDP Support
CDP 支持
Limited
有限
Built-in
内置
GridLegacy architecture
旧架构
Fully rewritten
完全重写
Driver Management
驱动管理
Manual / WebDriverManager
手动 / WebDriverManager
Selenium Manager

778. How do you handle Shadow DOM elements in Selenium?

如何在 Selenium 中处理影子 DOM 元素?
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4858d557c902bc7140 | 官方: 否 | 付费: 否

答案:

Shadow DOM encapsulates elements inside a shadow root, preventing direct access using standard locators.

影子 DOM 将元素封装在影子根内部,阻止使用标准定位器直接访问。

Normal locators like:

像这样的一般定位器:

driver.findElement(By.id("inner"));

driver.findElement(By.id("inner"));
will not work if the element is inside a shadow root.
如果元素位于影子根内部,将无法生效。

Selenium 4 Approach

Selenium 4 方法

WebElement shadowHost = driver.findElement(By.cssSelector("#host"));

WebElement shadowHost = driver.findElement(By.cssSelector("#host"));
SearchContext shadowRoot = shadowHost.getShadowRoot();
SearchContext shadowRoot = shadowHost.getShadowRoot();
WebElement innerElement = shadowRoot.findElement(
WebElement innerElement = shadowRoot.findElement(
By.cssSelector("#inner-element")
By.cssSelector("#inner-element")
);
The getShadowRoot() method allows access to open shadow DOM elements.
getShadowRoot()方法允许访问开放的shadow DOM元素。

Open vs Closed Shadow DOM - Open Shadow DOM -> Accessible using getShadowRoot()

开放与封闭的Shadow DOM - 开放Shadow DOM -> 可使用getShadowRoot()访问
  • Closed Shadow DOM -> Not directly accessible via WebDriver
    Nested Shadow Roots

    嵌套的Shadow根节点

If shadow DOM is nested, access must be chained:

如果shadow DOM是嵌套的,访问必须链式进行:
  1. Locate first shadow host 2. Get shadow root 3. Locate next shadow host inside 4. Repeat process

    1. 定位第一个shadow宿主 2. 获取shadow根节点 3. 在内部定位下一个shadow宿主 4. 重复该过程

Selenium 3 Workaround - JavaScript

Selenium 3的替代方案 - JavaScript

JavascriptExecutor js = (JavascriptExecutor) driver;

JavascriptExecutor js = (JavascriptExecutor) driver;
WebElement shadowRoot = (WebElement) js.executeScript(
WebElement shadowRoot = (WebElement) js.executeScript(
"return arguments[0].shadowRoot",
"return arguments[0].shadowRoot",
shadowHost
shadowHost
);
Shadow DOM is commonly found in Angular, Salesforce, and Polymer-based applications.
Shadow DOM常见于基于Angular、Salesforce和Polymer的应用中。

779. What is the Chrome DevTools Protocol (CDP) in Selenium 4? How do you use it for network interception?

什么是Selenium 4中的Chrome DevTools协议(CDP)?如何使用它进行网络拦截?
  • 知识点: 测试 / 行为与软技能 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4858d557c902bc7143 | 官方: 否 | 付费: 否

答案:

Chrome DevTools Protocol allows direct interaction with Chrome beyond standard WebDriver capabilities.

Chrome DevTools协议允许超越标准WebDriver能力与Chrome直接交互。

It enables advanced operations such as: - Network request interception

它支持高级操作,例如: - 网络请求拦截
  • Blocking URLs
  • Capturing console logs
  • Simulating network conditions
  • Geolocation spoofing
    Basic CDP Setup - Java

    基础 CDP 设置 - Java

ChromeDriver driver = new ChromeDriver();

ChromeDriver driver = new ChromeDriver();
DevTools devTools = driver.getDevTools();
DevTools devTools = driver.getDevTools();
devTools.createSession();
devTools.createSession();
devTools.send(Network.enable(Optional.empty(), Optional.empty(), Optional.empty()));
devTools.send(Network.enable(Optional.empty(), Optional.empty(), Optional.empty()));
devTools.addListener(Network.requestWillBeSent(),
devTools.addListener(Network.requestWillBeSent(),
request -> System.out.println(request.getRequest().getUrl())
request -> System.out.println(request.getRequest().getUrl())
);
Common Use Cases
常见使用场景
  • Network Interception
  • Monitor API calls
  • Validate request headers
  • Simulate Network Conditions

devTools.send(Network.emulateNetworkConditions(

devTools.send(Network.emulateNetworkConditions(
false,
false,

100,

20000,

10000,

Optional.empty()

Optional.empty()

));

  • Handle Basic Authentication

Inject credentials via CDP instead of handling browser popup.

通过 CDP 注入凭据,而不是处理浏览器弹窗。
CDP gives more control compared to traditional WebDriver actions.
与传统 WebDriver 操作相比,CDP 提供了更多控制。

780. What are Relative Locators in Selenium 4? Provide examples for each type.

Selenium 4 中的相对定位器是什么?为每种类型提供示例。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4858d557c902bc7146 | 官方: 否 | 付费: 否

答案:

Relative Locators identify elements based on visual position relative to another element.

相对定位器根据元素相对于另一个元素的视觉位置来识别元素。

Java example:

Java 示例:

WebElement usernameLabel = driver.findElement(By.id("usernameLabel"))

WebElement usernameLabel = driver.findElement(By.id("usernameLabel"))
WebElement inputField = driver.findElement(
WebElement inputField = driver.findElement(
RelativeLocator.with(By.tagName("input"))
RelativeLocator.with(By.tagName("input"))
.below(usernameLabel)
.below(usernameLabel)
);
Types of Relative Locators
相对定位器的类型
  1. above(element) 2. below(element) 3. toLeftOf(element) 4. toRightOf(element) 5. near(element, distance)

    1. above(element) 2. below(element) 3. toLeftOf(element) 4. toRightOf(element) 5. near(element, distance)

Example:

示例:

driver.findElement(

driver.findElement(
RelativeLocator.with(By.tagName("button"))
RelativeLocator.with(By.tagName("button"))
.toRightOf(cancelButton)
.toRightOf(cancelButton)
);
When to Use - Forms without unique identifiers
使用场景 - 没有唯一标识符的表单
  • Table cells relative to headers
  • Layout-driven UI validation
    Limitations - Based on rendered position, not DOM structure

    局限性 - 基于渲染位置,而非DOM结构
  • May break if UI layout changes

781. What is Selenium Manager? How does it simplify browser driver management?

什么是Selenium Manager?它如何简化浏览器驱动管理?
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4858d557c902bc7149 | 官方: 否 | 付费: 否

答案:

Selenium Manager was introduced in Selenium 4.6+ to automate driver management.

Selenium Manager 在Selenium 4.6+中引入,用于自动化驱动管理。

Previously: - Drivers had to be manually downloaded.

之前: - 驱动必须手动下载。
  • PATH variables needed configuration.
  • External tools like WebDriverManager were required.
    With Selenium Manager:

    使用Selenium Manager:
  1. Selenium checks if driver exists locally. 2. If not, it detects installed browser version. 3. Downloads the correct driver automatically.

    1. Selenium检查本地是否存在驱动。 2. 如果不存在,则检测已安装的浏览器版本。 3. 自动下载正确的驱动。

Caches it locally (e.g., ~/.cache/selenium).

在本地缓存它(例如,~/.cache/selenium)。

No manual setup is required.

无需手动设置。

It also supports Chrome-for-Testing and can download browser binaries if missing.

它还支持Chrome-for-Testing,并在缺少浏览器二进制文件时自动下载。

When Manual Management Is Still Needed - Corporate proxy restrictions

何时仍需手动管理 - 企业代理限制
  • Air-gapped environments
  • Custom browser builds

782. How do you handle dynamic web tables in Selenium? Write the approach for extracting and validating table data.

如何处理Selenium中的动态网页表格?写出提取和验证表格数据的方法。
  • 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c4858d557c902bc714c | 官方: 否 | 付费: 否

答案:

Dynamic tables often load data via AJAX. The number of rows may change between executions.

动态表格通常通过AJAX加载数据。执行过程中行数可能会变化。

Step 1: Wait for Table to Load

步骤1:等待表格加载

WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));

WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
wait.until(ExpectedConditions.visibilityOfElementLocated(
wait.until(ExpectedConditions.visibilityOfElementLocated(
By.xpath("//table[@id='data']//tbody/tr")
By.xpath("//table[@id='data']//tbody/tr")
));
Step 2: Fetch All Rows
步骤2:获取所有行

List rows = driver.findElements(

List rows = driver.findElements(

By.xpath("//table[@id='data']//tbody/tr")

By.xpath("//table[@id='data']//tbody/tr")

);

Step 3: Iterate Through Cells

步骤3:遍历单元格

for (WebElement row : rows) {

for (WebElement row : rows) {

List cells = row.findElements(By.tagName("td"));

List cells = row.findElements(By.tagName("td"));

for (WebElement cell : cells) {

for (WebElement cell : cells) {

System.out.println(cell.getText());

System.out.println(cell.getText());

}

}

Building a Data Structure

构建数据结构

Map header to cell values: - Read header row

将表头映射到单元格值:- 读取表头行
  • Store header names in list
  • For each row, create Map
    Handling Pagination

    处理分页
  1. Click "Next" button. 2. Wait for table refresh. 3. Re-fetch rows. 4. Continue until no pages remain.

    1. 点击“下一页”按钮。 2. 等待表格刷新。 3. 重新获取行。 4. 继续操作,直到没有剩余页面。

Sorting Validation

排序验证
  1. Click column header. 2. Capture column values. 3. Compare with sorted copy of list.

    1. 点击列标题。 2. 捕获列值。 3. 与列表的排序副本进行比较。

Handling Lazy-Loaded Tables

处理懒加载表格

If rows load on scroll:

如果行在滚动时加载:

((JavascriptExecutor)driver).executeScript("arguments[0].scrollIntoView(true);", tableElement);

((JavascriptExecutor)driver).executeScript("arguments[0].scrollIntoView(true);", tableElement);

Dynamic tables require: - Proper waits

动态表格需要:- 适当的等待
  • Re-fetching elements after DOM refresh
  • Avoiding stale element references

783. Can we use SOAPUI to do API testing? If yes, then state the steps to do the same.

我们可以使用SOAPUI做API测试吗?如果可以,请说明执行步骤。
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc7749 | 官方: 否 | 付费: 否

答案:

Yes, we can use SOAPUI to do API testing. API testing includes both unit and integration testing of APIs. API testing is similar to software testing, however, it focuses on APIs. It assesses the API's functionality, dependability, performance, and security.

是的,我们可以使用SOAPUI做API测试。API测试包括API的单元测试和集成测试。API测试类似于软件测试,但侧重于API。它评估API的功能、可靠性、性能和安全性。

The SoapUI programme allows us to test SOAP and REST web services using the following steps: - Using SoapUI to test restful web services requires first developing test cases, after which the following actions can be followed.

SoapUI程序允许我们通过以下步骤测试SOAP和REST Web服务:- 使用SoapUI测试RESTful Web服务需要先开发测试用例,之后可以遵循以下操作。
  • The next step is to make a REST Request. By using the "Add to TestCase" button (found on the top left of the message editor) or the "Add to TestCase" action from the Request Popup Menu, TestStep can be added to a new or existing TestCase.
  • After that, you must include Assertions in order to validate the response message.

784. How can we use SoapUI to test web services?

我们如何使用SoapUI测试Web服务?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc774c | 官方: 否 | 付费: 否

答案:

A web service is a network-based service that allows other systems to communicate with it via a defined protocol. Using SoapUI to test restful web services requires first developing test cases, after which the same actions can be followed or the same steps can be followed, which are followed while testing any other API using SoapUI. Please refer to this link for the steps that need to be taken.

Web服务是一种基于网络的服务,允许其他系统通过定义的协议与之通信。使用SoapUI测试RESTful Web服务需要首先开发测试用例,之后可以遵循相同的操作或相同的步骤,这些步骤在使用SoapUI测试任何其他API时都会遵循。请参考此链接了解需要采取的步骤。

785. Can we do automation for the test cases using SoapUI? If yes, then how?

我们能否使用SoapUI对测试用例进行自动化?如果可以,如何进行?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc774f | 官方: 否 | 付费: 否

答案:

Yes, we can do automation for the test cases using SoapUI with the help of scripting. Scripts are used by SoapUI as follows: - With the help of Groovy Script Test Step in a Test Case.

是的,我们可以借助脚本使用SoapUI对测试用例进行自动化。SoapUI中脚本的使用方式如下:- 通过测试用例中的Groovy Script测试步骤。
  • The opening or closing of Project.
  • A Pre or post-execution of a Test Case or a Test Suite is used to do continuous tasks such as initialization or cleaning up memory.
  • Initializing or the stoppage of a MockService for initialization or memory clean up along with a lot of other related repetitive tasks.
  • SoapUI Pro provides us with scripting support for REST and SOAP tests using a single click.

786. How can we create and import Test Suite in SoapUI?

我们如何在SoapUI中创建和导入测试套件?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc7752 | 官方: 否 | 付费: 否

答案:

In order to create a Test Suite in SoapUI, we can use the menu which pop-ups in the project - "New Test Suite" or a particular button on top of the array of Test Suites. In order to import Test Suite in SoapUI, one of the following options can be chosen: - In File Menu -> Import Project option: For adding an existing project into the current workspace.

为了在SoapUI中创建测试套件,我们可以使用项目中弹出的菜单-"New Test Suite"或测试套件数组上方的特定按钮。为了在SoapUI中导入测试套件,可以选择以下选项之一:- 在File Menu -> Import Project选项中:用于将现有项目添加到当前工作区。
  • In File Menu -> Import Remote Project option: For importing a remote project into the current workspace.
  • In File Menu -> Import Preferences option: For importing SoapUI settings from another setting - file
  • In Icons Toolbar -> Import option: For importing an existing SoapUI project into the current workspace.

787. In SoapUI, how can we do the reading of data from excel spreadsheet using a Groovy Script?

在SoapUI中,我们如何使用Groovy Script从Excel电子表格中读取数据?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc7755 | 官方: 否 | 付费: 否

答案:

The DataSource and DataSource Loop functionalities are not present in the unpaid version of SoapUI. For the DataSource and DataSource Loop functionality, one can use the Ready API licensed version. One more way to read data from excel using the Groovy Script in SoapUI is as follows: - A library can be imported to SOAPUI for the management of the excel file - JXL.jar. We can download it from the following website- http://sourceforge.net/projects/jexcelapi/files/jexcelapi/2.6.12/jexcelapi_2_6_12.zip/download

DataSource和DataSource Loop功能在SoapUI的免费版本中不可用。对于DataSource和DataSource Loop功能,可以使用Ready API的许可版本。另一种在SoapUI中使用Groovy Script从Excel读取数据的方法如下:- 可以导入一个库到SOAPUI来管理Excel文件-JXL.jar。我们可以从以下网站下载它-http://sourceforge.net/projects/jexcelapi/files/jexcelapi/2.6.12/jexcelapi_2_6_12.zip/download
  • After that, the unzipping of the JAR file needs to be done followed by the copying of the JXL.jar file to the SOAPUI installation folder.

788. Write a Groovy Script to save request and response in SoapUI?

编写一个Groovy Script来保存SoapUI中的请求和响应?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc7758 | 官方: 否 | 付费: 否

答案:

A Groovy Script for saving a request and response in SoapUI is as follows:

一个用于在SoapUI中保存请求和响应的Groovy Script如下:

def projectName = context.currentStep.testCase.testSuite.project.name //getting the name of the project

def projectName = context.currentStep.testCase.testSuite.project.name //获取项目名称
def projectDate = new Date().format( 'yyyyMMdd' )//getting the current date
def projectDate = new Date().format( 'yyyyMMdd' )//获取当前日期
def stringDate = projectDate.toString()//converting the projectDate into string type
def stringDate = projectDate.toString()//将projectDate转换为字符串类型
def projectTestSuite = context.currentStep.testCase.testSuite.name//geting the Test Suite name of the project
def projectTestSuite = context.currentStep.testCase.testSuite.name//获取项目的测试套件名称
def projectTestCase = context.currentStep.testCase.name//getting the Test Case name of the project
def projectTestCase = context.currentStep.testCase.name//获取项目的测试用例名称
def filePath = 'C:/SoapUI Projects/TS0.1/TestEvidence/'+projectName+'_'+stringDate+'/'+projectTestSuite+'/'+projectTestCase+'/'//composing the path of the file
def filePath = 'C:/SoapUI Projects/TS0.1/TestEvidence/'+projectName+'_'+stringDate+'/'+projectTestSuite+'/'+projectTestCase+'/'//组成文件的路径
File file = new File(filePath)
File file = new File(filePath)
if (!file.exists()) file.mkdirs()//creating the destination folder
if (!file.exists()) file.mkdirs()//创建目标文件夹
fos = new FileOutputStream(filePath+ testStepResult.testStep.label + '.txt', true)
fos = new FileOutputStream(filePath+ testStepResult.testStep.label + '.txt', true)
pw = new PrintWriter(fos)
pw = new PrintWriter(fos)
testStepResult.writeTo(pw)
testStepResult.writeTo(pw)
pw.close()
pw.close()
fos.close()
fos.close()
A groovy event handler saves requests and responses for each test step, while a script below captures the requests and responses. 'TestRunListener.AfterStep' is the event handler.
一个 Groovy 事件处理器会保存每个测试步骤的请求和响应,而下面的脚本会捕获这些请求和响应。“TestRunListener.AfterStep”是该事件处理器。

789. How to stop a Groovy Script in SoapUI?

如何停止 SoapUI 中的 Groovy 脚本?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc775b | 官方: 否 | 付费: 否

答案:

For stopping a Groovy Script in SoapUI, we can use: testRunner.cancel() . It will stop the execution of the running Groovy Script. If we want to fail it, we can use testRunner.fail() or try pressing the combination Ctrl+Z or the Escape key.

要停止 SoapUI 中的 Groovy 脚本,我们可以使用:testRunner.cancel()。它将停止正在运行的 Groovy 脚本的执行。如果我们想使其失败,可以使用 testRunner.fail() 或尝试按 Ctrl+Z 组合键或 Escape 键。

790. How can we set a property value in SoapUI using Groovy Script?

如何使用 Groovy 脚本在 SoapUI 中设置属性值?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc775e | 官方: 否 | 付费: 否

答案:

We can set a property value in SoapUI using Groovy Script using the following steps: - Right-click on the Test steps node.

我们可以使用 Groovy 脚本在 SoapUI 中设置属性值,步骤如下:- 右键点击“测试步骤”节点。
  • From the context menu, select the Add Step and Properties options.
  • Click OK after entering the desired property name.
  • To add a property, go to the properties screen and click the properties with the groovy Script(1) icon.
  • Click the OK button after entering the desired property name.
  • If you like, you can give the property any default value.
  • Following that, a Groovy Script test step should be introduced after the property step.

791. Using Groovy Script, get the test case name in SoapUI.

使用 Groovy 脚本,获取 SoapUI 中的测试用例名称。
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc7761 | 官方: 否 | 付费: 否

答案:

There are two options to achieve the above in SoapUI. They are as follows: - Method One: In Groovy code, put the name of the testCase being run by Run Test Case (The one it directs to) into a testCase level property variable in it:

在 SoapUI 中有两种方法可以实现以上操作。如下所示:- 方法一:在 Groovy 代码中,将正在运行的测试用例(运行测试用例所指向的那个)的名称放入其中的测试用例级属性变量中:
testRunner.testCase.setPropertyValue("Here",testRunner.testCase.getName()); - Method Two:
testRunner.testCase.setPropertyValue("Here",testRunner.testCase.getName()); - 方法二:
${=testRunner.testCase.name}
${=testRunner.testCase.name}

792. How can we use SoapUI to import an XSD (XML Schema Definition) file?

我们如何使用 SoapUI 导入 XSD(XML 模式定义)文件?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc7764 | 官方: 否 | 付费: 否

答案:

An XSD file should be imported immediately when integrating WSDL from a distant source. If you are using a local file to load the WSDL, make sure the.xsd file is in the correct location as specified in the WSDL. The import statement in WSDL imports an XML namespace from a specified file. The namespace, not the declarations in the namespace, is imported. The element includes the "schemaLocation" attribute, which is optional. Because a namespace can be imported from the same file or registered in another method, the attribute is optional.

当从远程源集成WSDL时,应立即导入XSD文件。如果您使用本地文件加载WSDL,请确保.xsd文件位于WSDL中指定的正确位置。WSDL中的import语句从指定文件导入XML命名空间。导入的是命名空间,而不是命名空间中的声明。该元素包含“schemaLocation”属性,该属性是可选的。因为命名空间可以从同一文件导入或以其他方式注册,所以该属性是可选的。

793. Which service in SoapUI helps us to call the SoapUI mock service from Java?

SoapUI中哪个服务可以帮助我们从Java调用SoapUI模拟服务?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc7767 | 官方: 否 | 付费: 否

答案:

The SOAP Service Mocking facility in SoapUI using Groovy or configuring SOAP service mocking in SoapUI pro helps us to call the SoapUI mock service from Java.

SoapUI中的SOAP服务模拟功能(使用Groovy或在SoapUI Pro中配置SOAP服务模拟)可以帮助我们从Java调用SoapUI模拟服务。

794. Can we classify SOAP as a RPC (Remote Procedure Call)?

我们可以将SOAP归类为RPC(远程过程调用)吗?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc776c | 官方: 否 | 付费: 否

答案:

Yes, Soap is, in fact, an RPC (Remote Procedure Call). Remote Procedure Call (RPC) is a protocol that allows one program to request a service from another programme on a network without needing to know the network's specifics. Remote procedure calls in SOAP are essentially client-server interactions over HTTP with SOAP encoding rules for the request and response. From a high-level perspective, XML RPC and SOAP are extremely comparable protocols. Both use XML to encapsulate web service method requests and responses. XML RPC, on the other hand, can be thought of as a subset of SOAP capabilities. In terms of protocol, XML RPC can only make requests over an HTTP(s) connection, whereas SOAP is usually used over HTTP(s) but can also be used over other protocols.

是的,SOAP实际上是一种RPC(远程过程调用)。远程过程调用(RPC)是一种协议,允许一个程序在网络中向另一个程序请求服务,而无需了解网络的具体细节。SOAP中的远程过程调用本质上是基于HTTP的客户端-服务器交互,并使用SOAP编码规则处理请求和响应。从高层面来看,XML RPC和SOAP是极其相似的协议。两者都使用XML来封装Web服务方法的请求和响应。然而,XML RPC可以被视为SOAP功能的一个子集。在协议方面,XML RPC只能通过HTTP(S)连接发出请求,而SOAP通常通过HTTP(S)使用,但也可以在其他协议上使用。

795. What are the options to debug Groovy Scripts in SoapUI?

在SoapUI中调试Groovy脚本有哪些选项?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc776f | 官方: 否 | 付费: 否

答案:

The options for debugging Groovy Scripts in SoapUI are as follows: - For enabling the debugger when we run ReadyAPI using the shell script (.bat or .sh file), we can use the groovy parameter: readyapi.bat groovy

在SoapUI中调试Groovy脚本的选项如下: - 当我们使用shell脚本(.bat或.sh文件)运行ReadyAPI时,要启用调试器,可以使用groovy参数:readyapi.bat groovy
  • For enabling the debugger by default, we can perform the following steps in Windows:
    Firstly, the vmoptions file needs to be opened and then we need to add the line given below in it:

    首先,需要打开vmoptions文件,然后在其中添加下面给出的行:

-agentlib:jdwp=transport=dt_shmem,suspend=n,server=y

-agentlib:jdwp=transport=dt_shmem,suspend=n,server=y
The first step is followed by the saving of the file.
第一步之后是保存该文件。

The following requirements must be satisfied for debugging: - For Groovy script debugging, having a SoapUI Pro license is a must.

调试必须满足以下要求: - 要进行Groovy脚本调试,必须拥有SoapUI Pro许可证。
  • The debugging of the scripts can be done only in the SoapUI Groovy Script test step. Event handler scripts, setup, teardown, and report scripts, as well as Script assertions, data source and data, sink scripts, and virtual service scripts, are not supported for debugging.
  • We can only debug Groovy scripts and that too is only one script at a time.
  • For installing the binary package: The binary package, unlike the ReadyAPI installation package, does not include the essential Java files. For debugging, ReadyAPI leverages the Java JDK's tools.jar and attach.dll files. You cannot use the debugger without these files, which are not included in the typical JRE installation. To enable Groovy debugging in a binary installation, you can follow the below-given instructions:
  • Firstly, the installation of JDK must be done on your local computer or on a computer to which you have admin rights.
    Windows users can refer to this link for the installation of JDK: Link

    Windows用户可以参考此链接安装JDK:链接

For mac Operating System users, this link can be referred to for the installation of JDK: Link

对于mac操作系统用户,可以参考此链接安装JDK:链接

For Linux Operating System users, this link can be referred to for the installation of JDK: Link - Use a Java JDK for getting the tools.jar file. This file can be found in the lib folder of the JDK installation folder. This is followed by copying this file to the lib folder in the ReadyAPI installation folder.

对于Linux操作系统用户,可以参考此链接安装JDK:链接 - 使用Java JDK获取tools.jar文件。该文件可以在JDK安装文件夹的lib文件夹中找到。然后将此文件复制到ReadyAPI安装文件夹的lib文件夹中。
  • Use a Java JDK for getting the attach.dll file. This file can be found in the JRE bin folder in the JDK installation folder. The copying of this file needs to be done to the bin folder in the ReadyAPI installation folder.

796. What do you understand by API Testing? Why is it needed?

您对API测试有何理解?为什么需要它?
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc7772 | 官方: 否 | 付费: 否

答案:

API testing is a sort of software testing that involves explicitly testing APIs as well as part of integration testing to see if the API satisfies the application's expectations in terms of functionality, stability, performance, and security. Our main focus in API testing will be on the software architecture's business logic layer. Any software system with various APIs can be subjected to API testing. The appearance and feel of the application will not be a focus of API testing. API testing differs significantly from GUI testing. API testing involves the following: - Unit testing

API测试是一种软件测试类型,涉及明确测试API以及作为集成测试的一部分,以查看API在功能、稳定性、性能和安全性方面是否满足应用程序的预期。我们在API测试中的主要关注点将是软件架构的业务逻辑层。任何具有多种API的软件系统都可以进行API测试。应用程序的外观和感觉不会成为API测试的重点。API测试与GUI测试有很大不同。API测试涉及以下内容: - 单元测试
  • Integration testing
  • Functional testing
  • and various other types of testing
    API testing is required to determine whether an API meets user expectations in terms of functionality, dependability, performance, and security.

    API测试是必要的,以确定API在功能性、可靠性、性能和安全方面是否满足用户期望。

797. Write a few differences for the following: SoapUI vs Postman.

为以下内容写几个区别:SoapUI vs Postman。
  • 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5458d557c902bc7775 | 官方: 否 | 付费: 否

答案:

The following table brings out the differences between SoapUI vs Postman:

下表展示了SoapUI vs Postman之间的区别:
SOAP UIPOSTMAN
SoapUI is used for testing protocols like SOAP, GraphQL, REST, etc.
SoapUI用于测试如SOAP、GraphQL、REST等协议。
Only REST APIs can be tested using Postman.
只能使用Postman测试REST API。
Data-Driven Testing can be done using SoapUI.
可以使用SoapUI进行数据驱动测试。
Data-Driven Testing cannot be done using Postman.
不能使用Postman进行数据驱动测试。
Automation testing can be done using SoapUI.
可以使用SoapUI进行自动化测试。
Automation testing cannot be done using Postman. Only Manual and exploratory Testing are supported by Postman.
不能使用Postman进行自动化测试。Postman仅支持手动和探索性测试。
SoapUI is an API tool.
SoapUI是一个API工具。
Postman is a Google Chrome Extension.
Postman是一个Google Chrome扩展。
SoapUI supports a command-line interface.
SoapUI支持命令行界面。
Postman does not have a command-line interface.
Postman没有命令行界面。
Groovy Script is SoapUI's scripting language.
Groovy脚本是SoapUI的脚本语言。
JavaScript is Postman's scripting language.
JavaScript是Postman的脚本语言。

798. Explain boundary value analysis in software testing.

解释软件测试中的边界值分析。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5558d557c902bc7849 | 官方: 否 | 付费: 否

答案:

BVA (Boundary Value Analysis) is a black box software testing technique that uses boundary values to create test cases. Input values near the boundary have a higher probability of error, so BVA is used to test boundary values. BVA includes values at the boundaries in the test cases. If the input falls within the boundary range, then the test is positive; if it falls outside, then it is negative. There are several types of values, including maximum or minimum, inside or outside edge, and typical or error values.

边界值分析(BVA)是一种黑盒软件测试技术,利用边界值来创建测试用例。靠近边界的输入值出错概率更高,因此 BVA 用于测试边界值。BVA 在测试用例中包含边界上的值。如果输入落在边界范围内,则测试为正;如果落在范围外,则为负。值的类型有多种,包括最大值或最小值、边界内侧或外侧,以及典型值或错误值。

799. Explain the role of testing in software development?

解释测试在软件开发中的作用。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5558d557c902bc784c | 官方: 否 | 付费: 否

答案:

Software testing comes into play at different times in different software development methodologies. There are two main methodologies in software development, namely Waterfall and Agile.

软件测试在不同的软件开发方法论中会在不同阶段介入。软件开发主要有两种方法论,即瀑布模型和敏捷模型。

In a traditional waterfall software development model, requirements are gathered first. Then a specification document is created based on the document, which drives the design and development of the software. Finally, the testers conduct the testing at the end of the software development life cycle once the complete software system is built.

在传统的瀑布软件开发模型中,首先收集需求。然后基于需求文档创建规格说明文档,该文档驱动软件的设计和开发。最后,在完整软件系统构建完成后的软件开发生命周期末尾,测试人员进行测试。

Waterfall Software Development Model

瀑布软件开发模型

An agile software development model works in small iterations. You test the software in parallel as it is getting built. The developers build a small functionality according to the requirements. The testers test it and get customer feedback, which drives future development.

敏捷软件开发模型以小迭代方式运行。在软件构建的同时并行进行测试。开发人员根据需求构建小功能。测试人员对其进行测试并获取客户反馈,反馈驱动后续开发。

800. How much testing is sufficient? Or, is it possible to do exhaustive testing of the software?

多少测试才算充分?或者,是否可能对软件进行穷尽测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5558d557c902bc784f | 官方: 否 | 付费: 否

答案:

It is impossible to exhaustively test software or prove the absence of errors, no matter how specific your test strategy is.

无论你的测试策略有多具体,都不可能穷尽测试软件或证明没有错误。

An extensive test that finds hundreds of errors doesn’t imply that it has discovered them all. There could be many more errors that the test might have missed. The absence of errors doesn’t mean there are no errors, and the software is perfect. It could easily mean ineffective or incomplete tests. To prove that a program works, you’d have to test all possible inputs and their combinations.

一项广泛的测试发现了数百个错误并不意味着它已经发现了所有错误。测试可能遗漏了更多错误。没有错误并不意味着没有错误,软件是完美的。这可能很容易意味着测试无效或不完整。要证明程序能正常工作,你必须测试所有可能的输入及其组合。

Consider a simple program that takes a string as an input that is ten characters long. To test it with each possible input, you’d have to enter 2610 names, which is impossible. Since exhaustive testing is not practical, your best strategy as a tester is to pick the test cases that are most likely to find errors. Testing is sufficient when you have enough confidence to release the software and assume it will work as expected.

考虑一个简单的程序,它接受一个长度为十个字符的字符串作为输入。要用每种可能的输入来测试它,你必须输入26的10次方个名字,这是不可能的。由于穷举测试不切实际,作为测试人员,你最好的策略是选择最有可能发现错误的测试用例。当你有足够信心发布软件并假设它能按预期工作时,测试就足够了。

801. Why developers shouldn’t test the software they wrote?

为什么开发者不应该测试他们自己编写的软件?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5558d557c902bc7852 | 官方: 否 | 付费: 否

答案:

Developers make poor testers. Here are some reasons why: - They try to test the code to make sure that it works, rather than testing all the ways in which it doesn't work.

开发者是糟糕的测试人员。以下是一些原因:- 他们试图测试代码以确保它能工作,而不是测试它可能不工作的所有方式。
  • Since they wrote it themselves, developers tend to be very optimistic about the software and don't have the correct attitude needed for testing: to break software.
  • Developers skip the more sophisticated tests that an experienced tester would perform to break the software. They follow the happy path to execute the code from start to finish with proper inputs, often not enough to get the confidence to ship software in production.
    However, it doesn't mean that developers shouldn't test the software before sending it to the tester. Developer testing helps find many bugs that are caused by programming errors. These are hard to find for a tester because they don't always have access to the source code.

    然而,这并不意味着开发者不应该在将软件发送给测试人员之前测试它。开发者测试有助于发现许多由编程错误引起的缺陷。这些对测试人员来说很难找到,因为他们并不总能访问源代码。

802. What is SDLC in software testing?

在软件测试中,什么是SDLC?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5558d557c902bc7855 | 官方: 否 | 付费: 否

答案:

In short, SDLC (Software Development Life Cycle) enables the development of high-quality, low-cost software with the shortest possible development time. A major objective of the SDLC is to produce high-quality software that meets and exceeds the expectations of customers. SDLC provides a detailed plan with a series of stages, or phases, that encompass their own processes and deliverables. By adhering to the SDLC, developers can enhance the speed of their projects and minimize risks and costs.

简而言之,SDLC(软件开发生命周期)能够在最短的开发时间内开发出高质量、低成本的软件。SDLC的一个主要目标是生产满足并超越客户期望的高质量软件。SDLC提供了一个详细的计划,包含一系列阶段,每个阶段都有自己的流程和交付物。通过遵循SDLC,开发者可以加快项目进度并最小化风险和成本。

803. What is functional testing?

什么是功能测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37c5558d557c902bc785c | 官方: 否 | 付费: 否

答案:

Functional testing is a form of black-box testing. As the name suggests, it focuses on the software's functional requirements rather than its internal implementation. A functional requirement refers to required behavior in the system, in terms of its input and output.

功能测试是一种黑盒测试形式。顾名思义,它关注软件的功能需求,而不是内部实现。功能需求指的是系统中要求的行为,包括输入和输出。
It validates the software against the functional requirements or the specification, ignoring the non-functional attributes such as performance, usability, and reliability.
它根据功能需求或规范来验证软件,忽略性能、可用性和可靠性等非功能属性。

Functional testing aims to answer the following questions, in particular: - Does the software fulfill its functional requirements?

功能测试旨在回答以下问题,特别是:- 软件是否满足其功能需求?
  • Does it solve its intended users' problems?

804. What is non-functional testing?

什么是非功能测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37c5658d557c902bc785f | 官方: 否 | 付费: 否

答案:

Non-functional testing tests the system's non-functional requirements, which refer to an attribute or quality of the system explicitly requested by the client. These include performance, security, scalability, and usability.

非功能测试测试系统的非功能需求,这些是指客户端明确请求的系统属性或质量。这些包括性能、安全性、可扩展性和可用性。

Non-functional testing comes after functional testing. It tests the general characteristics unrelated to the functional requirements of the software. Non-functional testing ensures that the software is secure, scalable, high-performance, and won't crash under heavy load.

非功能测试在功能测试之后进行。它测试与软件功能需求无关的一般特性。非功能测试确保软件是安全的、可扩展的、高性能的,并且不会在重负载下崩溃。

805. What is a bug report?

什么是缺陷报告?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7862 | 官方: 否 | 付费: 否

答案:

During testing, a tester records their observations, findings, and other information useful to the developers or the management. All this data belongs to a test record, also called a bug report.

在测试期间,测试人员记录他们的观察、发现以及对开发者或管理层有用的其他信息。所有这些数据属于测试记录,也称为缺陷报告。

A detailed bug report is an important artifact produced during testing. It helps the team members with: - Understand the problem,

一份详细的缺陷报告是测试过程中产生的重要产物。它帮助团队成员:- 理解问题,
  • Steps to reproduce the problem,
  • The environment and the specific conditions under which it happens, and
  • The resolution if/when the developers fix the problem.
    Here are a few bits of information that a good bug report should contain. Image Source: Bugzilla

    以下是一份好的缺陷报告应包含的一些信息。图片来源:Bugzilla
Field
字段
Description
描述
Title
标题
A short headline that summarizes the problem. It shouldn’t be too long but just to give just the right information to the reader. It should be specific and accurate.
一个简短概括问题的标题。它不应过长,但需给读者提供恰到好处的信息。它应具体且准确。
Description
描述
The description should answer all the questions that are not explained by the title. It contains a detailed summary of the bug, its severity, and impact, steps to reproduce, expected results vs. the actual output.
描述应回答标题未说明的所有问题。它包含缺陷的详细摘要、严重性和影响、重现步骤、预期结果与实际输出。
Version
版本
A lot of time can be wasted in trying to reproduce a bug in the wrong version of the product. Knowing the exact product version or the build number on which this bug was found is very useful to the developer in reproducing the bug.
在尝试于错误的产品版本中重现缺陷时,可能会浪费大量时间。知道发现此缺陷的确切产品版本或构建号,对开发者重现缺陷非常有用。
Status
状态
At any point, a bug can be either ‘Active’, ‘Ready for Testing’, or ‘Closed’. A bug becomes active when it is found, is ready for testing once the developer fixes it. A tester can mark it closed if the developer fixed it, or active if not.
在任何时候,缺陷可以是“活跃”、“待测试”或“已关闭”。缺陷被发现时变为活跃,开发者修复后待测试。如果开发者修复了,测试人员可将其标记为已关闭,否则标记为活跃。
Steps to Reproduce
重现步骤
Though the steps to reproduce the problem can be provided in the description, sometimes having a distinct field force the tester to think about them. They include each step one must take to successfully reproduce the problem.
虽然在描述中可以提供重现问题的步骤,但有时一个独立字段会促使测试人员思考这些步骤。它们包括成功重现问题所需的每个步骤。
Assigned To
指派给
Name of the developer or the tester to whom this bug is assigned.
此缺陷被指派给的开发者或测试人员的姓名。
Resolution
解决方案
When a developer fixes the bug, they should include the cause for the bug and its resolution. It helps the team in the future when a similar bug resurfaces.
当开发者修复缺陷时,他们应包含缺陷的原因和解决方案。这有助于团队在未来遇到类似缺陷时参考。

For example, here is a picture of a bug reported on Jira, a popular bug-tracking software.

例如,这是Jira(一款流行的缺陷跟踪软件)上报告的缺陷的图片。

806. What are some important testing metrics?

有哪些重要的测试指标?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7865 | 官方: 否 | 付费: 否

答案:

Testing metrics provide a high-level overview to the management or the developers on how the project is going and the next action steps.

测试指标向管理层或开发者提供项目进展及下一步行动的高层概述。

Here are some of the metrics derived from a record of the tests and failures: - Total number of defects found, ordered by their severity

以下是从测试和失败记录中得出的一些指标:- 发现的缺陷总数,按严重性排序
  • Total number of bugs fixed
  • Total number of problems caused by an error in the source code vs. configuration or external environmental factors
  • Bug find and fix rate over time
  • Bugs by produce/feature area
  • The average time is taken by a bug since it’s found and fixed.
  • Total time spent on new feature development vs. time spent on resolving bugs and failures
  • Number of outstanding bugs before a release
  • Bugs/failures reported by the customers vs. those found by the testers

807. What is Test-Driven-Development?

什么是测试驱动开发?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7868 | 官方: 否 | 付费: 否

答案:

Test-Driven-Development (TDD) is a popular software development technique, first introduced by Kent Beck in his book with the same name, published in 1999.

测试驱动开发(TDD)是一种流行的软件开发技术,由肯特·贝克在他1999年出版的同名书籍中首次提出。

In TDD, a developer working on a feature first writes a failing test, then writes just enough code to make that test pass. Once they have a passing test, they add another failing test and then write just enough code to pass the failing test. This cycle repeats until the developer has the fully working feature. If the code under the test has external dependencies such as database, files, or network, you can mock them to isolate the code.

在TDD中,开发一个功能的开发者首先编写一个失败的测试,然后编写足够的代码使该测试通过。一旦测试通过,他们添加另一个失败的测试,然后编写足够的代码使其通过。此循环重复,直到开发者拥有完全可用的功能。如果测试下的代码有外部依赖(如数据库、文件或网络),你可以模拟这些依赖以隔离代码。

Benefits of TDD: - Writing tests first forces you to think about the feature you are trying to build, helping you produce better code.

TDD的好处:- 先写测试迫使你思考正在尝试构建的功能,帮助你产出更好的代码。
  • As you always have a working set of tests at hand, a failing test indicates that the problem is with the code you just added, reducing the time spent in debugging.
  • Writing tests help the developer to clarify the requirements and specification. It’s challenging to write good tests for a poor set of requirements.
  • It’s tough to produce high-quality software unless you can test the software after each new change. You can never be sure that your new code didn’t break the working software. TDD gives you the confidence to add new code, as you already have a test in place.

808. What is Selenium? What are its benefits?

什么是Selenium?它的好处是什么?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc786b | 官方: 否 | 付费: 否

答案:

Selenium is a web browser automation tool that automates the test suits you need to run on a web browser.

Selenium是一种网络浏览器自动化工具,可自动化你需要在网络浏览器上运行的测试套件。
Some of the benefits of Selenium include: - It is open-source software, eliminating licensing costs.
Selenium的一些好处包括:- 它是开源软件,消除了许可成本。
  • It supports all the major languages, such as Java, C#, Python, Ruby, etc.
  • It supports all the major web browsers, e.g., Google Chrome, Firefox, Safari, etc.
  • You can integrate it with other testing frameworks and tools to build a comprehensive test suite for your software.

809. What are the various components of Selenium?

Selenium的各个组成部分是什么?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc786e | 官方: 否 | 付费: 否

答案:

Selenium consists of the following components: - Selenium Remote Control (RC).

Selenium由以下组件组成:- Selenium远程控制(RC)。
  • Selenium Integrated Development Environment (IDE).
  • Selenium WebDriver.
  • Selenium Grid.

810. What are the different HTTP status codes that a server can return?

服务器可以返回哪些不同的HTTP状态码?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7875 | 官方: 否 | 付费: 否

答案:

An HTTP status code is a three-digit number that indicates the status of an incoming HTTP request, that is, if the request has been completed or not.

HTTP状态码是一个三位数字,用于指示传入HTTP请求的状态,即请求是否已完成。

A server can send the following five types of responses for an HTTP request.

服务器可以为HTTP请求发送以下五种类型的响应。
  1. Information (100 - 199): These status codes provide a temporary response. The response consists of the status line and optional headers and terminates by an empty line. 2. Success (200 - 299): Indicate that the incoming HTTP request was successfully received, understood, and accepted. 3. Redirect (300 - 399): These status codes indicate further actions the client should take to satisfy the HTTP request. It can mean that the requested resource may have moved temporarily or permanently. It can also redirect the client to another URL. 4. A client error (400 - 499): Indicate a problem with the client who initiated the HTTP request. 5. Server error (500 - 599): The 5XX status code indicates a problem on the server while processing the request.

    1. 信息(100 - 199):这些状态码提供临时响应。响应由状态行和可选标头组成,并以空行结束。 2. 成功(200 - 299):表示传入的HTTP请求已成功接收、理解并接受。 3. 重定向(300 - 399):这些状态码表示客户端为满足HTTP请求而应采取进一步操作。这可能意味着所请求的资源可能已临时或永久移动。它还可以将客户端重定向到另一个URL。 4. 客户端错误(400 - 499):表示发起HTTP请求的客户端存在问题。 5. 服务器错误(500 - 599):5XX状态码表示服务器在处理请求时出现问题。

811. What is automated testing?

什么是自动化测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7878 | 官方: 否 | 付费: 否

答案:

As the name suggests, automated testing, which is also called test automation, is the programmatic execution of the tests. The tester uses an automation tool or software like Selenium to write code that performs the following tasks.

顾名思义,自动化测试(也称为测试自动化)是以编程方式执行测试。测试人员使用自动化工具或软件(如Selenium)编写代码,以执行以下任务。
  1. Automatically run the software. 2. Feed the input data to the system. 3. Examine the output with the expected outcome. 4. Fail the test if the results don’t match. Otherwise, pass the test.

    1. 自动运行软件。 2. 向系统输入数据。 3. 将输出与预期结果进行比较。 4. 如果结果不匹配,则测试失败。否则,测试通过。

Once a test is automated, you can run it as often as you want, to check if any new code has broken it. It enables you to spend your time on other high-value tests, such as exploratory testing that help find bugs that an automated test would miss.

一旦测试自动化,您可以随意运行它,以检查是否有任何新代码破坏它。这使您能够将时间花在其他高价值的测试上,例如探索性测试,这有助于发现自动化测试可能遗漏的缺陷。

Automated testing is beneficial for repetitive testing with inputs that don’t change frequently. Humans get tired and bored from conducting the same tests repeatedly and seeing the same results. It’s easy to make mistakes when you are testing a feature for the twentieth time. Software is much better at doing repetitive tasks without getting tired or making mistakes than a human operator would.

自动化测试对于输入不频繁变化的重复性测试非常有益。人类在重复执行相同测试和看到相同结果时会感到疲劳和无聊。当您第二十次测试某个功能时,很容易出错。软件在执行重复任务时比人工操作员更能避免疲劳或错误。

812. What is the most effective way to map automation testing success?

映射自动化测试成功的最有效方法是什么?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc787b | 官方: 否 | 付费: 否

答案:

The success of Automation testing can be measured using the following criteria: - Savings on labor & other costs.

自动化测试的成功可通过以下标准来衡量: - 节省人工和其他成本。
  • Defect Detection Ratio.
  • Automating the execution process and reducing the release time.

813. What are the different types of severity you can assign to a bug?

您可以分配给缺陷的不同严重性级别有哪些?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc787e | 官方: 否 | 付费: 否

答案:

Though it varies depending on the size and structure of the software development teams, typically, a bug can be assigned the following types of severities, going from low to high:

尽管这取决于软件开发团队的规模和结构,但通常缺陷可以分配以下严重性类型,从低到高排列:

Low - User Interface bugs.

低 - 用户界面缺陷。
  • Accessibility issues.
    Medium - Leaky abstractions.

    中 - 抽象泄漏。
  • Software hangs.
  • Users unable to perform a specific action.
  • Boundary conditions.
    High - Crashing under high load.

    高 - 在高负载下崩溃。
  • Business logic and/or calculation errors.
  • Any user action that causes the software to crash.
  • Exposing sensitive user data.
  • Security problems.
  • Loss of data.

814. Which test cases are written first: white boxes or black boxes?

先编写哪些测试用例:白盒还是黑盒?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7881 | 官方: 否 | 付费: 否

答案:

Test cases for the black box testing are usually written first, followed by test cases for the white box testing. An outline of the design or project plan and the requirements document is required to write black-box test cases. Documents such as these are readily available at the beginning of the project. The initial phase of a project isn't the right time to start white box testing because it requires more architecture clarification that isn't available yet. Therefore, white-box test cases are typically written after black-box test cases have been developed.

黑盒测试的测试用例通常先编写,随后再编写白盒测试的测试用例。编写黑盒测试用例需要设计或项目计划的大纲以及需求文档。这类文档在项目初期就很容易获得。项目初期不是开始白盒测试的合适时机,因为它需要更多的架构澄清,而这些在当时还不可用。因此,白盒测试用例通常是在黑盒测试用例开发之后才编写的。

815. What is alpha testing?

什么是阿尔法测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7884 | 官方: 否 | 付费: 否

答案:

Before you ship the software to the customers, the internal testing team performs alpha testing. Alpha testing is part of the user acceptance testing. Its goal is to identify bugs before the customers start using the software.

在将软件交付给客户之前,内部测试团队会执行阿尔法测试。阿尔法测试是用户验收测试的一部分。其目标是在客户开始使用软件之前识别缺陷。

816. What is beta testing?

什么是贝塔测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7887 | 官方: 否 | 付费: 否

答案:

Once you ship the software to the customers after alpha testing, the software's actual users perform the beta testing in a real production environment. It is one of the final components of user acceptance testing. Beta testing is helpful to get feedback from real people using your software in real environments.

在阿尔法测试后将软件交付给客户后,软件的实际用户会在真实的生产环境中执行贝塔测试。这是用户验收测试的最终组成部分之一。贝塔测试有助于从在真实环境中使用软件的真实用户那里获取反馈。

817. What is meant by browser automation?

浏览器自动化是什么意思?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc788a | 官方: 否 | 付费: 否

答案:

It’s a process of automatically testing a web application’s functionality in a browser, where a program launches the browser, navigates to the application, and interacts with the user interface by clicking buttons or links, just like an average user would.

这是一个在浏览器中自动测试Web应用程序功能的过程,其中程序会启动浏览器、导航到应用程序,并通过点击按钮或链接与用户界面交互,就像普通用户一样。

The only difference is that the browser automation can test this very quickly and often, whereas the same test would take a human tester a long time. It’s part of automated testing. Some essential tools for browser testing include Selenium, protractor.js, and cypress.

唯一的区别是浏览器自动化可以非常快速且频繁地进行测试,而同样的测试由人工测试员则需要很长时间。它是自动化测试的一部分。浏览器测试的一些基本工具包括Selenium、protractor.js和Cypress。

818. What do you mean by Test Matrix and Traceability Matrix?

测试矩阵和追溯矩阵是什么意思?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc788d | 官方: 否 | 付费: 否

答案:

Test Matrix: It is referred to as a testing tool that is used to capture actual quality, effort, resources, plan, and time required to capture all the phases of software testing. It only covers the testing phase of the life cycle. Requirement Traceability Matrix (RTM): It is referred to as a document, usually present in the form table, that is used to trace and demonstrate the relationship between the requirements and other artifacts of the project right from start to end. In simple words, it maps between test cases and customer requirements.

测试矩阵:指的是用于捕获软件测试所有阶段所需的实际质量、工作量、资源、计划和时间的一种测试工具。它只覆盖生命周期中的测试阶段。需求追溯矩阵(RTM):指的是通常以表格形式存在的一种文档,用于从项目开始到结束追溯并展示需求与项目其他工件之间的关系。简单来说,它在测试用例和客户需求之间进行映射。

819. What is the V model in software testing?

软件测试中的V模型是什么?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7890 | 官方: 否 | 付费: 否

答案:

V-models, also known as validation or verification models, are SDLC models where the process occurs sequentially in a V-shape. This method consists of associating a testing phase with each corresponding development stage. As each development activity is accompanied by a testing activity, the next test phase occurs only after the previous phase has been completed. - Validation: It is defined as a process that involves dynamic testing of software products by executing the code. This process validates whether we are building the right software that meets that customer's requirement or not. It involves various activities like system testing, integration testing, user acceptance testing, and unit testing.

V模型,也称为验证或确认模型,是SDLC模型,其中过程按V形顺序进行。这种方法将每个相应的开发阶段与一个测试阶段相关联。由于每个开发活动都伴随一个测试活动,下一个测试阶段只会在前一个阶段完成后才发生。- 确认:定义为通过执行代码对软件产品进行动态测试的过程。该过程验证我们是否正在构建满足客户需求的正确软件。它涉及各种活动,如系统测试、集成测试、用户验收测试和单元测试。
  • Verification: The technique involves static analysis (review) without running the code. It is defined as a process that involves analyzing the documents. This process verifies whether the software conforms to specifications or not. Its ultimate goal is to ensure the quality of software products, design, architecture, etc.

820. State difference between verification and validation in software testing.

说明软件测试中验证和确认之间的区别。
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7893 | 官方: 否 | 付费: 否

答案:

Validation: It is defined as a process that involves dynamic testing of software products by running it. This process validates whether we are building the right software that meets that customer requirement or not. It involves various activities like system testing, integration testing, user acceptance testing, and unit testing. Verification: It is defined as a process that involves analyzing the documents. This process verifies whether the software conforms to specifications or not. Its ultimate goal is to ensure the quality of software products, design, architecture, etc.

确认:定义为通过运行软件产品对其进行动态测试的过程。该过程验证我们是否正在构建满足客户需求的正确软件。它涉及各种活动,如系统测试、集成测试、用户验收测试和单元测试。验证:定义为涉及分析文档的过程。该过程验证软件是否符合规格。其最终目标是确保软件产品、设计、架构等的质量。

Verification Vs Validation:

验证与确认:
Verification
验证
Validation
确认
It checks whether the software meets the specification or not.
它检查软件是否符合规格说明。
It checks whether the specification captures the customer’s needs or not.
它检查规格说明是否捕获了客户的需求。
It is a type of static testing.
它是一种静态测试类型。
It is a type of dynamic testing.
它是一种动态测试类型。
There is no requirement of executing the code.
不需要执行代码。
There is a requirement for executing the code.
需要执行代码。
This process is performed by the QA team to make sure that the software is built as per the specifications in the SRS document.
此过程由QA团队执行,以确保软件按照SRS文档中的规格构建。
This process is performed with the involvement of the testing team.
此过程在测试团队的参与下执行。
Reviews, walkthroughs, inspections, and desk-checking are some methods that can be used in verification.
评审、走查、检查和桌面检查是验证中可以使用的一些方法。
Black box testing, white box testing, and non-functional testing are some methods that can be used during validation.
黑盒测试、白盒测试和非功能测试是确认期间可以使用的一些方法。
It identifies the bugs or errors early in the development process.
它在开发过程中及早识别缺陷或错误。
It can identify the bugs or errors that the verification process cannot catch.
它可以识别验证过程无法捕获的缺陷或错误。
It is performed before the validation process.
它在确认过程之前执行。
It is performed after the verification process.
它在验证过程之后执行。

821. What is static software testing?

什么是静态软件测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7896 | 官方: 否 | 付费: 否

答案:

Static testing is a technique in which you test the software without actually executing it. It involves doing code walkthroughs, code reviews, peer-reviews, or using sophisticated tools such as eslint, StyleCop to perform static analysis of the source code. Static testing is typically performed during software development.

静态测试是一种在不实际执行软件的情况下测试软件的技术。它涉及进行代码走查、代码评审、同伴评审,或使用诸如eslint、StyleCop等复杂工具对源代码进行静态分析。静态测试通常在软件开发期间执行。

822. What is dynamic software testing?

什么是动态软件测试?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc7899 | 官方: 否 | 付费: 否

答案:

In contrast to static testing, dynamic software testing tests the software when it’s executing. The tester runs the software in a test environment and goes through all the steps involved, entering the inputs and verifying the actual output with the expected result.

与静态测试相反,动态软件测试在软件执行时进行测试。测试人员在测试环境中运行软件,并经历所有涉及的步骤,输入数据并验证实际输出与预期结果。

823. What do you mean by confirmation testing in software testing?

在软件测试中,确认测试是什么意思?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc789c | 官方: 否 | 付费: 否

答案:

A confirmation test involves retesting a software product to see if the previously reported bugs have been fixed. A bug is usually reported by testers when a test fails. A new version of the software is released after the development team fixes the defect. Now that the new software build has been released, the testing team will retest it in order to ensure that the reported bug was actually fixed. It is also referred to as retesting.

确认测试涉及重新测试软件产品,以查看先前报告的缺陷是否已修复。当测试失败时,测试人员通常会报告缺陷。开发团队修复缺陷后,会发布软件的新版本。既然新的软件构建已发布,测试团队将重新测试它,以确保报告的缺陷确实被修复了。它也被称为重测试。

824. What is the defect life cycle?

什么是缺陷生命周期?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc789f | 官方: 否 | 付费: 否

答案:

Defect life cycle, also known as a bug life cycle, is a life cycle of various stages through which a defect goes during its whole lifetime. This life cycle starts as soon as the defect is discovered or reported by the tester and ends when the tester ensures that the defect is resolved and it won't occur again. The defect life cycle includes the steps as shown below:

缺陷生命周期,也称为缺陷生命周期,是一个缺陷在其整个存在期间经历的各种阶段的生命周期。这个生命周期从测试人员发现或报告缺陷时开始,到测试人员确保缺陷已解决且不会再次发生时结束。缺陷生命周期包括以下所示的步骤:

825. How can Selenium WebDriver be used to detect broken links?

如何使用Selenium WebDriver检测损坏的链接?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc78a2 | 官方: 否 | 付费: 否

答案:

You might be asked this tricky question by the interviewer. As an example, he could give you a web page with 20 links, and you would have to determine which of those 20 links are working and which aren't or are broken.

面试官可能会问你这个棘手的问题。例如,他可以给你一个包含20个链接的网页,你必须确定这20个链接中哪些是正常的,哪些是不正常的或损坏的。

Considering that you must verify the functionality of each link, the workaround is to send HTTP requests to each link and analyze the response. When you navigate to a URL using the driver.get() method, you will receive a 200 - OK status response. It is evident that the link has been obtained and is working. In the case of any other status, the link is broken.

考虑到你必须验证每个链接的功能,解决方法是将HTTP请求发送到每个链接并分析响应。当你使用driver.get()方法导航到URL时,你会收到一个200 - OK状态响应。很明显,链接已获取且正常工作。对于任何其他状态,链接是损坏的。

Let’s now understand how to do that.

现在让我们了解如何做到这一点。

As a first step, we must determine the different hyperlinks on the webpage using anchor tags. We can obtain hyperlinks for each tag using the attribute 'href' value and analyze the response received using the driver.get() method.

作为第一步,我们必须使用锚标签确定网页上的不同超链接。我们可以使用属性'href'值获取每个标签的超链接,并使用driver.get()方法分析收到的响应。

826. When there is neither a frame ID nor a frame name, what technique should be considered in the script?

当没有框架ID或框架名称时,脚本中应考虑什么技术?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc78a5 | 官方: 否 | 付费: 否

答案:

When frame name and frame id are unavailable, we can use frame index instead. Suppose there are four frames on a page that don't have frame names or frame identifiers (frame ID), but we can still select them with the frame (zero-based) index attribute. For instance, the first frame would be indexed 0, the second frame would be at index 1, the third frame would be at index 2, and the fourth frame would be at index 3.

当框架名称和框架ID不可用时,我们可以使用框架索引代替。假设页面上有四个框架,它们没有框架名称或框架标识符(框架ID),但我们仍然可以使用框架(基于零的)索引属性来选择它们。例如,第一个框架将为索引0,第二个框架将在索引1,第三个框架将在索引2,第四个框架将在索引3。

driver.switchTo().frame(int arg0);

driver.switchTo().frame(int arg0);

827. What is meant by the workbench concept?

工作台概念指的是什么?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc78a8 | 官方: 否 | 付费: 否

答案:

A workbench is a document that explains how an activity should be completed. Often, it is referred to as a step, phase, or task. Workbenches serve as platforms for building and monitoring testers' work structures. Using this method, it is possible to divide tasks into each phase and to reach the customer's expectations using the initial data.

工作台是一份说明如何完成某项活动的文档。它通常被称为步骤、阶段或任务。工作台作为构建和监控测试人员工作结构的平台。通过这种方法,可以将任务划分为各个阶段,并利用初始数据满足客户的期望。

Every workbench has five tasks, which are as follows: - Input.

每个工作台都有五项任务,如下: - 输入。
  • Execute.
  • Check.
  • Production output.
  • Rework.

828. A defect that could have been removed during the initial stage is later removed. What effect does this have on the cost?

一个本应在初始阶段被移除的缺陷后来才被移除。这对成本有何影响?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc78ab | 官方: 否 | 付费: 否

答案:

If a defect is discovered during the project's initial phase, it is important that the defect is removed during that phase rather than afterwards. The cost of fixing a defect increases greatly if it is delayed until a later stage in the development cycle. Following is a diagram showing how the cost of a fixing defect increases throughout the phases.

如果在项目初始阶段发现缺陷,重要的是在该阶段移除缺陷,而不是之后。如果缺陷被推迟到开发周期的后期阶段修复,修复成本会大幅增加。下面是一个图表,展示了修复缺陷的成本在各个阶段如何增加。

It is more cost-effective to eliminate defects during the design phase, but it becomes twenty times more expensive to do so during maintenance.

在设计阶段消除缺陷更具成本效益,但在维护阶段这样做则会贵二十倍。

829. What is defect cascading in Software testing?

软件测试中的缺陷级联是什么意思?
  • 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c5658d557c902bc78ae | 官方: 否 | 付费: 否

答案:

In software testing, defect cascading is the scenario in which one defect leads to the occurrence of several other defects in a program. If a defect goes unnoticed during testing or if it doesn't get reported, it has the potential to trigger other problems. The result is that multiple defects arise during the later stages of the production process.

在软件测试中,缺陷级联是指一个缺陷导致程序中发生多个其他缺陷的场景。如果缺陷在测试期间未被注意到或未报告,它有可能引发其他问题。结果是,在生产过程的后期阶段会出现多个缺陷。

830. Explain TDM (Test Data Management).

解释 TDM(测试数据管理)。
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e74 | 官方: 否 | 付费: 否

答案:

As its name implies, Test Data Management involves managing test data necessary for the execution of TestCases. In addition to viewing all records within your test data repository, it allows you to modify and/or delete selected ones. During Tricentis Tosca Server setup, it is automatically installed as part of the Test Data Service component. It combines Test Data Service (TDS) and test data management to allow teams to design, locate, manage, and provide test data, even in complex and hard-to-manage scenarios.

顾名思义,测试数据管理涉及管理与执行测试用例所需的测试数据。除了查看测试数据存储库中的所有记录外,它还允许修改和/或删除选定的记录。在 Tricentis Tosca Server 设置期间,它作为测试数据服务组件的一部分自动安装。它将测试数据服务(TDS)和测试数据管理结合起来,使团队能够设计、定位、管理和提供测试数据,即使在复杂且难以管理的场景中也能如此。

831. What is the test configuration parameter in Tosca?

Tosca 中的测试配置参数是什么?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e77 | 官方: 否 | 付费: 否

答案:

To configure your tests, you can set configuration values through test configuration parameters. The test configuration parameters give you the ability to set parameters for Tosca objects. You can simplify the maintenance of your tests and reduce repetitive tasks by setting specific values to test configuration parameters. For example: - Versions of test objects, such as release numbers.

要配置测试,您可以通过测试配置参数设置配置值。测试配置参数使您能够为 Tosca 对象设置参数。通过为测试配置参数设置特定值,您可以简化测试的维护并减少重复任务。例如: - 测试对象的版本,如发布号。
  • Various test environment identifiers, for instance Windows 7.
  • Connection identifiers, such as URLs and parameters.
  • Identifiers of business process chains.
    Test configuration parameters can be created for the following Tricentis Tosca objects: - Project root element

    可以为以下 Tricentis Tosca 对象创建测试配置参数: - 项目根元素
  • ExecutionList
  • Component folder
  • ExecutionEntry folder
  • Configuration's folder
  • ExecutionEntry
  • TestCase folder
  • Scratchbook
  • TestCase
  • TestCase-Design folder
  • ExecutionList folder

832. What do you mean by Tosca Template?

Tosca 模板是什么意思?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e7a | 官方: 否 | 付费: 否

答案:

In Tosca, templates are structured/conventional formats that can be reused to create concrete TestCases. It is possible to convert test cases that have very similar steps into templates so that they can be used for a variety of data combinations. Data from test datasheets are used in the template. When you instantiate a template, you convert a single test case template into several test cases using the test data that you supply as input to the template.

在 Tosca 中,模板是可重用的结构化/常规格式,用于创建具体的测试用例。可以将具有非常相似步骤的测试用例转换为模板,以便它们可用于各种数据组合。模板中使用测试数据表中的数据。当您实例化模板时,您会将单个测试用例模板转化为多个测试用例,使用您提供给模板的测试数据作为输入。

833. Explain Tosca QC (Quality Center)/ALM (Application Lifecycle Management) integration.

解释 Tosca QC(质量中心)/ALM(应用生命周期管理)集成。
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e7d | 官方: 否 | 付费: 否

答案:

Tricentis Tosca's integration with Application Lifecycle Management (ALM) tools enables development and QA (Quality Assurance) teams to better collaborate and meet customer expectations. This integration serves as a means of managing test executions and defect management. In general, ALM is a test management tool used to manage the testing process, including test development, executing them, and tracking defects. ALM allows developers to monitor quality parameters and test results at any time, and the QA (Quality Assurance) team will have real-time insight into all development phases.

Tricentis Tosca 与应用程序生命周期管理(ALM)工具的集成,使开发和QA(质量保证)团队能够更好地协作并满足客户期望。这种集成是管理测试执行和缺陷管理的一种手段。一般来说,ALM 是一种测试管理工具,用于管理测试过程,包括测试开发、执行以及缺陷跟踪。ALM 允许开发人员随时监控质量参数和测试结果,而 QA(质量保证)团队将对所有开发阶段有实时了解。

The above shows Tosca integration with ALM tool. Thus, Tricentis Tosca will sync all requirements from the ALM tools, and all defects reported by the QA team will appear in the ALM tool.

以上显示了 Tosca 与 ALM 工具的集成。因此,Tricentis Tosca 将同步 ALM 工具中的所有需求,并且 QA 团队报告的所有缺陷都将出现在 ALM 工具中。

834. What are the ways we can use multiple browsers in Tosca for the same test case?

在 Tosca 中,对于同一个测试用例,有哪些方式可以使用多个浏览器?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e80 | 官方: 否 | 付费: 否

答案:

In Tosca, we are not able to trigger multiple browsers at once, but we can perform cross-browser execution. In order to automate TestCases with applications that have to run on different browsers, buffers can be used. The test configuration parameter can be changed at runtime using buffers, and the browser to be used can be specified using the TBox Set Buffer. The following steps need to be followed in order to perform cross-browser execution: - Design a Test Configuration Parameter “Browser”.

在 Tosca 中,我们无法同时触发多个浏览器,但我们可以执行跨浏览器执行。为了自动化必须在不同浏览器上运行的应用程序的 TestCases,可以使用缓冲区。测试配置参数可以在运行时使用缓冲区更改,并且可以使用 TBox Set Buffer 指定要使用的浏览器。为了执行跨浏览器执行,需要遵循以下步骤:- 设计一个测试配置参数“浏览器”。
  • Using the buffer, change the value of the Test Configuration Parameter to [B[Browser]].
  • Specify which browser should be used using the TBOX Set Buffer. Users have the option of selecting Internet Explorer, Firefox, Chrome, etc.
  • Executions will be triggered by individual browsers.

835. In Tosca Testsuite, how can you identify objects?

在 Tosca Testsuite 中,如何识别对象?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e83 | 官方: 否 | 付费: 否

答案:

In Tosca, objects can be identified in four different ways as listed below: - Identify by properties: By default, Tosca XScan identifies objects by their properties. All technical information and the properties of an object can be found in the Identify by Properties window.

在 Tosca 中,对象可以通过以下四种方式识别:- 按属性标识:默认情况下,Tosca XScan 通过属性来识别对象。所有技术信息和对象属性都可以在“按属性标识”窗口中找到。
  • Identify by Anchor: The technical properties of objects can be used in Tricentis Tosca to identify other objects.
  • Identify by image: Tosca can identify objects by capturing a screenshot of the object.
  • Identify by index: In this case, the object is identified by its index. If an object selected does not have a unique ID, you can specify an index to be used to identify the object at test execution.

836. What do you mean by Tosca Query Language?

Tosca 查询语言是什么意思?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e86 | 官方: 否 | 付费: 否

答案:

The Tosca Query Language (TQL) is a powerful way to search within your project. The tool gives you the ability to perform search queries on your project through objects, object relations, and object properties to find/search anything you need. Simply type your query into a language the computer understands and the system will do the rest. It gives you the ability to take control of a project at any time. In its most basic form, this is similar to SQL, which enables us to search based on conditions.

Tosca 查询语言(TQL)是在项目中搜索的强大方式。该工具使您能够通过对象、对象关系和对象属性在项目上执行搜索查询,以查找/搜索您需要的任何内容。只需将查询输入到计算机理解的语言中,系统将完成其余工作。它使您能够随时控制项目。在其最基本的形式中,这类似于 SQL,使我们能够基于条件进行搜索。

Example: Suppose the diagram below represents our current situation, in which we want to search for all TestCases with the name Data Source Excel in the TestCases folder.

示例:假设下面的图表代表我们当前的情况,我们想要在 TestCases 文件夹中搜索所有名称为 Data Source Excel 的 TestCases。

Solution:

解决方案:

=>SUBPARTS:TestCase[Name=="Data Source Excel"]

=>SUBPARTS:TestCase[Name=="Data Source Excel"]

837. How can we compare pdf files using Tosca?

如何使用 Tosca 比较 PDF 文件?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e89 | 官方: 否 | 付费: 否

答案:

TC PDF Compare is the standard module offered by Tosca for comparing PDF files. This TC PDF Compare feature from Tosca Exchange Portal allows the comparison of two PDF files. After the test is executed, any differences found appear in the ExecutionLog.

TC PDF Compare 是 Tosca 提供的用于比较 PDF 文件的标准模块。来自 Tosca Exchange Portal 的此 TC PDF Compare 功能允许比较两个 PDF 文件。测试执行后,发现的任何差异都会出现在 ExecutionLog 中。

838. Explain the importance of Rescan in Tosca?

解释 Tosca 中 Rescan 的重要性?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e8c | 官方: 否 | 付费: 否

答案:

In Tosca Rescan, the module that has already been scanned is scanned again. Assume you have already scanned the page, but there have been a few changes and two new fields have been added which you need to include in your test case. For the two fields to appear in your scanned modules and your test case, you need to rescan your module.

在 Tosca Rescan 中,已经扫描过的模块会再次被扫描。假设您已经扫描了页面,但发生了一些更改,并且添加了两个需要包含在测试用例中的新字段。为了使这两个字段出现在您的扫描模块和测试用例中,您需要重新扫描您的模块。

839. What do you mean by Synchronization in Tosca?

Tosca 中的同步是什么意思?
  • 知识点: 测试 / 行为与软技能 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: behavioral | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e8f | 官方: 否 | 付费: 否

答案:

Tosca's synchronization functionality allows automated test cases to be executed in accordance with the application speed using processes and events. Synchronization is when the automation tool speed synchronizes with the application speed. You can achieve sync in Tosca using ActionMode WaitOn. Synchronization settings can be modified via the settings - "Go to settings->TBox->synchronization" .

Tosca的同步功能允许自动化测试用例根据应用程序速度通过进程和事件来执行。同步是指自动化工具速度与应用程序速度同步。您可以使用ActionMode WaitOn在Tosca中实现同步。同步设置可以通过“设置->TBox->同步”进行修改。

840. What is the recovery scenario in Tosca? What happens if it fails?

什么是Tosca中的恢复场景?如果失败会发生什么?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e94 | 官方: 否 | 付费: 否

答案:

As its name implies, recovery scenarios are used to recover from the failure of a testcase/teststep. During test execution, if for some reason your test case fails (this could be any reason), the Recovery scenario ensures that the next test case after that failed test case will proceed normally. This will ensure that the following test case runs correctly, without any impact from the previous test case. There are two conditions in which recovery is possible i.e., dialog failure and verification failure. When a recovery scenario fails, Tosca then tries the next higher level recovery scenario, and if all recovery scenarios fail, it reports the test case as failed.

顾名思义,恢复场景用于从测试用例/测试步骤的失败中恢复。在测试执行期间,如果由于某种原因您的测试用例失败(可能是任何原因),恢复场景确保该失败测试用例之后的下一个测试用例能正常进行。这将确保后续测试用例正确运行,不受前一个测试用例的影响。恢复有两种可能条件,即对话框失败和验证失败。当恢复场景失败时,Tosca会尝试下一个更高级别的恢复场景,如果所有恢复场景都失败,则将该测试用例报告为失败。

841. What do you mean by Tosca CI (Continuous Integration) and how to implement it?

您所说的Tosca CI(持续集成)是什么意思,以及如何实施它?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: coding
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e97 | 官方: 否 | 付费: 否

答案:

With Tosca CI (Continuous Integration), test cases can be executed directly from the build server without the user having to perform/run them themselves (manually). Examples of CI tools include Jenkins, Bamboo, etc. It is used to minimize testing time and effort for Continuous Integration & Delivery. The following ways can be used to implement Tosca CI: - Use a remote service to run the test execution, i.e., on a separate workspace.

通过Tosca CI(持续集成),测试用例可以直接从构建服务器执行,无需用户自己(手动)执行/运行它们。CI工具的例子包括Jenkins、Bamboo等。它用于最小化持续集成和交付的测试时间和精力。可以使用以下方式实施Tosca CI:- 使用远程服务来运行测试执行,即在单独的workspace上。
  • Use Tosca Continuous Integration along with Tosca Distributed Execution. Your tests will be executed by several Distribution Agents, thereby speeding up the process.

842. How to fetch data from Excel using Tosca?

如何使用Tosca从Excel获取数据?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e9c | 官方: 否 | 付费: 否

答案:

There are two ways to fetch test data from Excel as follows: - In order to test a TestCase scenario on multiple datasets, Tosca provides a TemplateInstance feature. We can create as many test cases as necessary from a data set by using it. We can then import the data from Excel and embed it into the Test Case steps.

有两种从Excel获取测试数据的方法,如下所述:- 为了在多个数据集上测试TestCase场景,Tosca提供了TemplateInstance功能。通过使用它,我们可以从数据集创建尽可能多的测试用例。然后,我们可以从Excel导入数据并将其嵌入到测试用例步骤中。
  • For different TestCases and to import data from external sources, the Excel Engine module can be used.

843. Explain how to create a testcase template manually.

解释如何手动创建测试用例模板。
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7e58d557c902bc8e9f | 官方: 否 | 付费: 否

答案:

Tosca BI (Business Intelligence) modules can be used to create a TestCase template manually. In order to create and utilize your own TestCase templates, perform the following steps: - Step 1: Build a TestCase that meets your needs.

Tosca BI(商业智能)模块可用于手动创建TestCase模板。要创建和利用您自己的TestCase模板,请执行以下步骤:- 步骤1:构建满足您需求的TestCase。
  • Step 2: Right-click on the TestCase and choose "Convert to Template" from the context menu to convert it to a Template.
  • Step 3: Drag and drop the appropriate TestSheet onto your TestCase Template.

844. Explain how to instantiate testcases with Excel.

解释如何使用Excel实例化测试用例。
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7f58d557c902bc8ea2 | 官方: 否 | 付费: 否

答案:

When you instantiate a template, you convert a single testcase template into several test cases using the test data that you supply as input to the template. You must follow the steps below to instantiate TestCases in Excel: - The TestCase that is needed to be instantiated must be viewed as a template.

当您实例化模板时,您使用您作为输入提供给模板的测试数据,将单个测试用例模板转换为多个测试用例。您必须遵循以下步骤在Excel中实例化TestCases:- 需要实例化的TestCase必须被视为模板。
  • Parameters (values to be transferred from a template) must be linked to template attributes by specified syntax.
  • To create a TemplateInstance, right-click on the TestCase template and select Create TemplateInstance from the context menu.
  • You must specify the Excel file with the corresponding spreadsheet in the subsequent dialog box.
  • Click the OK button to confirm your inputs.
  • Once you click Yes in the subsequent dialog, the instantiation process will begin.
    In this way, Tosca creates a TestCase in the TemplateInstance for every TestCase defined in the template. The structure of the TestCase is the same as that of the corresponding TestCase in the template.

    按这种方式,Tosca会在TemplateInstance中为模板中定义的每个TestCase创建一个TestCase。TestCase的结构与模板中相应TestCase的结构相同。

845. Write down the steps to perform Tosca Connect and HP ALM (Application LifeCycle Management) Integration.

写出执行Tosca Connect和HP ALM(应用程序生命周期管理)集成的步骤。
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7f58d557c902bc8ea5 | 官方: 否 | 付费: 否

答案:

In order to integrate Tosca Connect with HP ALM, follow these steps: - Download and install ALM Rest API.

要将Tosca Connect与HP ALM集成,请遵循以下步骤:- 下载并安装ALM Rest API。
  • Install Tasktop on a test system using a license key.
  • Synchronize testcases from Tosca to HP ALM's Test Plan Module.
  • Sync Tosca execution lists with HP ALM's test lab modules.
  • Sync Tosca execution entry and latest test results with HP ALM's Test Lab/Test Run modules.

846. Explain how you will check whether a file exists or not in a specific directory in Tosca.

解释您将如何检查Tosca中特定目录中是否存在文件。
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7f58d557c902bc8eaa | 官方: 否 | 付费: 否

答案:

Tosca allows us to verify a file's existence in any directory by using the TBox File Existence. It includes the following attributes: - Directory: Location of the file to be verified.

Tosca允许我们通过使用TBox File Existence来验证任何目录中文件的存在性。它包括以下属性:- 目录:要验证的文件的路径。
  • File: Name of the file that needs to be verified.
    Conclusion

    结论

Tricentis Tosca is one of the best automation testing tools currently available on the market, which simplifies the work of software testers. Tosca automation tool automates software testing and makes it easier to find and fix bugs efficiently. Since then, it has developed into one of the biggest players in the automation field. So, securing a job as a Tosca specialist/expert is sure to guarantee you a successful career. Here is your chance if you are looking for Tosca Interview Questions and Answers for Freshers and Experienced.

Tricentis Tosca 是目前市场上最优秀的自动化测试工具之一,它简化了软件测试人员的工作。Tosca 自动化工具实现软件测试自动化,使高效发现和修复缺陷变得更加容易。此后,它已发展成为自动化领域最大的参与者之一。因此,获得 Tosca 专员/专家的职位必定能确保您拥有成功的职业生涯。如果您正在寻找适用于新手和有经验者的 Tosca 面试问题与答案,这就是您的机会。

Useful Resources: - Automation Testing

有用资源: - 自动化测试
  • Manual Testing
  • Automation Testing Tools
  • Manual Testing Tools

847. Explain how Model-based and Risk-based testing are supported by Tosca.

解释 Tosca 如何支持基于模型和基于风险的测试。
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7f58d557c902bc8eb1 | 官方: 否 | 付费: 否

答案:

Model-based testing and risk-based testing are two of the most commonly used technologies in Tricentis Tosca. - Model-based testing: Tricentis Tosca uses model-based testing instead of scripting for automation testing. This involves creating a model of the AUI (Application Under Test). A model (the lego blocks can be combined and reused across your tests) can be used to represent the intended behaviour of an AUT, as well as the testing strategy and the test environment. It is a simple and codeless approach that is easy for anyone to understand and use. Whenever a change is made to an application (e.g., adding or removing a field), you need only update the module once. These changes will be synchronized across all of the impacted test cases, saving you time and effort.

基于模型的测试和基于风险的测试是 Tricentis Tosca 中最常用的两种技术。 - 基于模型的测试:Tricentis Tosca 在自动化测试中使用基于模型的测试而非脚本。这涉及创建 AUI(被测应用程序)的模型。模型(乐高积木块,可在您的测试中组合和重用)可用于表示 AUT 的预期行为,以及测试策略和测试环境。这是一种简单且无代码的方法,任何人都容易理解和使用。每当应用程序发生更改(例如,添加或删除字段)时,您只需更新模块一次。这些更改将在所有受影响的测试用例中同步,从而节省您的时间和精力。
  • Risk-based testing: In the blink of an eye, defect-filled product releases can disrupt your business processes and damage your brand and customer trust. The problem is, traditional test approaches don't measure business risk as much as they focus on checking the total number of test cases run. The problem can be solved with Toca's risk-based test optimization, which maximizes the risk coverage while minimizing effort. Using this approach, you can reduce the number of tests you don't need by 40%, while increasing your application's risk coverage by 90% or more. In addition, you are able to identify which business-critical functions were successful or failed, enabling you to make faster and better decisions throughout the release cycle. As you can see in the below diagram, traditional testing approaches only cover 20% of risks and focus on the overall number of test cases run. In contrast, with risk-based testing, the goal is to maximize risk coverage and minimize testing and therefore risk coverage is 80%.

848. What are different business parameters in Tosca?

Tosca 中有哪些不同的业务参数?
  • 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c7f58d557c902bc8eb6 | 官方: 否 | 付费: 否

答案:

The reusable TestStepBlock usually consists of TestSteps that can be reused in a number of TestCases, meaning you don't have to rewrite as much code. In Reusable TestStepBlocks, business parameters display an overview of crucial business information. Business parameters can be used to set or pass dynamic values in test step blocks. You can create it simply by right-clicking on Reusable TestStep Block and choosing business parameters from the context menu. Business parameters can also be manually defined within the module in the following ways: - XML elements and attributes in the Payload tab.

可复用的 TestStepBlock 通常包含可在多个 TestCase 中复用的 TestStep,这意味着您不必重写大量代码。在可复用的 TestStepBlock 中,业务参数展示了关键业务信息的概览。业务参数可用于在测试步骤块中设置或传递动态值。您只需右键单击可复用的 TestStep Block 并从上下文菜单中选择业务参数即可创建它。业务参数也可以在模块内手动定义,方式如下: - Payload 选项卡中的 XML 元素和属性。
  • JSON data in the Payload tab.
  • Headers in the Headers list.
  • Parameters in the Params tab.
  • Transport information in requests.
  • Response time and Status code and in responses.

849. I successfully developed and executed a script, which I then saved to QC. When I tried to run the script from within QC, it didn't work. What could be the reasons?

我成功开发并执行了一个脚本,然后将其保存到了QC。当我尝试在QC中运行该脚本时,它没有正常工作。可能的原因是什么?
  • 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c8558d557c902bc91c4 | 官方: 否 | 付费: 否

答案:

The following points should be considered while checking for the reason for the failure of the script within QC: - To begin, install the QuickTest Add-In for Quality Center.

在检查脚本在QC中失败的原因时,应考虑以下几点:- 首先,安装Quality Center的QuickTest插件。
  • 'Allow other Mercury products to execute tests and components' should be selected in the QTP Tools -> Options -> run a tab.
  • Ensure that QTP is being executed as an administrator.
  • All test resources must be in the proper order.
    Conclusion

    结论

In this article, we have covered the most frequently asked interview questions on UFT. If you're writing code in an interview, don't forget to provide comments. Demonstrate good programming techniques. Before going to a QTP interview, make sure you know what version of QTP you're using, what add-ins you're using, what versions of other software you're using, and so on. It will take a couple of hours to re-familiarize yourself with QTP if you haven't used it in a while but have prior familiarity.

在本文中,我们涵盖了关于UFT的最常见面试问题。如果你在面试中编写代码,别忘了添加注释。展示良好的编程技巧。在参加QTP面试之前,确保你了解自己正在使用的QTP版本、正在使用的插件、其他软件的版本等。如果你有一段时间没使用QTP但之前熟悉它,重新熟悉它可能需要几个小时。

Useful Resources: - Top Testing Tools

有用资源:- 顶级测试工具
  • UiPath Interview Questions
  • Tosca Interview Questions
  • API Testing Interview Questions
  • Java Selenium Interview Questions
  • Technical Interview Questions
  • Coding Interview Questions

850. What do you understand about Object Spy in the context of UFT?

在UFT的上下文中,你如何理解Object Spy?
  • 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c8558d557c902bc91c7 | 官方: 否 | 付费: 否

答案:

Object Spy is a feature in UFT that allows you to see the properties and methods of both test and run-time objects. It also contains the syntax for a particular method. Object Spy displays the entire hierarchy of the object you've chosen. Object Spy is a tool that allows you to add objects to the Object Repository in QTP. The toolbar, as seen below, can be used to access Object Spy.

Object Spy是UFT中的一个功能,允许你查看测试对象和运行时对象的属性和方法。它还包含特定方法的语法。Object Spy显示你选择对象的整个层次结构。Object Spy是一个允许你将对象添加到QTP对象仓库的工具。如下所示的工具栏可用于访问Object Spy。

851. What are the various methods for launching an application in UFT?

在UFT中启动应用程序的各种方法有哪些?
  • 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c8558d557c902bc91cc | 官方: 否 | 付费: 否

答案:

Following are the different methods of launching an application: - SystemUtil.Run:

以下是启动应用程序的不同方法:- SystemUtil.Run:
Following is the syntax for using SystemUtil.Run
以下是使用SystemUtil.Run的语法

SystemUtil.Run ( FileName, Parameters, Path, Operation )

SystemUtil.Run ( FileName, Parameters, Path, Operation )
Example:
示例:

SystemUtil.Run("chrome.exe",http://www.google.com)

SystemUtil.Run("chrome.exe",http://www.google.com)
SystemUtil.Run("test.txt", "","C:\","1")
SystemUtil.Run("test.txt", "","C:\","1")
  • InvokeApplication:

We can also use the InvokeApplication command for launching an application.

我们也可以使用InvokeApplication命令来启动应用程序。
InvokeApplication "C:\Program Files\Google Chrome\CHROME.EXE http://www.google.com"
InvokeApplication "C:\Program Files\Google Chrome\CHROME.EXE http://www.google.com"
  • Using VB Script to create a shell object:

Example : We create a “WScript.shell” object.

示例:我们创建一个“WScript.shell”对象。
Dim testshell
Dim testshell
Set testshell= CreateObject ("Wscript.shell")
Set testshell= CreateObject ("Wscript.shell")
testshell.run "%windir%\paint"
testshell.run "%windir%\paint"

852. What do you understand about the Expert view and Keyword view in the context of UFT?

在UFT的上下文中,你对专家视图和关键字视图有何理解?
  • 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c8558d557c902bc91cf | 官方: 否 | 付费: 否

答案:

Expert view: Each line in the Expert View represents a VB Script Test Step. Consider the code below.

专家视图:专家视图中的每一行代表一个VBScript测试步骤。请考虑以下代码。

Dialog("Login").WinEdit("Site Name:").Set "InterviewBit"

Dialog("Login").WinEdit("Site Name:").Set "InterviewBit"
Following the Object Type, the name of an object is shown in parenthesis. Login is the object name, and Dialog is the object type. A "dot" separates objects in an Object Hierarchy. The Object Hierarchy of Dialog and WinEdit is the same in this case. To put things in context, Object Hierarchy is an Object Oriented Concept that refers to a collection of items that are linked in a parent-child connection. In our situation, the Parent Object is Dialog Box, and the Child Object is WinEdit. At the end of the statement, the operation done on the object is always printed, followed by any values associated with the operation. Using the Set Method, the term "InterviewBit" is placed in the Site Name Edit Box.
在对象类型之后,对象名称显示在括号中。Login是对象名称,Dialog是对象类型。在对象层次结构中,对象之间用“点”分隔。在这种情况下,Dialog和WinEdit的对象层次结构相同。为了将事物置于上下文,对象层次结构是一种面向对象的概念,指以父子关系连接的项的集合。在我们的示例中,父对象是对话框,子对象是WinEdit。在语句末尾,对对象执行的操作总是被打印出来,后跟与该操作相关联的任何值。使用Set方法,将术语“InterviewBit”放置在站点名称编辑框中。

The GUI object on which the operation is done, along with its whole hierarchy, is the syntax for a statement in expert view, followed by the Operation on the Object and the value associated with that Operation. This is shown as below:

在专家视图中,语句的语法是执行操作所针对的GUI对象及其整个层次结构,后跟对对象执行的操作和与该操作相关联的值。如下所示:

ParentObject(Name).ChildObject1(Name)...ChildObjectN(Name).Operation

ParentObject(Name).ChildObject1(Name)...ChildObjectN(Name).Operation
Keyword view: The Keyword View is a table-like view in which each step is represented by a single row in the table and each column by different sections of the steps. - The item on which you want to perform the step is listed in the Item Column. The hierarchy of the GUI item on which the operation is done is displayed in this column using icons.
关键字视图:关键字视图是一种类似表格的视图,其中每一步在表中由一行表示,每一步的不同部分由不同列表示。- 要执行步骤的项列在“项”列中。此列通过图标显示执行操作所针对的GUI项的层次结构。
  • The operation to be performed on the object is listed in the Operation Column.
  • The Value Column includes the argument values for the selected operation, while the Documentation Column describes each step for simple understanding.
  • These four columns are the defaults, however, assignment and comment columns can also be used in Keyword View.

853. What do you understand about virtual objects in the context of UFT? What are the limitations of the virtual objects in UFT?

在UFT的上下文中,你对虚拟对象有何理解?UFT中虚拟对象的限制是什么?
  • 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c8558d557c902bc91d2 | 官方: 否 | 付费: 否

答案:

Standard window objects may be present in an application under test, but UFT may not recognise them. In certain cases, objects of the type button, link, or other can be declared as virtual objects (VO) so that user actions can be mimicked on the virtual objects during execution.

被测应用程序中可能存在标准窗口对象,但 UFT 可能无法识别它们。在某些情况下,按钮、链接或其他类型的对象可以被声明为虚拟对象(VO),以便在执行期间在虚拟对象上模拟用户操作。

For example: Let's pretend we're automating a Microsoft Word scenario. We open the MS Word application and click on any of the ribbon icons. For example, on the Ribbon, the user selects the Insert tab, then selects the "Picture" button. Here, a button is recognised as a WinObject, emphasising the relevance of virtual objects.

例如:假设我们正在自动化一个 Microsoft Word 场景。我们打开 MS Word 应用程序并点击任何功能区图标。例如,在功能区上,用户选择“插入”选项卡,然后选择“图片”按钮。这里,一个按钮被识别为 WinObject,强调了虚拟对象的相关性。

Following are the limitations of virtual objects in UFT: - For analog or low-level recording, QTP does not allow virtual objects.

以下是 UFT 中虚拟对象的限制:- 对于模拟或低级录制,QTP 不允许使用虚拟对象。
  • Virtual Objects cannot have checkpoints added to them.
  • Object Repository has no control over Virtual Objects.
  • Although we map an object to a specific class (button or List), Virtual objects do not provide all of the original object's methods.
  • Virtual Objects are not supported by Object Spy.
  • If the screen resolution changes as the coordinates change, the test will fail.
  • Virtual objects should be recorded correctly if the application window is the same size as the screen.

854. Differentiate between UFT and Selenium.

区分 UFT 和 Selenium。
  • 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c8558d557c902bc91d5 | 官方: 否 | 付费: 否

答案:

  • UFT: Functional, regression, and service testing are the most common uses for the tool. UFT allows testers to automate user behaviours on a web or client-based computer application, as well as test and uncover defects that may arise as a result of such actions. This holds true for the identical operations performed on different people, data sets, Windows operating systems, and browsers. Automation with QTP/UFT, if properly planned and executed, can save a lot of time and money.
  • Selenium: Selenium is an open-source umbrella project providing a collection of web browser automation technologies and libraries. Without having to learn a test scripting language, Selenium provides a playback tool for building functional tests (Selenium IDE). It also includes a test domain-specific language (Selenese) for writing tests in JavaScript (Node.js), C#, Groovy, Java, Perl, PHP, Python, Ruby, and Scala. Most recent web browsers can then be used to run the tests. Selenium is available for Windows, Linux, and Mac OS X. It's free software distributed under the Apache License 2.0.

The following table lists the differences between UFT and Selenium:

下表列出了 UFT 和 Selenium 之间的区别:
| Unified Functional Testing (UFT) | Selenium |
It is a Micro Focus commercial tool, thus it requires a licence and is costly.
它是 Micro Focus 的商业工具,因此需要许可证且成本高昂。
It's an open-source testing tool, therefore there's no need for a licence and it's completely free.
它是一个开源测试工具,因此无需许可证且完全免费。
It's used for client-server application testing. It can test both web and desktop applications.
它用于客户端-服务器应用程序测试。它可以测试 Web 和桌面应用程序。
Only web applications can be automated with Selenium.
只有 Web 应用程序可以使用 Selenium 自动化。
Only the QTP IDE can be used to create QTP tests.
只能使用 QTP IDE 创建 QTP 测试。
Selenium can be used with a variety of IDEs, including Visual Studio, Eclipse, and Netbeans.
Selenium 可以与多种 IDE 一起使用,包括 Visual Studio、Eclipse 和 Netbeans。
Only VB scripts are supported by HP UFT.
HP UFT 仅支持 VB 脚本。
Selenium supports a wide range of programming languages, including Java,.NET, Ruby, Perl, PHP, and many others.
Selenium 支持广泛的编程语言,包括 Java、.NET、Ruby、Perl、PHP 等。
A built-in object repository is included with HP UFT. In HP ALM, creating and maintaining object repositories is a breeze.
HP UFT 包含内置对象库。在 HP ALM 中,创建和维护对象库非常容易。
Although Selenium lacks a built-in object repository, objects can be maintained using the UI element user extension.
虽然 Selenium 缺乏内置对象库,但可以使用 UI 元素用户扩展来维护对象。
HP UFT is compatible with test management software such as HP Quality Center.
HP UFT 与 HP Quality Center 等测试管理软件兼容。
Selenium is not compatible with any such test management software.
Selenium 与任何此类测试管理软件不兼容。
UFT Testing supports all forms of dialogue boxes.
UFT 测试支持所有形式的对话框。
It partially supports dialogue boxes.
它部分支持对话框。
It supports a variety of environments, including SAP, Oracle, and.NET, but users must acquire an add-on licence for each of them.
它支持各种环境,包括 SAP、Oracle 和 .NET,但用户必须为每个环境获取附加许可证。
It allows you to add plug-ins to provide functionalities that Selenium doesn't give by default.
它允许您添加插件以提供 Selenium 默认不提供的功能。
Because of the licencing fees, automation testing is costly.
由于许可费用,自动化测试成本高昂。
Selenium web automation testing is less expensive.
Selenium Web 自动化测试成本较低。
HP QTP provides excellent technical support.
HP QTP 提供出色的技术支持。
Because it is an open-source project, it receives no formal support.
由于它是开源项目,因此没有正式支持。
Only VBScript is supported by HP QTP. Hence Test Automation using an Object-Oriented Approach gets difficult.
HP QTP 仅支持 VBScript。因此,使用面向对象方法的测试自动化变得困难。
Selenium supports Object-Oriented Programming Languages such as Java.
Selenium 支持面向对象的编程语言,如 Java。
HP QTP is more user-friendly, and scripts may be written faster.
HP QTP 更用户友好,脚本编写速度更快。
It's a simple tool with limited capabilities. The development and maintenance of a script take more time.
它是一个功能有限的简单工具。脚本的开发和维护需要更多时间。
Backward compatibility has a lot of power. The most recent version of HP ALM supports code that was written five years ago.
向后兼容性非常强大。HP ALM 的最新版本支持五年前编写的代码。
In Selenium, the API evolves with each new Selenium release. As a result, test scripts must be modified.
在 Selenium 中,API 随每个新版本而演变。因此,测试脚本必须修改。

855. What are the different types of object repositories available in UFT?

UFT 中有哪些不同类型的对象库可用?
  • 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c8558d557c902bc91d8 | 官方: 否 | 付费: 否

答案:

Following are the different types of object repositories available in UFT: - Local Object Repository: The default object repository is the Local Object Repository. It is action-specific and can only be used for one action at a time. When the application is not time-sensitive, a local object repository is preferred. The Local Object Repository can't be utilised again. In the local object repository, you can do a variety of things, including -

以下是 UFT 中可用的不同类型的对象库:- 本地对象库:默认对象库是本地对象库。它特定于操作,一次只能用于一个操作。当应用程序对时间不敏感时,首选本地对象库。本地对象库不能重复使用。在本地对象库中,您可以执行各种操作,包括 -
On the application under test, highlight an object saved in a repository. Check to see if a specific object in your AUT is saved in the Object Repository. Objects can be cut, copied, pasted, modified, and deleted. If you mistakenly changed the value of a property, you can edit its description using the update function in the application. - Shared Object Repository: When an application is dynamic and object descriptions change frequently, a global or shared object repository is preferred. In automation projects, shared object repositories are more typically utilised than local object repositories. However, when compared to a local object store, it has higher maintenance and administration costs.
在测试中的应用程序上,突出显示存储在库中的对象。检查您的 AUT 中特定对象是否保存在对象库中。可以剪切、复制、粘贴、修改和删除对象。如果您错误地更改了属性值,可以使用应用程序中的更新功能编辑其描述。- 共享对象库:当应用程序是动态的且对象描述经常变化时,首选全局或共享对象库。在自动化项目中,共享对象库比本地对象库更常用。然而,与本地对象存储相比,它的维护和管理成本更高。

856. What do you understand about object repositories in the context of UFT? Explain how object identification works in UFT.

在 UFT 的上下文中,您对对象库有何理解?解释 UFT 中对象识别如何工作。
  • 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c8558d557c902bc91db | 官方: 否 | 付费: 否

答案:

UFT recognises an Object Repository as a collection of Test Objects and information for working on it. By default, when a user records a test, the objects and their properties are recorded. UFT will not be able to playback scripts until it understands objects and their properties. - Object Identification in UFT can be described in the following points:

UFT 将对象库识别为测试对象及其工作信息的集合。默认情况下,当用户录制测试时,会记录对象及其属性。UFT 只有在理解对象及其属性后才能播放脚本。- UFT 中的对象识别可以描述为以下几点:
  • For object identification, UFT employs "human-like" technology.
  • UFT tries to learn the properties of a GUI object on which an operation is performed during Record.
  • Micro Focus UFT compares the recorded object attributes to the real object properties available on-screen during run-time and uniquely identifies an object regardless of its location on the screen.
  • TEST Object is the name of the stored object and its characteristics.
  • The actual object available on the application under test during Run-Time is referred to as the Run-Time Object. This is the "Test Object Model" from Quick Tests.
  • The Object Repository stores information about the Test Objects.
  • Add-ins assist in informing Quick Test ahead of time about the nature of the object to be recorded, reducing the time spent learning its properties.

857. What are the different types of recording modes available in UFT? Is it possible to change between Recording modes while creating a Test?

UFT 中有哪些不同类型的录制模式?在创建测试时是否可以在录制模式之间切换?
  • 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: fullstack
  • id: 69b37c8558d557c902bc91de | 官方: 否 | 付费: 否

答案:

Following are the different types of recording modes available in UFT: - Context-Sensitive Recording Mode: Context-Sensitive Mode is another name for regular recording mode. It's the default recording mode, and it makes the most of Quick Test Professional's test object model. It recognises things in the app no matter where they are on the screen. It keeps track of the objects in your programme and the operations you make on them.

以下是 UFT 中可用的不同类型的录制模式:- 上下文敏感录制模式:上下文敏感模式是常规录制模式的另一个名称。它是默认录制模式,并充分利用 Quick Test Professional 的测试对象模型。无论对象在屏幕上的位置如何,它都能识别应用程序中的对象。它跟踪您程序中的对象以及您对其执行的操作。
  • Analog Recording Mode: Quick Test Professional records and tracks every movement of the mouse as you drag it around a screen or window in analogue recording mode. Analog recordings made by UFT are saved as Tracks in your test directory. It's handy for capturing operations that can't be captured at the object level. For instance, a signature is created by dragging the mouse. You may record in analogue mode in the following ways:
    In relation to the screen - Use the screen option when your analogue operation involves many screens, such as dragging and dropping an object from one window to another.

    相对于屏幕 - 当您的模拟操作涉及多个屏幕时,例如将对象从一个窗口拖放到另一个窗口,请使用屏幕选项。

In relation to the window - Use relative to a window when your analogue operation is limited to a single window. - Low-Level Mode: This mode allows you to record any object in your application, regardless of whether QTP recognises the object or operation. All run-time objects are recorded as Window or WinObject test objects in this mode, which records at the object level. It's utilised when you need to know the exact coordinates of an object for your tests. Hashmaps are a nice example, where clicking different portions of a picture lead to different URLs. This mode of recording is used when recording tests are done in an environment that QTP does not recognise. The x,y coordinates of any clicks are recorded in low-level mode. Analog and low-level recording use up more disk space than standard recording. Screen positions during recording and playback must be similar in both modes, or the script will fail. As a result, only use analog or low-level recording when the regular recording mode fails to adequately capture your operation. When recording objects or surroundings that QTP does not support, QTP will occasionally convert to low-level mode.

相对于窗口 - 当您的模拟操作仅限于单个窗口时,请使用相对于窗口的选项。- 低级模式:此模式允许您录制应用程序中的任何对象,无论 QTP 是否识别该对象或操作。在此模式下,所有运行时对象都被记录为 Window 或 WinObject 测试对象,它在对象级别进行录制。当您需要知道对象的精确坐标用于测试时,可以使用它。哈希映射是一个很好的例子,其中点击图片的不同部分会导致不同的 URL。当在 QTP 不识别的环境中录制测试时,使用此录制模式。在低级模式下记录任何点击的 x、y 坐标。模拟和低级录制比标准录制占用更多磁盘空间。录制和播放期间的屏幕位置在两种模式下必须相似,否则脚本将失败。因此,仅当常规录制模式无法充分捕获您的操作时才使用模拟或低级录制。当录制 QTP 不支持的对象或环境时,QTP 有时会转换为低级模式。
Yes, we can switch to Analog/Low-level mode in the middle of a recording, accomplish the task at hand, and then return to conventional recording. The Analog mode switch is only available when recording, not while editing.
是的,我们可以在录制中途切换到模拟/低级模式,完成手头任务,然后返回常规录制。模拟模式开关仅在录制时可用,在编辑时不可用。
0

评论

博主关闭了当前页面的评论
EN