本段 576 题 | 来源:fullstack + general + design | 知识点:测试
1. 使用单元测试(Unit Testing)有哪些优势?
- 知识点: 测试 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: unit-testing, quality, refactoring)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 695cc0351da553795622a7fb | 官方: 是 | 付费: 否
答案:
TL;DR单元测试能提升质量、方便重构、促进更好设计、提前发现 bug、形成文档,并降低修复成本。
单元测试(Unit Testing)在软件开发中有许多优势:
- 提升代码质量,使流程更敏捷
- 通过单元测试让重构更容易
- 帮助开发者做出更好的设计
- 更早发现软件缺陷
- 为项目开发者提供系统文档
- 由于更早移除 bug,可降低修复成本
2. 你使用过哪个单元测试库(Unit Testing Framework)来测试你的 Java 程序?
- 知识点: 测试 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: java, testing;标签: JUnit, TestNG, Mockito, PowerMock)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 6965de59fa809e6d38865245 | 官方: 是 | 付费: 否
答案:
答案在题目中没有提供答案,因此这里给出一个通用回答:常见的单元测试库包括 JUnit(最常用)、TestNG;配合 Mock 框架常用 Mockito/PowerMock 等。
3. @Before 和 @BeforeClass 有什么区别?
- 知识点: 测试 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: java, testing, junit;标签: @Before, @BeforeClass, JUnit4, JUnit5)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 6965de59fa809e6d38865249 | 官方: 是 | 付费: 否
答案:
答案在题目中没有提供答案,因此这里给出一个通用回答:在 JUnit 4 中,@Before 在每个测试方法执行前运行;@BeforeClass 在所有测试方法执行前只运行一次,且必须是 static 方法。对应到 JUnit 5 分别是 @BeforeEach 与 @BeforeAll(@BeforeAll 默认也要求 static,除非使用特定测试实例生命周期配置)。
4. 什么时候用assert。
- 知识点: 测试 / 编程语言基础 (主题: java, testing;标签: Assert, Debugging)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 6965e772fa809e6d388763b9 | 官方: 是 | 付费: 否
答案:
答案assertion(断言)在软件开发中是一种常用的调试方式,很多开发语言中都支持这种机制。在实现中,assertion(断言)就是在程序中的一条语句,它对一个boolean(布尔)表达式进行检查,一个正确程序必须保证这个boolean(布尔)表达式的值为true;如果该值为false,说明程序已经处于不正确的状态下,系统将给出警告或退出。一般来说,assertion(断言)用于保证程序最基本、关键的正确性。assertion(断言)检查通常在开发和测试时开启。为了提高性能,在软件发布后,assertion(断言)检查通常是关闭的。
5. 自动化测试有哪些好处?
- 知识点: 测试 / DevOps/云 (主题: automation-testing, quality, cicd;标签: Testing, Q36, DevOps)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 696601a7fa809e6d388a30d2 | 官方: 是 | 付费: 否
答案:
答案自动化测试的优势包括:测试更快更高效、覆盖范围更广、结果更准确一致。长期来看,它能通过可重复执行减少人工成本,并与CI/CD(持续集成/持续交付)配合,把质量校验做成可重复、可规模化的流程,支撑更高频发布。
6. 你如何确保工作准确无误?
- 知识点: 测试 / 行为与软技能 (主题: quality;标签: Accuracy, QA)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 696f1d03120fcc159116fa15 | 官方: 是 | 付费: 否
答案:
答案给出一套“质量门禁”:自检(边界条件/单位/口径)→交叉验证(第二数据源/抽样)→同伴复核→版本管理与可追溯(注释、计算过程、来源链接)。强调你会在提交前做“可复现”。
7. 测试用例包括哪些要素?
- 知识点: 测试 (主题: testing, qa, test-case;标签: 测试用例, 用例设计, QA基础)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 696f3925120fcc15911b7a12 | 官方: 是 | 付费: 否
答案:
答案一条完整测试用例通常包含:用例ID(标识符)/标题、需求/用户故事关联、前置条件(环境/权限/数据准备)、测试步骤(可复现、可执行)、测试数据、预期结果(可验证、可度量)、实际结果与状态(Pass(通过)/Fail(失败)/Blocked(阻塞))、优先级/严重性、作者与版本、备注(如依赖、截图链接)。核心原则是“别人照着做也能得到同样结果”。
8. 白盒测试和黑盒测试的区别是什么?
- 知识点: 测试 (主题: testing, white-box, black-box;标签: 对比题, 测试基础, 覆盖率)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 696f3945120fcc15911b9416 | 官方: 是 | 付费: 否
答案:
答案主要区别:1)视角:黑盒看输入输出与需求;白盒看代码结构与逻辑。2)依据:黑盒依据规格说明/用户场景;白盒依据源码/控制流/数据流。3)目标:黑盒发现功能缺失、接口/流程问题;白盒发现逻辑分支遗漏、边界处理、隐藏异常。4)阶段:黑盒常在系统/验收;白盒常在单元/组件层。5)度量:白盒可用覆盖率衡量,黑盒更关注需求覆盖与场景覆盖。
9. 你理解的软件测试一般经历哪些步骤?
- 知识点: 测试 / 操作系统与网络 (主题: testing, qa, process;标签: 测试流程, 敏捷测试, 缺陷管理)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 696f3949120fcc15911b96bd | 官方: 是 | 付费: 否
答案:
答案常见流程:需求评审与测试点提取 → 测试计划(范围、策略、资源、风险)→ 测试设计(用例/数据/检查表)→ 环境与数据准备 → 测试执行(功能/回归等)→ 缺陷提交与跟踪(复现、定位协助、验证修复)→ 回归与冒烟(确保关键路径稳定)→ 测试总结与报告(质量结论、风险、发布建议)。敏捷(Agile)里这些步骤会迭代进行,但逻辑不变。
10. 单元测试和系统测试的区别是什么?
- 知识点: 测试 (主题: testing, unit-test, system-test;标签: 系统测试, 端到端, 质量保障)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 696f3949120fcc15911b96cc | 官方: 是 | 付费: 否
答案:
答案单元测试在代码层验证局部逻辑,依赖可被Mock(模拟),关注覆盖率与快速反馈;系统测试在完整系统层验证端到端业务流程与非功能属性(兼容、性能、安全、可用性等),依赖真实组件/环境,关注需求与用户体验。简单说:单测“测一块”,系统测“测整套”,且系统测试更贴近上线风险。
11. 当你遇到一个 bug,你怎么去处理它?
- 知识点: 测试 (主题: testing, bug-tracking, regression;标签: 缺陷流程, Bug管理, 回归验证)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 696f3949120fcc15911b96d4 | 官方: 是 | 付费: 否
答案:
答案标准处理:1)确认可复现并最小化步骤;2)收集证据(日志/截图/时间点/版本/环境/请求ID(标识符));3)评估严重性与优先级(是否阻塞主流程、数据是否丢失、影响用户数);4)提交缺陷单(清晰标题+复现步骤+预期/实际+附件);5)跟踪状态并协助定位(提供更多信息或验证修复版本);6)修复后做验证与回归(相关功能、边界、历史缺陷);7)若是线上问题,补充复盘与预防(监控、告警、回滚/开关策略)。
12. 瀑布模型和螺旋模型的区别是什么?
- 知识点: 测试 (主题: testing, waterfall, spiral-model;标签: 过程模型, 风险驱动, 迭代开发)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 696f3952120fcc15911b9c5d | 官方: 是 | 付费: 否
答案:
答案瀑布模型(Waterfall Model)是线性阶段式:需求→设计→开发→测试→交付,变更成本高,适合需求稳定的场景;螺旋模型(Spiral Model)是迭代+风险驱动:每一圈包含目标设定、风险分析、开发验证、计划下一轮,强调尽早识别与降低风险,适合复杂或不确定性高的项目。对测试而言:瀑布测试更集中在后期,螺旋每轮都有验证活动与反馈闭环,风险可控但管理复杂度更高。
13. 软件测试中的验证(Verification)和确认(Validation)分别是什么意思?
- 知识点: 测试 (主题: testing, qa;标签: Verification, Validation, QA)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 6977267ca39c9c5c3a8a0e72 | 官方: 是 | 付费: 否
答案:
答案验证(Verification)关注“我们是否把产品做对了”,即软件是否符合需求规格与设计,常用静态方法如评审、走查、检查、静态分析(Static Analysis);确认(Validation)关注“我们是否做了对的产品”,即软件是否满足用户真实场景与期望,常用动态测试如功能/集成/系统/验收测试。两者互补:验证尽早发现缺陷,确认保证交付价值。
14. 白盒测试和黑盒测试有什么区别?
- 知识点: 测试 / UI/UX 设计 (主题: testing, qa;标签: White-box, Black-box, Test Design)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 69772680a39c9c5c3a8a124b | 官方: 是 | 付费: 否
答案:
答案白盒测试(White-box Testing)(结构测试)基于代码内部结构设计用例,测试路径、分支、条件、循环等,测试者需要了解源代码;黑盒测试(Black-box Testing)(功能测试)从外部行为出发,依据需求规格验证输入输出,不关心内部实现。白盒更擅长发现逻辑与覆盖缺陷,黑盒更贴近用户与需求验证。实际项目通常组合使用:黑盒保证功能正确,白盒提高覆盖与质量。
15. 常见的软件测试技术有哪些?(Black-box / White-box / Gray-box)
- 知识点: 测试 (主题: testing, qa;标签: Black-box, White-box, Gray-box)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 697729f6a39c9c5c3a8ab1ef | 官方: 是 | 付费: 否
答案:
答案常见测试技术包括:黑盒测试(Black-box Testing)从需求与规格出发验证输入输出,不关注实现细节,适合功能与验收;白盒测试(White-box Testing)基于代码结构设计用例,覆盖分支/路径/条件,需了解源码,适合单元与覆盖率提升;灰盒测试(Gray-box Testing)介于两者之间,测试者了解部分内部设计/数据结构,用于更高效地定位问题并设计更有针对性的用例。实际项目通常组合使用以兼顾需求正确性与代码质量。
16. 软件测试中的 Verification(验证)和 Validation(确认)分别是什么?
- 知识点: 测试 (主题: testing, qa;标签: Verification, Validation, V-Model)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 697729f6a39c9c5c3a8ab1f3 | 官方: 是 | 付费: 否
答案:
答案Verification(验证)关注“我们是否把产品做对了”,强调在不运行代码的情况下检查需求与设计是否正确,常见方式包括评审、检查、走查与静态分析(Static Analysis);Validation(确认)关注“我们是否做了对的产品”,通过运行系统做动态测试(功能/非功能)来验证是否满足用户与业务期望。在 V 模型(V-Model)中,开发阶段与测试阶段并行映射:需求对应验收测试(Acceptance Testing)、设计对应系统/集成测试、编码对应单元测试(Unit Testing);验证与确认相互补充,共同提升质量。
17. 单元测试在软件开发中有什么意义?
- 知识点: 测试 (主题: testing, ci;标签: Unit Test, Regression, CI)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 69772f6ba39c9c5c3a8b93ff | 官方: 是 | 付费: 否
答案:
答案单元测试(Unit Testing)验证最小可测试单元(函数/类)在各种输入下行为正确,能尽早发现缺陷、降低回归风险,并支持重构。它还能迫使代码更模块化(依赖可注入、边界更清晰),提升可维护性。工程上常与 CI 集成,提交即跑测试,保证主干质量稳定。
18. 什么是 Bug?
- 知识点: 测试 (主题: software-engineering, quality;标签: Bug, Defect, Testing)
- 类型: technical | 难度: easy | 子类型:
- 分类: fullstack
- id: 69773280a39c9c5c3a8d692e | 官方: 是 | 付费: 否
答案:
答案Bug 是软件中的缺陷或错误,导致程序行为偏离预期需求或规范,可能表现为功能错误、性能问题、安全漏洞或可用性问题。Bug 的来源包括需求理解偏差、边界条件遗漏、并发/时序问题、环境差异等。工程上通过代码评审、自动化测试、静态检查与监控告警等手段降低 Bug 进入生产的概率。
19. What is Agile testing?
什么是敏捷测试?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b978f0 | 官方: 否 | 付费: 否
答案:
Agile software development and provides fast feedback to ensure better and faster project outcomes. The basis for Agile Testing is continuous integration between development and testing from the beginning of the project. As opposed to being sequential (e.g. executed only after coding is complete), Agile testing is continuous. The product is enhanced with every new release, resulting in seamless management and higher satisfaction for customers. Agile testing focuses on finding and fixing errors as soon as possible, rather than waiting until the end of the project, and reducing the costs associated with fixing errors. By delivering high-quality products on time, this approach also results in a customer-centric approach.
敏捷软件开发并从项目一开始就提供快速反馈,以确保更好、更快的项目成果。敏捷测试的基础是从项目开始就在开发与测试之间进行持续集成。与顺序进行(例如,仅在编码完成后执行)不同,敏捷测试是持续进行的。每次新发布都会增强产品,从而实现无缝管理并提高客户满意度。敏捷测试侧重于尽早发现并修复错误,而不是等到项目结束,从而降低修复错误的成本。通过按时交付高质量产品,这种方法也体现了以客户为中心的理念。
20. What does the term Taskboard mean in Agile?
在敏捷中,术语“任务板”是什么意思?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b978f3 | 官方: 否 | 付费: 否
答案:
Basically, task boards are physical displays in which the user stories that make up the sprint backlog are displayed, along with their constituent tasks. Task boards are used by individuals, teams, and organizations to represent the work being done and to track its progress towards completion. Since they are so flexible, task boards are becoming a classic tool for project management. As illustrated below, it includes tasks in progress, completed tasks, as well as new upcoming tasks that may have been added to the backlog.
基本上,任务板是物理展示板,上面显示构成冲刺待办事项的用户故事及其组成任务。个人、团队和组织使用任务板来表示正在进行的工作并跟踪其完成进度。由于任务板非常灵活,它们正成为项目管理的经典工具。如下所示,它包含进行中的任务、已完成的任务以及可能已添加到待办事项中的新任务。
21. Explain Continuous testing.
解释持续测试。
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b978f6 | 官方: 否 | 付费: 否
答案:
Continuous testing (CT) is a methodology used in software development, where applications are continuously tested during the entire software development life cycle (SDLC) to determine whether a new release entails risks. CT is designed to provide critical feedback earlier on in the software development life cycle and to enable high-quality and faster deliveries. It extends and develops test automation strategies to address the increasing complexity and pace of development and delivery of modern applications.
持续测试(CT)是软件开发中使用的一种方法论,在整个软件开发生命周期(SDLC)中持续测试应用程序,以确定新版本是否带来风险。CT旨在在软件开发生命周期的早期阶段提供关键反馈,并实现高质量和更快速的交付。它扩展和发展了测试自动化策略,以应对现代应用开发和交付日益增长的复杂性和速度。
22. Why is it important to conduct daily stand-up meetings?
为什么进行每日站会很重要?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b978f9 | 官方: 否 | 付费: 否
答案:
As a team's huddle, daily stand-ups are the basis for Agile project management. Often referred to as the daily scrum, it keeps everyone on top of the team's progress and landscape by focusing on "we". Agile teams have daily standup meetings as part of their daily activities. They set a mutually convenient time for team meetings and meet every day to stay on top of all the pertinent information for improving project coordination.
作为团队的集合,每日站会是敏捷项目管理的基础。通常被称为每日scrum,它通过聚焦于“我们”来让每个人掌握团队进展和全局情况。敏捷团队将每日站会作为日常活动的一部分。他们为团队会议设定一个相互方便的时间,并每天开会,以掌握所有相关改进项目协调的信息。
- This facilitates effective communication between team members. Integrating effective communication concepts with face-to-face interaction into the team's culture fosters greater agility.
- Moreover, it aids in ascertaining roles and responsibilities in a concise and clear manner and prevents silos throughout the organization. Each team member is aware of the other's work and progress continuously, allowing transparency about project’s progress.
- By holding daily stand-ups, companies can adapt to changes and address issues that arise during the day-to-day operations of an organization or during the course of a project.
- It leads to a sense of shared goals, which is a key element to the team since, without shared objectives, there is only a group of individuals working together.
- Furthermore, regular team meetings facilitate knowledge transfer within the organization.
23. Explain Epic, User Stories, and Tasks.
解释Epic、用户故事和任务。
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b978fc | 官方: 否 | 付费: 否
答案:
- Epic: An epic is usually a large story that is difficult to accomplish in a single sprint. An epic is usually accomplished over the course of months. Epics are usually very broad in scope, lack details, and must be broken into smaller user stories before the story can be developed. Epic is often viewed as being the pinnacle of the work hierarchy. In cases where multiple epics share a common goal, they can be grouped into a still-broader business objective, called a theme.
- User Story: Basically, a User Story is a list of what needs to be done within a project. It's similar to a to-do list and is owned by the Scrum Product Owner. It provides the Scrum team with enough to get a sense of what the finished product should be like and to calculate an estimate for completion.
- Tasks: Each epic is followed by a set of user stories, and for these stories to become workable components, the Scrum team needs to identify and sort tasks. Depending on the complexity of the task, it can take a few hours to several hours (typically up to 12 hours). The task will be assigned to team members with the relevant skills and expertise. A story can only be considered complete when all tasks associated with it have been completed.
- Data Science
- All Events
- My Events
24. Explain Velocity in Agile Methodology.
解释敏捷方法论中的速度。
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b978ff | 官方: 否 | 付费: 否
答案:
In Agile Methodology, Velocity is a measure of the amount of work a team can accomplish during an iteration, and is frequently used by development teams to build accurate and effective timeframes. It is a simple calculation that measures how many units of work have been completed in a given period of time. There are several ways to measure units of work, such as story points, user stories, and engineer hours.
在敏捷方法论中,速度是衡量团队在一个迭代中能完成的工作量的指标,开发团队经常用它来构建准确有效的时间框架。这是一个简单的计算,衡量在给定时间段内完成了多少工作单位。衡量工作单位的方法有多种,例如故事点、用户故事和工程师工时。
From the chart above, it's clear that Sprint 5 was exceptionally productive - almost 40 story points were produced. Their average velocity is approximately 10 story points.
从上面的图表来看,很明显Sprint 5非常高效——几乎产生了40个故事点。他们的平均速度约为10个故事点。
25. What is the story point in Agile?
敏捷中的故事点是什么?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b97902 | 官方: 否 | 付费: 否
答案:
Agile story points are a metric for measuring the difficulty of implementing a user story, and therefore reflect the level of effort involved in implementing it. Story points are measures of the difficulty level of a story. It can be related to the risks, complexities, and efforts involved. An increasing number of story points will result in a greater effort. One popular method for estimating agile story points is to use Fibonacci sequences. In this series, each number represents the sum of the two preceding ones. The Fibonacci sequence begins with 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89... and so forth.
敏捷故事点是一种用于衡量实现用户故事难度的指标,因此反映了实现它所涉及的努力程度。故事点是衡量故事难度水平的单位。它可以与所涉及的风险、复杂性和工作相关。故事点数量增加将导致更大的工作投入。一种流行的估算敏捷故事点的方法是使用斐波那契数列。在这个数列中,每个数字代表前两个数字之和。斐波那契数列以0,1,1,2,3,5,8,13,21,34,55,89...等开头。
26. What is Sprint in Agile Methodology?
敏捷方法论中的Sprint是什么?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b97905 | 官方: 否 | 付费: 否
答案:
A sprint is defined as a short, time-limited period in which an agile team completes specific amounts of tasks or deliverables. Getting sprints right will help your agile team deliver better software with fewer headaches, since sprints are the basis of the scrum and agile methodologies. Typically, sprints don't last longer than a month. While some teams may prefer to work in two-week sprints, others may prefer working in weekly sprints.
Sprint被定义为一段简短、时间有限的时期,在此期间敏捷团队完成特定数量的任务或可交付成果。正确执行sprint有助于你的敏捷团队以更少的麻烦交付更好的软件,因为sprint是scrum和敏捷方法论的基础。通常,sprint的持续时间不超过一个月。虽然有些团队可能喜欢进行为期两周的sprint,但其他团队可能喜欢进行每周的sprint。
27. When should we use Agile Scrum Methodology?
我们何时应使用敏捷Scrum方法论?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b97908 | 官方: 否 | 付费: 否
答案:
Agile Scrum Methodology can be used in the following situations: - When the client isn't clear on what exactly they need.
敏捷Scrum方法论可用于以下情况:- 当客户不清楚他们确切需要什么时。
- When the client expects a quick delivery of the product.
- When the client does not provide all the requirements at once.
- For projects where requirements fluctuate frequently.
28. What is an Agile test plan?
什么是敏捷测试计划?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b9790b | 官方: 否 | 付费: 否
答案:
Agile test plans are very important documents that cover a variety of testing types carried out within an iteration, such as test data requirements, test environments, test infrastructure, and test results. In an agile model, test plans are written and updated for each new release. A typical agile test plan consists of the following: - Scope of Testing.
敏捷测试计划是非常重要的文档,涵盖迭代中进行的多种测试类型,如测试数据需求、测试环境、测试基础设施和测试结果。在敏捷模型中,测试计划为每个新版本编写和更新。一个典型的敏捷测试计划包括以下内容:- 测试范围。
- Test requirements, sprint objectives, and the scope of the task.
- New functionalities that are being tested.
- Testing levels or types based on feature complexity.
- Performance testing and load testing.
- Considerations related to infrastructure.
- Plan for mitigating or reducing risks.
- Resource allocation.
- Defining milestones and deliverables.
29. What is agile methodology in software development? Write its types.
什么是软件开发中的敏捷方法论?写出其类型。
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b9790e | 官方: 否 | 付费: 否
答案:
Known as Agile development methodologies, Agile is an iterative approach to software development projects. It focuses on delivering value to customers faster and with fewer headaches than traditional ways. In contrast to risking everything on one big launch, agile teams deliver work in incremental, but consumable, stages over time. Continuous evaluation of requirements, plans, and results allows teams to implement changes quickly. This approach aligns with the principles and values outlined in the Agile Manifesto.
敏捷被称为敏捷开发方法论,是一种针对软件开发项目的迭代式方法。与传统方式相比,它专注于更快地向客户交付价值,且麻烦更少。与在一次大型发布中押上一切不同,敏捷团队随时间以增量但可消费的阶段交付工作。对需求、计划和结果的持续评估使团队能够快速实施变更。这种方法与敏捷宣言中概述的原则和价值观相一致。
Below is a diagram that illustrates different types of Agile methodologies:
下面是一个展示不同敏捷方法论类型的图示:
30. What are the characteristics of a good Agile tester?
一个好的敏捷测试人员具有哪些特征?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b97911 | 官方: 否 | 付费: 否
答案:
Good agile test leads lay a strong foundation for fostering an agile working culture in any organization through the application of good agile practices. An Agile tester should possess the following qualities: - Focus on company goals and mission.
优秀的敏捷测试负责人通过应用良好的敏捷实践,为在任何组织中培养敏捷工作文化奠定坚实基础。敏捷测试人员应具备以下素质: - 专注于公司目标和使命。
- Effectively sharing project ideas.
- A better understanding of requirements and risks associated with changing requirements.
- Ability to prioritize work based on requirements.
- Communicate effectively with business associates and developers.
- Understand the results of testing and examine them for specific product or application behaviour.
- Testers must have coding skills.
- An analytical mindset for improving testing methods and varying scenarios.
- Demonstrating information clearly and concisely.
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万+职业规划
31. Explain the role and responsibilities of Agile testers.
解释敏捷测试人员的角色和职责。
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b97914 | 官方: 否 | 付费: 否
答案:
Agile testers are tasked with the following responsibilities: - Understand, implement, and update Agile test strategies.
敏捷测试人员负责以下职责: - 理解、实施和更新敏捷测试策略。
- Measure and report test coverage.
- Assure proper testing tool usage.
- Set up, manage, and use testing environments.
- Write and execute automated tests and report results to the team.
- Identify defects and resolve them with the team.
- Provide coaching and training to other team members.
- Schedule appropriate testing activities during release and iteration planning.
- Develop clear requirements for testability, consistency, and completeness through collaboration with developers and stakeholders.
- Active participation in daily stand-up meetings, story grooming sessions, and retrospective meetings of the teams.
- Propose and implement improvements.
- Assessing new agile metrics such as velocity, sprint burndowns, release burndowns, etc.
32. Describe the Agile testing life cycle.
描述敏捷测试生命周期。
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b97917 | 官方: 否 | 付费: 否
答案:
Unlike traditional development methodologies, agile development gives users flexibility through its iterative approach. An agile testing life cycle consists of the following five phases:
与传统开发方法论不同,敏捷开发通过其迭代方法为用户提供灵活性。敏捷测试生命周期由以下五个阶段组成:
- Impact Assessment: The impact assessment process is probably the most important phase of an agile testing life cycle, as during this process, the agile testers are expected to gather all the necessary information from all stakeholders involved in the project.
- Agile Testing Planning: Stakeholders and testers collaborate at this stage to schedule the testing process and deliverables.
- Release Readiness: Agile testers must test the feature in this phase to see if it meets our clients' expectations and is ready to go live.
- Daily Scrums: This will probably include a morning meeting to check the progress of testing and set goals for the day ahead.
- Test Agility Review: Test Agility Review is the final phase of the project in which a meeting is held with the stakeholders to assess the progress of the project and to determine whether the milestones have been reached or not.
33. What are the principles of Agile testing?
敏捷测试的原则有哪些?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b9791a | 官方: 否 | 付费: 否
答案:
Eight main principles underlie agile testing. They are as follows: - Practice of continuous testing: Agile teams continuously test their products to ensure that they are improving. It is carried out alongside development.
八个主要原则构成敏捷测试的基础。它们如下: - 持续测试实践:敏捷团队持续测试其产品,以确保它们在不断改进。这与发展同时进行。
- Feedback on an ongoing basis: Agile testing provides team members with ongoing feedback and ensures that the product meets its business objectives. Feedback is primarily focused on quality rather than requirements.
- Participation of the entire team: In agile methodologies, developers, business analysts, and testers all take part in the testing process.
- Speeding up feedback: Agile involves the business team during each iteration, resulting in faster feedback and a lower cost associated with repairing errors.
- Quality comes from clean code: Testing the software regularly allows issues and vulnerabilities to be detected and fixed during the same iteration, maintaining code integrity.
- Fewer Documentations: Agile testers use reusable checklists rather than long, bloated documents and concentrate on the essence of the test rather than on the incidental details.
- Test-Driven: Unlike conventional methodologies, agile testing involves testing during the actual implementation process.
- Client satisfaction: The client can see their product being developed and make changes and updates to it as it evolves. The test procedures can be updated to fit the current requirements.
34. What do you understand by Throughput in Performance testing?
在性能测试中,你如何理解吞吐量?
- 知识点: 测试 / 行为与软技能 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: behavioral | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99111 | 官方: 否 | 付费: 否
答案:
Throughput refers to the number of transactions per second that an application can handle under the influence of lot of users (load). The API needs to ensure that required throughput is met before it is deployed on production. We can identify this by performing the Load Testing of the APIs. We can do this by identifying multiple transactions of different priorities and check how many requests are successfully passed in acceptable time governed by the SLAs (Service Level Agreements) defined by us.
吞吐量指的是应用程序在大量用户(负载)影响下每秒能处理的交易数量。API需要在部署到生产环境之前确保满足所需的吞吐量。我们可以通过对API执行负载测试来确定这一点。我们可以通过识别不同优先级的多项交易,并检查在由我们定义的SLA(服务水平协议)所规定的可接受时间内成功通过的请求数量来实现。
35. What needs to be verified in API testing?
在API测试中需要验证什么?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99114 | 官方: 否 | 付费: 否
答案:
In API Testing, we send a request to the API and then we analyze the responses based on the following parameters:
在API测试中,我们向API发送请求,然后基于以下参数分析响应:
Data accuracy of the actual response with the expected response. 2. HTTP status codes of the resultant API. 3. Response time of the API. 4. Error codes if the APIs are expected to throw an error. 5. Authorization Details 6. Test non-functional specifications of the applications like security, performance, availability etc.
- 实际响应与预期响应的数据准确性。 2. 结果API的HTTP状态码。 3. API的响应时间。 4. 如果API预期抛出错误,则检查错误代码。 5. 授权详情 6. 测试应用程序的非功能性规范,如安全性、性能、可用性等。
36. What is API?
什么是API?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99117 | 官方: 否 | 付费: 否
答案:
API stands for Application Programming Interface that is useful for communication between different software systems. It facilitates data exchange between systems located in different remote places. They are nothing but a collection of functions that are executable by other functions of the software application.
API是应用程序编程接口(Application Programming Interface)的缩写,用于不同软件系统之间的通信。它促进位于不同远程位置系统之间的数据交换。它们本质上是一组可被软件应用其他函数执行的函数集合。
37. How do APIs work?
API如何工作?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9911a | 官方: 否 | 付费: 否
答案:
The general workflow of API is that it takes a request, processes it which might involve data validation, database interaction, data processing, and then the resultant of this is sent back to the source. APIs provide an abstraction to the internal business logic as they are not exposed to the world.
API的一般工作流程是:它接收请求,处理该请求(可能涉及数据验证、数据库交互、数据处理),然后将结果发送回源。API为内部业务逻辑提供抽象,因为这些逻辑不会对外暴露。
Examples of APIs: Amazon API, Google Map API, Twitter API, etc.
API的示例:Amazon API、Google Map API、Twitter API等。
38. What are the different types of API testing?
API测试有哪些不同类型?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9911d | 官方: 否 | 付费: 否
答案:
There are various types of API testing, they are: - Functional Testing
API测试有多种类型,它们包括: - 功能测试
- Unit Testing
- Load Testing
- Security Testing
- UI Testing
- Interoperability and WS compliance Testing
- Penetration Testing (Pen Test)
- Fuzz Testing.
- Data Science
- All Events
- My Events
39. What protocols can be tested using API Testing?
使用API测试可以测试哪些协议?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99120 | 官方: 否 | 付费: 否
答案:
API testing can be used for testing the following protocols: - HTTP
API测试可用于测试以下协议: - HTTP
- REST
- SOAP
- JMS
- UDDI
40. What are the most commonly used tools for API testing?
API测试最常用的工具有哪些?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99123 | 官方: 否 | 付费: 否
答案:
The most popularly used tool in the market is PostMan. This tool helps to create manual and automated test cases for testing the APIs in a well-designed manner. Apart from this, there are different tools like JMeter, Parasoft SOAtest, SoapUI, Apigee, API fortress, JUnit, etc.
市场上最常用的工具是PostMan。此工具有助于以设计良好的方式创建手动和自动化测试用例来测试API。除此之外,还有不同的工具,如JMeter、Parasoft SOAtest、SoapUI、Apigee、API fortress、JUnit等。
41. What are the differences between API Testing and Unit Testing?
API测试和单元测试有什么区别?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99126 | 官方: 否 | 付费: 否
答案:
| API testing API测试 | UNIT testing 单元测试 |
|---|---|
| This testing is owned by the Quality Analyst team. 此测试由质量分析师团队负责。 | This testing is owned by the developers working on the corresponding modules. 此测试由开发相应模块的开发人员负责。 |
| This belongs to the category of black box testing. 这属于黑盒测试类别。 | This belongs to white box testing. 这属于白盒测试。 |
| Full system functionality is considered in API testing as the API would be used by external developers. 在API测试中考虑完整的系统功能,因为API将被外部开发人员使用。 | As the name indicates, this testing verifies whether the unit of code works as expected or not in isolation. 正如名称所示,此测试验证代码单元是否按预期独立工作。 |
| In this testing, the testers do not have access to the internal source code and it focuses only on the functionality of the API. 在此测试中,测试人员无法访问内部源代码,且仅关注API的功能。 | The developers who work on developing unit test cases have access to the source code as they need to ensure the modules developed are passed before delivery. 开发单元测试用例的开发人员可以访问源代码,因为他们需要确保开发的模块在交付前通过测试。 |
42. What are the advantages of API Testing?
API测试有哪些优势?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99129 | 官方: 否 | 付费: 否
答案:
There are various advantages of API testing. Some of the most significant advantages are as follows: - Core Functionality Testing: This kind of testing provides access to the entire system without the need for a user interface. The functionalities of the application would be evaluated end-to-end without the need for GUI (Graphical User Interface) which helps in detecting issues that can prove to be bigger at the time of GUI testing.
API测试有多种优势。一些最显著的优势如下: - 核心功能测试:此类测试无需用户界面即可访问整个系统。应用的功能将在无需GUI(图形用户界面)的情况下进行端到端评估,这有助于检测在GUI测试时可能被证明更大的问题。
- Time and Cost Effectiveness: This is usually less time-consuming when compared to GUI testing. It also requires less code for testing the functionalities thereby making it easier to set up and get faster access to test coverage. It also results in effective cost savings for the project.
- Language-Independent: The data transfer between the test platform to the applications is done utilizing XML or JSON and is completely independent of the languages used in developing the systems. The test automation suite can be developed in any language.
- Ease of Integration with GUI: API testing provides highly flexible test suites that help in easier integration with the GUI tests. For instance, before the GUI test cases are initiated, employing API test cases, we can create sample users that can act as an initial base for the GUI tests.
43. What is the approach followed in API Testing?
API测试遵循的方法是什么?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9912c | 官方: 否 | 付费: 否
答案:
We follow the below approaches in API Testing: - Firstly, write required test cases for testing the APIs by making use of different testing techniques like equivalence class, boundary value analysis etc that helps to verify the functionalities.
我们在API测试中遵循以下方法:首先,利用等价类、边界值分析等不同测试技术编写必要的测试用例来测试API,这有助于验证功能。
- Clearly define the scope and functionality of the APIs.
- Define the different input parameters that you want to test the API with.
- Verify the test cases by passing the input parameters.
- Compare the results of the different test cases based on their expected behavior.
- Also subject the API to different conditions depending on the description of the functionality.
44. What is API testing ?
什么是API测试?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9912f | 官方: 否 | 付费: 否
答案:
API testing is a category of software integration testing that deals with the testing of Application Programming Interfaces (APIs) directly. It deals with checking if the APIs developed work as expected in terms of reliability, functionality, security, and performance of the business logic covered by the applications.
API测试是软件集成测试的一个类别,直接涉及对应用程序编程接口(API)的测试。它旨在检查开发的API在可靠性、功能性、安全性以及应用程序所涵盖业务逻辑的性能方面是否符合预期。
45. What are the best practices that need to be followed for writing test cases?
编写测试用例时需要遵循哪些最佳实践?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99132 | 官方: 否 | 付费: 否
答案:
- We need to write test cases that correspond with the perspective of end-users.
- Steps defined in the test cases needs to be simple so that anyone can replicate the steps.
- Ensure that the test cases are reusable.
- Define and set the priority of test cases.
- Provide a valid description, test input parameters, test data, expected outcome after running the test cases so that we can compare the actual outcomes of the test cases with the expected ones.
- Make sure to develop test cases that cover negative test scenarios too.
- Naming conventions need to be properly followed while developing test cases.
- Review them regularly and update them as and when the functionality gets updated.
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万+职业规划
46. What do you understand by Black Box Testing?
你对黑盒测试的理解是什么?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99135 | 官方: 否 | 付费: 否
答案:
Black Box Testing is one of the methods in software testing where the testers evaluate the software functionality without the knowledge of the internal source code. This ideology can be applied in every branch of testing such as unit testing, integration testing, system testing and acceptance testing.
黑盒测试是软件测试中的一种方法,测试人员在不了解内部源代码的情况下评估软件功能。这种理念可应用于测试的各个分支,如单元测试、集成测试、系统测试和验收测试。
47. Define Test Data.
定义测试数据。
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99138 | 官方: 否 | 付费: 否
答案:
Test data is the input data used by the testers to execute their test cases. This data can be prepared either manually or by making use of tools. For instance, to test the login functionality of an application, testers would need input data such as username and password which constitutes the test data.
测试数据是测试人员用来执行测试用例的输入数据。这些数据可以手动准备,也可以借助工具准备。例如,要测试应用程序的登录功能,测试人员需要用户名和密码等输入数据,这些就构成测试数据。
48. Define test coverage.
定义测试覆盖率。
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9913b | 官方: 否 | 付费: 否
答案:
Test coverage is a measure that signifies the amount of testing performed by making use of our test cases. It can be either functional testing or non-functional testing of the application. This provides a fair idea about what the testers need to cover in their test cases.
测试覆盖率是一种衡量指标,表示通过使用测试用例所执行的测试量。它可以涉及应用程序的功能测试或非功能测试。这为测试人员了解其测试用例中需要覆盖的内容提供了合理思路。
49. Does the API tester need to have coding knowledge to perform API testing?
API测试人员是否需要有编码知识才能执行API测试?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9913e | 官方: 否 | 付费: 否
答案:
API testing covers manual and automated testing. Manual testing does not require a tester to know to code. We just need API request details, headers, payload, credentials and know how to use the tools required to test the system. But in the case of automated testing, a tester needs to know how to code to automate test cases and develop a sophisticated optimised test suite.
API测试涵盖手动和自动化测试。手动测试不要求测试人员会编码。我们只需要API请求详情、请求头、有效载荷、凭据,并知道如何使用测试系统所需的工具。但在自动化测试的情况下,测试人员需要知道如何编码,以便自动化测试用例并开发出复杂且优化的测试套件。
50. What is the process of API Specification Review?
API规范审查的过程是什么?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99141 | 官方: 否 | 付费: 否
答案:
API Specification Review is the first and foremost step of documentation of the API testing needs and requirements. It should clearly state the purpose of the API, the application workflow and its features along with all other required details which could possibly help to plan the API testing process smoothly.
API规范审查是API测试需求和文档化的首要步骤。它应清晰说明API的目的、应用程序工作流程及其功能,以及所有其他可能有助于顺利规划API测试过程的必要细节。
51. What is Latency in API testing?
在API测试中什么是延迟?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99144 | 官方: 否 | 付费: 否
答案:
Latency refers to the response time or the delay taken by the request to reach the server. We need to ensure that the latency involved in reaching the server is minimum as higher the latency, greater is the impact in the application’s speed and performance.
延迟指的是请求到达服务器所花费的响应时间或延迟时长。我们需要确保到达服务器的延迟尽可能小,因为延迟越高,对应用程序速度和性能的影响就越大。
52. What is automation testing?
什么是自动化测试?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a8f3 | 官方: 否 | 付费: 否
答案:
Automation testing is a software testing strategy in which a tester programmatically runs the tests using a tool or a framework instead of manually going through the test cases and executing them one by one.
自动化测试是一种软件测试策略,其中测试人员使用工具或框架以编程方式运行测试,而不是手动逐个执行测试用例。
The primary goal of automated testing is to save time, effort, and money on repetitive tests that don’t change frequently.
自动化测试的主要目标是节省时间、精力和金钱,用于那些不经常变化的重复性测试。
Automation testing helps teams and organizations automate the testing efforts, in turn reducing the need for human intervention and thus achieving greater speed, reliability, and efficiency. It also helps speed up the development cycle, as the developers get quick feedback and can iterate quickly.
自动化测试帮助团队和组织自动化测试工作,从而减少人工干预的需求,进而实现更高的速度、可靠性和效率。它还帮助加快开发周期,因为开发人员能快速获得反馈并迅速迭代。
53. What is the test automation pyramid?
什么是测试自动化金字塔?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a8f6 | 官方: 否 | 付费: 否
答案:
Martin Fowler was the original creator of the test automation pyramid, which was introduced in 2012. It is a strategy for determining how to make the most effective use of the numerous kinds of testing automation available. The basic tenet of the test pyramid is to have a large number of user interface (UI) unit tests and a small number of complete UI tests.
Martin Fowler 是测试自动化金字塔的原创者,该概念于2012年提出。它是一种策略,用于确定如何最有效地利用各种可用的测试自动化。测试金字塔的基本原则是拥有大量用户界面(UI)单元测试和少量完整的UI测试。
The testing of user interfaces is a delicate process. The way that user interfaces are designed is undergoing fast change. An update to the software has a high potential of breaking several tests, which will require the team to update them. The testing of the user interface adds additional time to the building process. As long as you have the licence for the GUI testing tool, you can accomplish this task with as few as two or three PCs.
用户界面的测试是一个细致的过程。用户界面的设计正在快速变化。软件更新很有可能破坏多个测试,这将要求团队更新它们。用户界面的测试增加了构建过程的时间。只要你拥有GUI测试工具的许可证,你可以用最少的两三台电脑完成这项任务。
For this reason, the test pyramid recommends adding additional automated unit tests in addition to the standard ones that focus on UI automation. Additionally, it offers a service testing layer in the middle, which removes the need to deal with UI frameworks while still providing many of the same benefits as complete end-to-end UI tests. These tests can yield many of the same advantages as full end-to-end UI tests.
因此,测试金字塔建议在标准测试之外添加额外的自动化单元测试,并专注于UI自动化。此外,它在中间提供了一层服务测试,这消除了处理UI框架的需求,同时仍提供与完整端到端UI测试相同的许多好处。这些测试可以带来与完整端到端UI测试类似的许多优势。
54. What are some of the best practices in test automation?
测试自动化中的一些最佳实践是什么?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a8f9 | 官方: 否 | 付费: 否
答案:
Here are some of the best practices a software development and the testing team should use to ensure quality software. - Decide what to automateIt’s not possible or practical to automate certain tests, such as usability, accessibility, exploratory testing, or non-repetitive test cases that frequently change.
以下是一些软件开发团队和测试团队应采用的确保软件质量的最佳实践。- 决定自动化哪些内容:对某些测试进行自动化可能不可行或不实际,例如可用性测试、可访问性测试、探索性测试或频繁变化的非重复性测试用例。
- Assign test cases based on skill and experienceWhen dividing test cases, take into account the skills and experience of the tester and the complexity and severity of the feature under test.
- Removing UncertaintyThe whole goal of test automation is to have reliable, accurate, consistent tests that provide helpful feedback to the tester. If the tests fail due to bugs in the test itself, or it’s giving false positives, then the ROI on test automation starts decreasing.
- Choosing the right frameworks and toolsThere are a lot of tools to perform automation testing. Picking the wrong tool for the test at hand will waste time and provide false confidence to release software that may fail in production.
Keeping test records in a bug database
Using a bug database is a best practice whether a team uses test automation or not. Whenever new bugs are found by the automation tool or by the testers, they should be recorded in a bug tracking tool with the exact steps to reproduce the bugs and other details.无论团队是否使用测试自动化,使用缺陷数据库都是一种最佳实践。当自动化工具或测试人员发现新缺陷时,应记录在缺陷跟踪工具中,包括复现缺陷的确切步骤和其他细节。
55. What is automated regression testing?
什么是自动化回归测试?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a8fc | 官方: 否 | 付费: 否
答案:
Software is never done. The developers are constantly adding new features, functions, fixing bugs, and so on. There is a chance that all this new code might break the existing functionality that was working.
软件永远不会完成。开发人员不断添加新功能、新特性、修复缺陷等等。所有这些新代码有可能破坏原本正常工作的现有功能。
Users dislike using a product that is broken after they download and install a new release. They expect a consistent and reliable experience from the software, no matter which version they are using. They also expect that previously working features will keep on working and won't break in the future.
用户不喜欢在下载和安装新版本后感到产品被破坏。他们期望软件无论使用哪个版本,都能提供一致且可靠的体验。他们还期望以前能正常工作的功能继续正常工作,不会在未来被破坏。
Regression testing is a testing technique where a tester makes sure that the new features didn't break any existing functionality. Its goal is to ensure that previously developed and tested functionality still works after adding new code. When a tester performs the regression testing automatically using testing frameworks and tools, it's known as automated regression testing.
回归测试是一种测试技术,测试人员确保新功能没有破坏任何现有功能。其目标是确保添加新代码后,之前开发并测试过的功能仍然正常工作。当测试人员使用测试框架和工具自动执行回归测试时,这就是自动化回归测试。
In automated regression testing, a tester runs the suite of regression tests after each new release of the software. If the tests pass, then the tester continues with other types of testing. However, if it fails, then there is no point in further proceeding with tests until the developers fix the broken regression tests. Hence, they also act as a time-saver for the tester and ensure quality in software before shipping it.
在自动化回归测试中,测试人员在每次软件新版本发布后运行回归测试套件。如果测试通过,测试人员将继续进行其他类型的测试。然而,如果测试失败,那么在开发人员修复破坏的回归测试之前,继续测试没有意义。因此,它们也为测试人员节省时间,并确保软件在发布前质量有保证。
56. Why do you need cross-browser testing?
为什么你需要跨浏览器测试?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a8ff | 官方: 否 | 付费: 否
答案:
With web applications, you can’t guarantee the browsers/platforms/devices your users might use to access your software. Some users could be using Google Chrome on their Android phones, some might use Firefox on a Windows desktop machine, or others could use Safari on their Macbooks.
对于 Web 应用,你无法保证用户可能使用哪些浏览器、平台或设备来访问你的软件。有些用户可能在其安卓手机上使用谷歌 Chrome,有些可能在其 Windows 桌面机上使用 Firefox,或者其他人可能在其 Macbook 上使用 Safari。
Cross-browser testing ensures that your web application works as expected on different versions of popular browsers on multiple platforms and devices. It ensures that the users get the same experience and features irrespective of which browser they use. It helps to reach a wide range of users, allows the users to switch browsers and devices, and still get the same user experience, increasing customer satisfaction and building a loyal user base.
跨浏览器测试确保你的 Web 应用在多个平台和设备上的流行浏览器不同版本中按预期工作。它确保用户无论使用哪种浏览器都能获得相同体验和功能。这有助于覆盖广泛的用户群,允许用户切换浏览器和设备,同时仍享受相同用户体验,从而提高客户满意度并建立忠诚的用户基础。
57. What is cross-browser testing?
什么是跨浏览器测试?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a902 | 官方: 否 | 付费: 否
答案:
With web applications, you don’t know in advance which browsers your users will use. Hence, it’s crucial to test the web application or the website on multiple major browsers running on different operating systems.
对于 Web 应用,你无法提前知道用户会使用哪些浏览器。因此,在不同操作系统上运行的多个主要浏览器中测试 Web 应用或网站至关重要。
Cross-browser testing is a type of browser automation testing where the tester verifies if the web application will work smoothly on different browsers. Some of the popular browsers include Google Chrome, Mozilla Firefox, Internet Explorer, Safari, etc.
跨浏览器测试是一种浏览器自动化测试类型,其中测试人员验证 Web 应用是否能在不同浏览器中顺畅工作。一些流行的浏览器包括谷歌 Chrome、Mozilla Firefox、Internet Explorer、Safari 等。
The goal of the cross-browser testing is to launch the application on various browsers running on different operating systems, e.g. Windows, Mac OS, Linux, etc., and verify that the application works as expected. The tester looks for the design/rendering issues, the functionality of the application, and device-specific functionality.
跨浏览器测试的目标是在不同操作系统(例如 Windows、Mac OS、Linux 等)上运行的多种浏览器中启动应用,并验证应用是否按预期工作。测试人员检查设计/渲染问题、应用功能以及设备特定功能。
Though it can be typically, sophisticated tools exist that allow the testers to automate cross-browser testing. Some examples include Selenium Box, BrowserStack, Browsershots, LambdaTest, etc.
尽管通常可以手动进行,但存在复杂工具允许测试人员自动化跨浏览器测试。一些示例包括 Selenium Box、BrowserStack、Browsershots、LambdaTest 等。
58. What is browser automation?
什么是浏览器自动化?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a905 | 官方: 否 | 付费: 否
答案:
Browser automation is the technique of programmatically launching a web application in a browser and automatically executing various actions, just as a regular user would. Browser testing gives you the speed and efficiency that would be impossible for a human tester. Protractor, Cypress, and Selenium are some of the popular tools used in-browser testing.
浏览器自动化是通过编程方式在浏览器中启动 Web 应用并自动执行各种操作(就像普通用户一样)的技术。浏览器测试提供人类测试人员无法达到的速度和效率。Protractor、Cypress 和 Selenium 是浏览器测试中一些流行的工具。
Some of the activities performed in browser automation are as follows: - Navigate to the application URL and make sure it launches
浏览器自动化中执行的一些活动如下:- 导航到应用 URL 并确保其启动
- Test the various links on the web page and ensure they are not broken.
- Keep a record of the broken links on the page.
- Perform load and performance testing on your web application.
- Launch multiple instances of the browsers with different test users and ensure that concurrent actions work as expected.
59. What is a test environment?
什么是测试环境?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a908 | 官方: 否 | 付费: 否
答案:
A test environment is a computer or a server on which a tester tests the software. After the team builds the software, the tester installs it on this computer with all its dependencies, just like the production environment. This allows the tester to test the software in a real-world scenario.
测试环境是一台计算机或服务器,测试人员在其上测试软件。团队构建软件后,测试人员将其及其所有依赖项安装在这台计算机上,就像生产环境一样。这使得测试人员能在真实世界场景中测试软件。
A test environment enables the tester to create reliable test setups which are identical whenever a new version of the software is released. The test environment includes the test bed, which is the test data using which the tester will test the software. This data helps the tester to verify test cases that need a particular setup.
测试环境使测试人员能创建可靠的测试设置,这些设置在每次发布软件新版本时保持一致。测试环境包括测试台,即测试人员将用于测试软件的测试数据。这些数据帮助测试人员验证需要特定设置的测试用例。
Typically, the test environment is an identical copy of the production environment. Having a duplicate copy allows the tester to reliably reproduce the bugs reported by the customers and provide the exact steps to the developers to fix them.
通常,测试环境是生产环境的完全相同副本。拥有重复副本允许测试人员可靠地重现客户报告的缺陷,并向开发人员提供准确的修复步骤。
Here are some prerequisites for a good test environment:
以下是良好测试环境的一些先决条件:
A server with a similar configuration, including the software and the hardware to match a production environment. 2. Sample test data with which to test the software. 3. Test database with reasonably realistic data, it can be a copy of an actual production database. 4. Installed software under the test.
- 具有类似配置的服务器,包括软件和硬件,以匹配生产环境。2. 用于测试软件的示例测试数据。3. 包含合理真实数据的测试数据库,可以是实际生产数据库的副本。4. 在测试下安装的软件。
60. Should you automate all testing?
你应该自动化所有测试吗?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a90b | 官方: 否 | 付费: 否
答案:
Although test automation has its advantages, it is not practical to automate all kinds of testing. Some testing can be done only by a human tester, such as user interface testing, usability, and accessibility testing.
尽管测试自动化有其优势,但自动化所有类型的测试并不实际。某些测试只能由人工测试员完成,例如用户界面测试、可用性和可访问性测试。
Exploratory testing is another type of testing where a human tester provides more value than an automated test. In exploratory testing, a tester explores the software randomly, just as an end-user would do, and tries to find the bugs or UI inconsistencies or any hidden problems that developers might have overlooked.
探索性测试是另一种测试类型,其中人工测试员比自动化测试提供更多价值。在探索性测试中,测试员像最终用户一样随机探索软件,并尝试发现开发人员可能忽略的缺陷、UI不一致性或任何隐藏问题。
Automated testing is helpful for large projects involving complicated calculations and for repeatable test cases. For features that change often and rarely executed test cases, a human tester provides a bigger ROI than automation would.
自动化测试对于涉及复杂计算的大型项目和可重复的测试用例很有帮助。对于频繁变化的功能和很少执行的测试用例,人工测试员比自动化提供更大的投资回报率。
61. What are the different parts of a test automation framework?
测试自动化框架的不同部分有哪些?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a90e | 官方: 否 | 付费: 否
答案:
A test automation framework makes it easy to perform automation testing for your software. Here are some components of a test automation framework.
测试自动化框架使您能够轻松地为软件执行自动化测试。以下是测试自动化框架的一些组件。
- Test Data ManagementA big problem in automation testing is generating the test data. A good test automation framework makes it easy to build test data for the application under test.
Testing Libraries
Managing and running the automated tests is a crucial component of any automated testing strategy. A test automation framework provides libraries that make test management easy.管理和运行自动化测试是任何自动化测试策略的关键组成部分。测试自动化框架提供使测试管理变得容易的库。
A good test automation framework provides support for unit tests, integration tests, and end-to-end tests.
一个好的测试自动化框架支持单元测试、集成测试和端到端测试。Testing Tools
Includes any GUI or command-line tools that make it convenient for testers to run the set of tests repeatedly.包括任何图形界面或命令行工具,使测试员能够方便地重复运行测试集。
It also consists of tools that enable testing the software under high load to conduct performance testing.
它还包括用于在高负载下测试软件以进行性能测试的工具。
62. How do you choose a tool/framework for automated testing?
您如何选择用于自动化测试的工具/框架?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a911 | 官方: 否 | 付费: 否
答案:
To perform any automation testing, you need to rely on software tools or frameworks. There are plenty of options to choose from many alternatives.
要执行任何自动化测试,您需要依赖软件工具或框架。有许多备选方案可供选择。
Here are some criteria based on which one can evaluate these tools. - Programmable (code-based) or code-less tools. Some tools require programming skills, while some don’t, allowing a non-coder tester to create test cases with visual assistance. Depending on your team’s experience and skill-set, you should choose accordingly.
以下是一些基于这些标准评估这些工具的准则。- 可编程(基于代码)或无代码工具。一些工具需要编程技能,而有些不需要,允许非编码测试员通过视觉辅助创建测试用例。根据您团队的经验和技能组合,您应该相应选择。
- Commercial vs. Open Source. There’s a vast variety in the pricing of the tools based on the feature they have. Commercial tools can be expensive, but you get tech support when needed. Open-source software is free, but you have to do your research when troubleshooting the problems.
Ease of use. Some automated testing tools are notoriously hard to use and require extensive training before providing any value. Some are easy to use, and you can start using them out-of-box.
Some of the most popular automation tools include Selenium, Katalon Studio, UFT, TestComplete, Testim, etc., and many more. When choosing one, you should consider the testing requirements for your project, consult your team, and assess their skills, experience, and comfort with the tool.一些最流行的自动化工具包括Selenium、Katalon Studio、UFT、TestComplete、Testim等,还有很多。在选择时,您应考虑项目的测试需求,咨询团队,并评估他们的技能、经验和对工具的熟悉程度。
You should also periodically assess the return on investment from the tool you choose and be prepared to switch if needed.
您还应该定期评估所选工具的投资回报率,并在需要时准备更换。
63. When will you avoid automated testing?
你什么时候会避免自动化测试?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a914 | 官方: 否 | 付费: 否
答案:
Though automation has its advantages, it’s not a good idea to automate all of your testings. Here are some scenarios when a human tester can do a much better job of testing the software than an automated test suite.
尽管自动化有其优势,但将所有测试都自动化并非好主意。以下是人工测试员能比自动化测试套件更好地完成软件测试的一些场景。
The software or the feature under the test changes frequently. It means you have to update your automated tests often to keep them up to date. Tests can quickly become obsolete and stop providing any value. 2. Automated testing is also not suitable for exploratory testing. A human tester can explore the software in a much better way than a computer. 3. Unless the automated tests are programmed or configured to look for UI issues, they can’t find any problems with the UI. It’s much efficient for a human tester to spot any UI inconsistencies or design issues.
- 被测软件或功能频繁变化。这意味着你必须经常更新自动化测试以保持其最新状态。测试可能很快过时并停止提供任何价值。 2. 自动化测试也不适合探索性测试。人工测试员能比计算机更好地探索软件。 3. 除非自动化测试被编程或配置为查找UI问题,否则它们无法发现UI的任何问题。人工测试员发现UI不一致或设计问题要高效得多。
64. When is a good time to automate a test?
什么时候适合自动化测试?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a917 | 官方: 否 | 付费: 否
答案:
A test is a good candidate for automation under the following conditions. - The test is repeatable.
在以下条件下,测试是自动化的良好候选。- 测试是可重复的。
- The feature under the test doesn’t change its behavior frequently.
- It’s time-consuming for a human tester.
- The test involves complicated calculations.
- The test ensures the previous functionality didn’t break after a new change.
65. What’s the difference between manual testing and automated testing?
手动测试和自动化测试有什么区别?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a91a | 官方: 否 | 付费: 否
答案:
| Manual Testing 手动测试 | Automated Testing 自动化测试 |
|---|---|
| A human executes the test cases one by one, without any software assistance. 人工逐个执行测试用例,无需任何软件辅助。 | Tests are executed by a testing tool or framework, without human assistance. 测试由测试工具或框架执行,无需人工辅助。 |
| Useful for non-repeatable tests that involve human ingenuity, participation, and domain experience. 适用于涉及人为创造力、参与和领域经验的非可重复测试。 | Useful for repeatable tests where the software feature under test doesn’t change frequently. 适用于被测软件功能不频繁变化的可重复测试。 |
| Good for accessibility and usability testing, as the tester can test the software from an end-user’s perspective. 适合可访问性和可用性测试,因为测试员可以从最终用户的角度测试软件。 | Good for testing regression issues to make sure that the software didn’t break after introducing new changes. 适合测试回归问题,以确保引入新更改后软件未破坏。 |
| Can be slow and time-consuming, and subject to human errors and misjudgment. 可能缓慢且耗时,并易受人为错误和误判影响。 | Since it’s run by a computer, automated tests are fast and free from errors, given that we are testing the right thing. 由于由计算机运行,自动化测试速度快且无错误,前提是测试的是正确的内容。 |
| It’s possible to test the software in a randomized manner, also known as exploratory testing. 可以随机化方式测试软件,也称为探索性测试。 | Exploratory testing is not possible in automated testing. 自动化测试中无法进行探索性测试。 |
| UI problems and inconsistencies are easily spotted by a human tester. UI问题和不一致容易被人力测试员发现。 | Unless it’s programmed for that, the automated testing cannot discover and report the UI problems. 除非为此编程,否则自动化测试无法发现和报告UI问题。 |
| It’s very difficult, rather impossible to test the software under extreme load to conduct performance testing. 在极端负载下测试软件以进行性能测试非常困难,几乎不可能。 | Performance testing can be easily done with automation testing. 性能测试可通过自动化测试轻松完成。 |
| The tester doesn’t need prior programming knowledge. 测试员无需事先具备编程知识。 | To write automated tests, the tester needs to have prior programming knowledge. 编写自动化测试时,测试员需要具备事先编程知识。 |
66. What are the types of automation testing?
自动化测试有哪些类型?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a91d | 官方: 否 | 付费: 否
答案:
There are different testing techniques, but you can not automate them all. For example, exploratory testing. Here are some testing techniques that you can automate.
有各种测试技术,但你不能自动化所有技术。例如,探索性测试。以下是一些可以自动化的测试技术。
Unit tests: These are written by software developers and test a unit of code in isolation. 2. Integration tests: These test how well different software components work with each other. 3. Regression tests: Verify that the new code didn't break any existing functionality. 4. Performance tests: Ensure that the software won't crash and perform reasonably under heavy load or stringent conditions. 5. UI tests: Ensure that the software uses a consistent user experience and no visual or graphical elements on the screen are broken.
- 单元测试:由软件开发人员编写,并隔离测试代码单元。 2. 集成测试:测试不同软件组件之间如何协同工作。 3. 回归测试:验证新代码未破坏任何现有功能。 4. 性能测试:确保软件在重负载或严格条件下不会崩溃且运行合理。 5. UI测试:确保软件提供一致的用户体验,屏幕上的视觉或图形元素无损坏。
67. What is Cucumber? Explain the need of using Cucumber.
什么是Cucumber?解释使用Cucumber的需求。
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5934 | 官方: 否 | 付费: 否
答案:
Cucumber is a behavior-driven development (BDD) testing tool. The BDD framework's major goal is to bring together a variety of project responsibilities, such as quality assurance, developers, and business analysts, to understand the application without diving too deeply into the technical components. Testers use Cucumber to create test cases for evaluating program behaviour. It is an important tool to automate acceptance tests written in logical language that customers can understand. It's primarily used to develop acceptance tests for web apps based on their features' behaviour.
Cucumber是一种行为驱动开发(BDD)测试工具。BDD框架的主要目标是汇集多种项目职责,如质量保证、开发人员和业务分析师,以理解应用程序而不深入技术细节。测试人员使用Cucumber创建测试用例来评估程序行为。它是一个重要工具,用于自动化以客户能理解的逻辑语言编写的验收测试。它主要用于基于Web应用功能的属性开发验收测试。
68. What is Gherkin Language?
什么是Gherkin语言?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5938 | 官方: 否 | 付费: 否
答案:
Gherkin is a readable business language that allows you to define business activity without getting bogged down in implementation specifics. It's a domain-specific language for defining specs tests in Cucumber format. It describes use cases in plain English and helps users to remove logic elements from behaviour testing.
Gherkin是一种可读的业务语言,允许你定义业务活动而不陷入实施细节。它是一种领域特定语言,用于以Cucumber格式定义规格测试。它以简单英语描述用例,并帮助用户从行为测试中移除逻辑元素。
69. What is the principle of Behaviour Driven Development?
行为驱动开发的原则是什么?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba593b | 官方: 否 | 付费: 否
答案:
Behaviour Driven Development (BDD) is a synthesis and refinement of practices stemming from Test Driven Development (TDD) and Acceptance Test-Driven Development (ATDD). BDD augments TDD and ATDD by applying the “Five Why’s” principle to each proposed user story so that its purpose is clearly related to business outcomes. Five Why's is an iterative interrogative approach for uncovering the cause-and-effect links at the root of a problem. The main purpose of this technique is to uncover the core cause of a flaw or problem by asking "Why?" repeatedly. Each response serves as the foundation for the next question.
行为驱动开发(BDD)是源自测试驱动开发(TDD)和验收测试驱动开发(ATDD)实践的综合与改进。BDD通过将“五个为什么”原则应用于每个提议的用户故事来增强TDD和ATDD,确保其目的与业务结果明确相关。五个为什么是一种迭代追问方法,用于揭示问题根源处的因果联系。该技术的主要目的通过反复问“为什么?”来找出缺陷或问题的核心原因。每个回答为下一个问题奠定基础。
70. What are the primary keywords in Cucumber?
Cucumber 中的主要关键字是什么?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba593e | 官方: 否 | 付费: 否
答案:
Following are the primary keywords in Cucumber:- - Feature: The Feature keyword's aim is to collect relevant scenarios and provide a high-level description of a software feature.
以下是 Cucumber 中的主要关键字:- - Feature:Feature 关键字的目标是收集相关场景,并提供软件功能的高级描述。
- Rule: The Rule keyword is used to express a single business rule that should be followed. It adds to the information about a feature.
- Example: This is a practical illustration of a business rule. It comprises a series of steps.
- Given: The given steps are used to describe the system's initial context - the scenario's scene. It usually refers to an event that occurred in the past.
- When: When describing an occurrence or an action, When is employed. It could be a user interacting with the system or an event generated by another system.
- Then: Then steps are employed to indicate an anticipated outcome, or result.
- Background: A background helps you to give the situations that follow it some context. It can have one or more Given steps, which are executed prior to each scenario but after any Before hooks.
71. Which language is used in Cucumber?
Cucumber 使用哪种语言?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5941 | 官方: 否 | 付费: 否
答案:
Cucumber understands Gherkin. It's a straightforward English representation of the app's functionality. It is used for defining test cases. It is intended to be non-technical and human-readable, and it describes use cases for a software system as a whole. It's a domain-specific (DSL), business-friendly language.
Cucumber 理解 Gherkin 语言。它是应用功能的直接英文表示。它用于定义测试用例。它旨在为非技术性、人类可读的,并描述整个软件系统的用例。它是一种领域特定(DSL)、面向业务的语言。
- Data Science
- All Events
- My Events
72. What do you mean by scenario in Cucumber Testing?
在 Cucumber 测试中,你所说的场景是什么意思?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5944 | 官方: 否 | 付费: 否
答案:
Scenario is a fundamental Gherkin structure. Every scenario begins with the keyword "Scenario:" (or a localized version of it) and ends with a scenario title. Every feature can have one or more scenarios, each of which has one or more steps.
场景是 Gherkin 的基本结构。每个场景以关键字“Scenario:”(或其本地化版本)开头,并以场景标题结束。每个功能可以有一个或多个场景,每个场景包含一个或多个步骤。
As an example of a scenario, consider the following: Scenario − Verify My Orders Functionality. Explanation: When a user clicks on the My Orders option he/ she should be taken to the My Orders page.
作为场景的示例,考虑以下内容:Scenario − Verify My Orders Functionality。解释:当用户点击“My Orders”选项时,他/她应被带到“My Orders”页面。
73. What do you mean by Scenario Outline?
你所说的场景大纲是什么意思?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5947 | 官方: 否 | 付费: 否
答案:
Consider the situation when we need to run a test scenario multiple times. Assume we need to ensure that the login feature is functional for all types of subscribers. This necessitates repeating the login functionality scenario. Copying and pasting the identical instructions to just re-run the code does not appear to be a good approach. Gherkin adds another framework, the scenario outline, to help with this. The scenario outline is similar to scenario, with the exception that several inputs are provided. Example:- Scenario Outline - Sign In Feature for a website. Explanation: The website can have multiple users and so we need to consider all the users while implementing the sign-in functionality.
考虑我们需要多次运行测试场景的情况。假设我们需要确保登录功能对所有类型的订阅者都正常。这需要重复登录功能场景。复制粘贴相同的指令来重新运行代码似乎不是一个好方法。Gherkin 添加了另一个框架,即场景大纲,以帮助解决这个问题。场景大纲与场景类似,但提供多个输入。示例:- Scenario Outline - 网站的“Sign In”功能。解释:网站可以有多个用户,因此在实现登录功能时,我们需要考虑所有用户。
74. What do you mean by feature in Cucumber?
在 Cucumber 中,你所说的功能是什么意思?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba594a | 官方: 否 | 付费: 否
答案:
A project's feature can be described as a stand-alone unit or functionality. A list of scenarios to test for a feature is frequently included with it. The Feature File is a file in which we store features, descriptions of features, and situations to be evaluated. For each feature under test, it is recommended that a separate feature file be created. The feature file must have the extension ".feature." You can make as many feature files as you want. Here's an example:-
项目的功能可以被描述为独立的单元或功能。通常包含要测试的功能的场景列表。功能文件是我们存储功能、功能描述和待评估情况的文件。对于每个被测功能,建议创建单独的功能文件。功能文件必须具有扩展名“.feature”。你可以创建任意数量的功能文件。以下是一个示例:-
For an e-commerce website, we can have the following features:- - User registers and signs up on the website.
对于一个电子商务网站,我们可以有以下功能:- - 用户在网站上注册和登录。
- User tries to log in to their account using their credentials.
- Users add a product to their cart.
- User clicks on checkout now.
- User pays for their items.
- User logs out from the website.
All these are different features. The website will have many such features. All these features will have a separate Feature File.
所有这些都是不同的功能。网站将有许多这样的功能。所有这些功能都会有单独的功能文件。
75. What are the basic requirements to run Cucumber Web test cases?
运行 Cucumber 网页测试用例的基本要求是什么?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba594d | 官方: 否 | 付费: 否
答案:
We need the following minimum requirements to successfully run a Cucumber Web test case:-
我们需要以下最低要求来成功运行 Cucumber 网页测试用例:-
The compiler and the development kit for the programming language we will be using. Example: JDK and JRE for using Java as our programming language. 2. An IDE (Integrated Development Environment) wherein we can write our code. Example: Eclipse. 3. Build tools so as to do tasks such as compiling code, packaging code to a jar, creating source code. Example: Maven, Gradle.
- 我们将使用的编程语言的编译器和开发工具包。示例:使用 Java 作为编程语言时,需要 JDK 和 JRE。2. 一个 IDE(集成开发环境),在其中我们可以编写代码。示例:Eclipse。3. 构建工具,用于执行诸如编译代码、将代码打包成 jar、创建源代码等任务。示例:Maven、Gradle。
76. What are the advantages of using Cucumber?
使用 Cucumber 有哪些优势?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5950 | 官方: 否 | 付费: 否
答案:
Following are the advantages of using Cucumber:- - Cucumber supports a variety of programming languages, including Java.net and Ruby.
以下是使用 Cucumber 的优势:- - Cucumber 支持多种编程语言,包括 Java.net 和 Ruby。
- It serves as a link between commercial and technical language. This can be done by writing a test case in plain English text.
- It enables the test script to be developed without any prior knowledge of programming, as well as the participation of non-programmers.
- Unlike other tools, it functions as an end-to-end test framework.
- Cucumber allows for code reuse thanks to its simple test script architecture.
77. What are Step Definitions in the context of Cucumber?
在 Cucumber 的上下文中,什么是步骤定义?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5953 | 官方: 否 | 付费: 否
答案:
Step definitions connect Gherkin steps to programming code. The mapping between each step of the scenario defined in the feature file and a code of the function to be executed is stored in the steps definition file. A step definition carries out the action that should be performed by the step. So step definitions hard-wire the specification to the implementation.
步骤定义将 Gherkin 步骤连接到编程代码。功能文件中定义的每个场景步骤与要执行的函数代码之间的映射存储在步骤定义文件中。步骤定义执行该步骤应执行的操作。因此,步骤定义将规范与实现紧密连接。
78. What are annotations in Cucumber?
什么是 Cucumber 中的注解?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5956 | 官方: 否 | 付费: 否
答案:
An annotation is a type of text that has been pre-defined and has a specified meaning. It tells the compiler/interpreter what to do when the program runs. The annotations on Cucumber are as follows: - Given: It specifies the requirements for running the test.Example: Given I have an account on Interviewbit.
注解是一种预先定义且具有指定含义的文本类型。它告诉编译器/解释器在程序运行时该做什么。Cucumber 上的注解如下:- Given:它指定了运行测试的要求。示例:Given I have an account on Interviewbit.
- When: It establishes the starting point for any test scenario.Example: When I log in to Interviewbit.
- Then: It contains the expected result of the test which is to be executed.Example: Then registration should be successful.
- And: Between any two statements, it gives the logical AND condition. AND can be combined with the GIVEN, WHEN, and THEN statements.Example: When I enter my account number AND CVV.
- But: It denotes a logical OR relationship between two propositions. OR can be combined with the GIVEN, WHEN, and THEN statements.Example: Then I should be logged in BUT I must enter the OTP.
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万+职业规划
79. Enlist the files needed in the Cucumber framework.
列出 Cucumber 框架中所需的文件。
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5959 | 官方: 否 | 付费: 否
答案:
The following are the files required for a Cucumber framework: - Feature File: It has plain text descriptions of single or numerous test situations. Keywords like Then, When, Background, Scenario Outline, Feature, And, But, and so on are used in the tests. As a result, it's a file that keeps track of features and their descriptions.
以下是 Cucumber 框架所需的文件:- 功能文件:它包含单个或多个测试场景的纯文本描述。测试中使用诸如 Then、When、Background、Scenario Outline、Feature、And、But 等关键字。因此,它是一个记录功能及其描述的文件。
- Step Definition File: It has the extension .java. It essentially acts as a translator between the test scenario steps provided in the feature file and the automation code. Cucumber searches the step definition file and executes the relevant functions that are assigned to that step when it runs a step described in the feature file.
- TestRunner: .java is the file extension for this file. It connects the feature file and the step definition file. It allows the user to run one or more feature files at the same time. It contains the locations of the step definition and feature files.
80. How do you comment the code in Cucumber? What is the importance of comments?
如何在 Cucumber 中注释代码?注释的重要性是什么?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba595e | 官方: 否 | 付费: 否
答案:
A comment is a chunk of code that is intended for documentation rather than execution. To make it more legible and clear, whether it's a step definition file or a feature file. As a result, it's critical to use/insert comments in the right places throughout the file. This is also beneficial for troubleshooting the code. Comments can be added to Cucumber feature files at any time. To add comments, simply begin the statement with the “#” sign. Different programming languages have different standards for commenting. Let's see how Cucumber handles the situation: - For Step Definition File, if you're using Java as a platform, start your comments with "/."
注释是一段代码块,其目的是用于文档记录而非执行,无论它是步骤定义文件还是功能文件,都旨在使其更易读和清晰。因此,在整个文件中正确的位置使用/插入注释至关重要。这也有利于故障排除代码。可以随时向 Cucumber 功能文件添加注释。要添加注释,只需以“#”符号开头语句。不同的编程语言有不同的注释标准。让我们看看 Cucumber 如何处理这种情况:- 对于步骤定义文件,如果你使用 Java 作为平台,请以“/.”开始你的注释。
- In the case of a feature file, we only need to type # before starting our comment.
81. What are hooks in Cucumber?
什么是 Cucumber 中的钩子?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5961 | 官方: 否 | 付费: 否
答案:
Hooks are code blocks that execute before or after each Cucumber scenario in the execution cycle. This enables us to better control the development workflow and decrease code redundancy. Setting up the web driver and terminating the web driver session resembles a test setup. When dealing with different scenarios, it's best to do the setup and clean up only once. Hooks are used to bringing optimization.
钩子是在执行周期中每个 Cucumber 场景之前或之后执行的代码块。这使我们能够更好地控制开发工作流程并减少代码冗余。设置 Web 驱动器和终止 Web 驱动器会话类似于测试设置。在处理不同场景时,最好只执行一次设置和清理。钩子用于实现优化。
Certain preconditions, such as executing the program, creating a database connection, preparing the test data, and so on, may be required in some cases. There are also several postconditions to be fulfilled, such as ending the database connection, closing the browser, refreshing test data, and logging out of the program. Cucumber handles all of these situations with the use of hooks.
在某些情况下,可能需要某些前置条件,例如执行程序、创建数据库连接、准备测试数据等。还有一些待满足的后置条件,例如结束数据库连接、关闭浏览器、刷新测试数据以及退出程序。Cucumber 借助钩子处理所有这些情况。
The methods @Before and @After can be used to define hooks anywhere in the project or step definition layers. Before hook is executed before any other test situations, and after the hook is executed after all test scenarios have been completed.
可以使用 @Before 和 @After 方法在项目或步骤定义层中任意位置定义钩子。Before 钩子在任何其他测试场景之前执行,而 After 钩子在所有测试场景完成后执行。
82. What are tags in Cucumber and why are they important?
什么是 Cucumber 中的标签,它们为何重要?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5964 | 官方: 否 | 付费: 否
答案:
When we only have one, two, or maybe five situations in a feature file, it appears to be simple. In reality, however, this does not occur. In a single feature file, we may have 10, 20, or even more scenarios for each feature under test. They could reflect various purposes (smoke test/regression test), perspectives (developer/QA/BA), and statuses (ready for execution/work in progress). Tags in cucumber provide a way to run scenarios in a specific sequence from a runner file. Each situation can be labeled with a useful tag. Later, in the runner file, we may specify which tag (and hence which scenario(s)) Cucumber should run. “@” is the first character in a tag. Any relevant content after "@" can be used to define your tag. Example - ‘@InitialTest’
当我们只有一个、两个或可能五个场景在一个功能文件中时,它看起来很简单。然而,在现实中,情况并非如此。在一个功能文件中,我们可能针对每个被测功能有 10、20 个甚至更多的场景。它们可能反映不同的目的(冒烟测试/回归测试)、视角(开发人员/QA/BA)和状态(准备执行/进行中)。Cucumber 中的标签提供了一种从运行器文件按特定顺序运行场景的方法。每个场景都可以标注一个有用的标签。之后,我们可以在运行器文件中指定 Cucumber 应运行哪个标签(以及因此哪些场景)。“@”是标签的第一个字符。可以使用“@”后的任何相关内容来定义你的标签。示例 - ‘@InitialTest’
83. What is Cucumber Dry Run?
什么是 Cucumber 干运行?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5967 | 官方: 否 | 付费: 否
答案:
The purpose of the Cucumber dry run is to verify compilation faults and compile the Step Definition and Feature files. Dry run's value might be either true or false. Dry run has the value false by default and it is present in the Test Runner Class file.
Cucumber 干运行的目的是验证编译错误,并编译步骤定义和功能文件。干运行的值可以是 true 或 false。干运行默认值为 false,并且存在于测试运行器类文件中。
If the dry run value is true, Cucumber will check all steps in the Feature file. Within the Step Definition file, it will also check the implementation code of steps in the Feature file.
如果干运行值为 true,Cucumber 将检查功能文件中的所有步骤。在步骤定义文件中,它还将检查功能文件中步骤的实现代码。
If any of the steps in the Feature file is missing its implementation in the Step Definition file, a message is thrown. The @CucumberOptions has a dry run parameter that is used to configure the test parameters.
如果功能文件中的任何步骤在步骤定义文件中缺少实现,则会抛出消息。@CucumberOptions 有一个干运行参数,用于配置测试参数。
84. What do you mean by profile in Cucumber?
在 Cucumber 中,profile(配置文件)是什么意思?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba596a | 官方: 否 | 付费: 否
答案:
When testing a feature, cucumber profiles make it simple to define groupings of tests in a feature file so that we can choose to execute only a subset of them rather than all of them. It was created to help people save time. In a cucumber.yml file, the user can reuse commonly used cucumber flags.
在测试功能时,cucumber profile 使得在功能文件中定义测试分组变得简单,这样我们可以选择只执行其中的一部分,而不是全部。它旨在帮助人们节省时间。在 cucumber.yml 文件中,用户可以重用常用的 cucumber 标志。
85. What programming languages are used by Cucumber?
Cucumber 使用哪些编程语言?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37a5858d557c902ba596d | 官方: 否 | 付费: 否
答案:
Cucumber supports a variety of programming languages, including Java,.NET, Ruby, and others. It can also be used with other tools like Capybara and Selenium.
Cucumber 支持多种编程语言,包括 Java、.NET、Ruby 等。它还可以与其他工具(如 Capybara 和 Selenium)一起使用。
The Gherkin text serves as a skeleton for your automated tests and serves as documentation. Gherkin is based on TreeTop Grammar, which is used in more than 37 languages. As a result, you can write your gherkin in more than 37 different spoken languages.
Gherkin 文本作为自动化测试的骨架,并充当文档。Gherkin 基于 TreeTop 语法,该语法用于超过 37 种语言。因此,你可以用超过 37 种不同的口语编写 Gherkin。
86. Explain the process of ETL testing.
解释 ETL 测试的过程。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aeb58d557c902bab3b2 | 官方: 否 | 付费: 否
答案:
ETL testing is made easier when a testing strategy is well defined. The ETL testing process goes through different phases, as illustrated below:
当测试策略被良好定义时,ETL 测试会变得更加容易。ETL 测试过程经历不同阶段,如下所示:
- Analyze Business Requirements: To perform ETL Testing effectively, it is crucial to understand and capture the business requirements through the use of data models, business flow diagrams, reports, etc.
- Identifying and Validating Data Source: To proceed, it is necessary to identify the source data and perform preliminary checks such as schema checks, table counts, and table validations. The purpose of this is to make sure the ETL process matches the business model specification.
- Design Test Cases and Preparing Test Data: Step three includes designing ETL mapping scenarios, developing SQL scripts, and defining transformation rules. Lastly, verifying the documents against business needs to make sure they cater to those needs. As soon as all the test cases have been checked and approved, the pre-execution check is performed. All three steps of our ETL processes - namely extracting, transforming, and loading - are covered by test cases.
- Test Execution with Bug Reporting and Closure: This process continues until the exit criteria (business requirements) have been met. In the previous step, if any defects were found, they were sent to the developer for fixing, after which retesting was performed. Moreover, regression testing is performed in order to prevent the introduction of new bugs during the fix of an earlier bug.
- Summary Report and Result Analysis: At this step, a test report is prepared, which lists the test cases and their status (passed or failed). As a result of this report, stakeholders or decision-makers will be able to properly maintain the delivery threshold by understanding the bug and the result of the testing process.
- Test Closure: Once everything is completed, the reports are closed.
87. Name some tools that are used in ETL.
列出一些用于 ETL 的工具。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aeb58d557c902bab3b6 | 官方: 否 | 付费: 否
答案:
The use of ETL testing tools increases IT productivity and facilitates the process of extracting insights from big data. With the tool, you no longer have to use labor-intensive, costly traditional programming methods to extract and process data.
使用 ETL 测试工具可以提高 IT 生产力,并促进从大数据中提取洞察的过程。有了该工具,你不再需要使用劳动密集型、成本高昂的传统编程方法来提取和处理数据。
Technology evolved over time, so did solutions. Nowadays, various ways can be used for ETL testing depending on the source data and the environment. There are several ETL vendors that focus on ETL exclusively, such as Informatica. Software vendors like IBM, Oracle, and Microsoft provide other tools as well. Open source ETL tools have also recently emerged that are free to use. The following are some ETL software tools to consider:
技术随着时间发展,解决方案也是如此。如今,根据源数据和环境,可以使用多种方式进行 ETL 测试。有几家 ETL 供应商专门专注于 ETL,例如 Informatica。像 IBM、Oracle 和 Microsoft 这样的软件供应商也提供其他工具。开源 ETL 工具最近也出现了,可以免费使用。以下是一些值得考虑的 ETL 软件工具:
Enterprise Software ETL - Informatica PowerCenter
企业软件 ETL - Informatica PowerCenter
- IBM InfoSphere DataStage
- Oracle Data Integrator (ODI)
- Microsoft SQL Server Integration Services (SSIS)
- SAP Data Services
SAS Data Manager, etc.
Open Source ETL - Talend Open Studio开源 ETL - Talend Open Studio
- Pentaho Data Integration (PDI)
- Hadoop, etc.
88. What are the roles and responsibilities of an ETL tester?
ETL测试员的角色和职责是什么?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aeb58d557c902bab3b9 | 官方: 否 | 付费: 否
答案:
Since ETL testing is so important, ETL testers are in great demand. ETL testers validate data sources, extract data, apply transformation logic, and load data into target tables. The following are key responsibilities of an ETL tester: - In-depth knowledge of ETL tools and processes.
由于ETL测试如此重要,ETL测试员的需求量很大。ETL测试员验证数据源、提取数据、应用转换逻辑,并将数据加载到目标表中。以下是ETL测试员的主要职责:- 深入了解ETL工具和流程。
- Performs thorough testing of the ETL software.
- Check the data warehouse test component.
- Perform the backend data-driven test.
- Design and execute test cases, test plans, test harnesses, etc.
- Identifies problems and suggests the best solutions.
- Review and approve the requirements and design specifications.
- Writing SQL queries for testing scenarios.
- Various types of tests should be carried out, including primary keys, defaults, and checks of other ETL-related functionality.
- Conducts regular quality checks.
89. What is the importance of ETL testing?
ETL测试的重要性是什么?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3bc | 官方: 否 | 付费: 否
答案:
Following are some of the notable benefits that are highlighted while endorsing ETL Testing: - Ensure data is transformed efficiently and quickly from one system to another.
以下是强调ETL测试时突出的一些显著好处:- 确保数据从一个系统高效、快速地转换到另一个系统。
- Data quality issues during ETL processes, such as duplicate data or data loss, can also be identified and prevented by ETL testing.
- Assures that the ETL process itself is running smoothly and is not hampered.
- Ensures that all data implemented is in line with client requirements and provides accurate output.
- Ensures that bulk data is moved to the new destination completely and securely.
90. What are different types of ETL testing?
ETL测试有哪些不同类型?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3bf | 官方: 否 | 付费: 否
答案:
Before you begin the testing process, you need to define the right ETL Testing technique. It is important to ensure that the ETL test is performed using the right technique and that all stakeholders agree to it. Testing team members should be familiar with this technique and the steps involved in testing. Below are some types of testing techniques that can be used: - Production Validation Testing: Also known as "production reconciliation" or "table balancing," it involves validating data in production systems and comparing it against the source data.
在开始测试过程之前,您需要定义正确的ETL测试技术。确保使用正确的技术执行ETL测试,并且所有利益相关者都同意这一点非常重要。测试团队成员应熟悉此技术及测试中涉及的步骤。以下是一些可以使用的测试技术类型:- 生产验证测试:也称为“生产对账”或“表平衡”,涉及验证生产系统中的数据并将其与源数据进行比较。
- Source to Target Count Testing: This ensures that the number of records loaded into the target is consistent with what is expected.
- Source to Target Data Testing: This entails ensuring no data is lost and truncated when loading data into the warehouse, and that the data values are accurate after transformation.
- Metadata Testing: The process of determining whether the source and target systems have the same schema, data types, lengths, indexes, constraints, etc.
- Performance Testing: Verifying that data loads into the data warehouse within predetermined timelines to ensure speed and scalability.
- Data Transformation Testing: This ensures that data transformations are completed according to various business rules and requirements.
- Data Quality Testing: This testing involves checking numbers, dates, nulls, precision, etc. Testing includes both Syntax Tests to report invalid characters, incorrect upper/lower case order, etc., and Reference Tests to check if the data is properly formatted.
- Data Integration Testing: In this test, testers ensure the data from various sources have been properly incorporated into the target system, as well as verifying the threshold values.
- Report Testing: The test examines the data in a summary report, verifying the layout and functionality, and making calculations for subsequent analysis.
91. Explain the data cleaning process.
解释数据清洗过程。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3c2 | 官方: 否 | 付费: 否
答案:
There is always the possibility of duplicate or mislabeled data when combining multiple data sources. Incorrect data leads to unreliable outcomes and algorithms, even when they appear to be correct. Therefore, consolidation of multiple data representations as well as elimination of duplicate data become essential in order to ensure accurate and consistent data. Here comes the importance of the data cleaning process.
当合并多个数据源时,总是存在重复或错误标记数据的可能性。不正确的数据会导致不可靠的结果和算法,即使它们看起来是正确的。因此,合并多个数据表示以及消除重复数据对于确保准确和一致的数据变得至关重要。这就是数据清洗过程的重要性所在。
Data cleaning can also be referred to as data scrubbing or data cleansing. This refers to the process of removing incomplete, duplicate, corrupt, or incorrect data from a dataset. As the need to integrate multiple data sources becomes more apparent, for example in data warehouses or federated database systems, the significance of data cleaning increases greatly. Because the specific steps in a data cleaning process will vary depending on the dataset, developing a template for your process will ensure that you do it correctly and consistently.
数据清洗也可以称为数据擦洗或数据净化。这指的是从数据集中移除不完整、重复、损坏或不正确的数据的过程。随着集成多个数据源的需求变得更加明显,例如在数据仓库或联邦数据库系统中,数据清洗的重要性大大增加。由于数据清洗过程中的具体步骤会因数据集而异,为您的流程制定模板将确保您正确且一致地执行。
92. What do you mean by ETL Pipeline?
你所说的ETL管道是什么意思?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3c5 | 官方: 否 | 付费: 否
答案:
As the name suggests, ETL pipelines are the mechanisms to perform ETL processes. This involves a series of processes or activities required for transferring data from one or more sources into the data warehouse for analysis, reporting and data synchronization. It is important to move, consolidate, and alter source data from multiple systems to match the parameters and capabilities of the destination database in order to provide valuable insights.
顾名思义,ETL管道是执行ETL过程的机制。这涉及将数据从一个或多个源转移到数据仓库以供分析、报告和数据同步所需的一系列过程或活动。重要的是移动、整合和修改来自多个系统的源数据,以匹配目标数据库的参数和能力,从而提供有价值的见解。
Among its benefits are: - They reduce errors, bottlenecks, and latency, ensuring the smooth flow of information between systems.
其好处包括:- 它们减少错误、瓶颈和延迟,确保系统之间信息的顺畅流动。
- With ETL pipelines, businesses are able to achieve competitive advantage.
- The ETL pipeline can centralize and standardize data, allowing analysts and decision-makers to easily access and use it.
- It facilitates data migrations from legacy systems to new repositories.
93. What is BI (Business Intelligence)?
什么是BI(商业智能)?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3c8 | 官方: 否 | 付费: 否
答案:
Business Intelligence (BI) involves acquiring, cleaning, analyzing, integrating, and sharing data as a means of identifying actionable insights and enhancing business growth. An effective BI test verifies staging data, ETL process, BI reports, and ensures the implementation is reliable. In simple words, BI is a technique used to gather raw business data and transform it into useful insight for a business. By performing BI Testing, insights from the BI process are verified for accuracy and credibility.
商业智能(BI)涉及获取、清洗、分析、整合和共享数据,以识别可操作的见解并促进业务增长。有效的BI测试验证暂存数据、ETL流程、BI报告,并确保实施的可靠性。简而言之,BI是一种用于收集原始业务数据并将其转换为对业务有用的见解的技术。通过执行BI测试,验证BI流程中产生的见解的准确性和可信度。
94. Write the difference between ETL testing and database testing.
写出ETL测试和数据库测试之间的区别。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3cb | 官方: 否 | 付费: 否
答案:
Data validation is involved in both ETL testing and database testing, however, the two are different. The ETL testing procedure normally involves analyzing data stored in a warehouse system. On the other hand, the database testing procedure is commonly used to analyze data stored in transactional systems. The following are the distinct differences between ETL testing and Database testing.
ETL测试和数据库测试都涉及数据验证,然而两者是不同的。ETL测试过程通常涉及分析存储在仓库系统中的数据。另一方面,数据库测试过程通常用于分析存储在事务系统中的数据。以下是ETL测试和数据库测试之间的明显区别。
| ETL Testing ETL 测试 | Database Testing 数据库测试 |
|---|---|
| The ETL process is used to test data extraction, transformation, and loading for BI reporting purposes. ETL 流程用于测试数据的提取、转换和加载,以满足商业智能报告目的。 | Data is validated and integrated by performing database testing. 通过执行数据库测试来验证和整合数据。 |
| Data movement is being checked to determine if it is going as expected 正在检查数据移动是否符合预期。 | This test is primarily designed to verify that data follows the rules or standards defined in the Data Model. 此测试主要设计用于验证数据是否符合数据模型中定义的规则或标准。 |
| It verifies whether the counts and data in the source and target match or not. 它验证源和目标中的计数和数据是否匹配。 | It ensures that foreign key relationships are maintained and no orphan records are present, as well as that a column in the table has valid values. 它确保外键关系得以维护,且不存在孤立记录,同时表中的列具有有效值。 |
| This technique is applied to OLAP systems. 此技术应用于 OLAP 系统。 | This technique is applied to OLTP systems. 此技术应用于 OLTP 系统。 |
| The approach utilizes denormalized data with fewer joins, more indexes, and more aggregates. 该方法利用非规范化数据,连接较少、索引更多、聚合更多。 | The approach utilizes normalized data with joins. 该方法利用规范化数据并进行连接。 |
| Some of the most common ETL tools are QuerySurge, Informatica, Cognos, etc. 一些最常见的 ETL 工具包括 QuerySurge、Informatica、Cognos 等。 | Some of the most common database testing tools are Selenium, QTP, etc. 一些最常见的数据库测试工具包括 Selenium、QTP 等。 |
95. What is data source view?
什么是数据源视图?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3ce | 官方: 否 | 付费: 否
答案:
Several analysis services databases rely on relational schemas, and the Data source view is responsible for defining such schemas (logical model of the schema). Additionally, it can be easily used to create cubes and dimensions, thus enabling users to set their dimensions in an intuitive way. A multidimensional model is incomplete without a DSV. In this way, you are given complete control over the data structures in your project and are able to work independently from the underlying data sources (e.g., changing column names or concatenating columns without directly changing the original data source). Every model must have a DSV, no matter when or how it's created.
多个分析服务数据库依赖于关系模式,而数据源视图负责定义此类模式(模式的逻辑模型)。此外,它可以轻松用于创建多维数据集和维度,从而使用户能够以直观的方式设置其维度。没有 DSV,多维模型是不完整的。这样,您可以完全控制项目中的数据结构,并能够独立于底层数据源进行操作(例如,更改列名或拼接列,而无需直接更改原始数据源)。每个模型都必须有 DSV,无论何时或如何创建。
Using the Data Source View Wizard to create a DSV
使用数据源视图向导创建 DSV
You must run the Data Source View Wizard from Solution Explorer within SQL Server Data Tools to create the DSV. - In solution explorer, Right Click Data source view folder -> Click New Data Source View.
您必须在 SQL Server 数据工具中的解决方案资源管理器中运行数据源视图向导来创建 DSV。- 在解决方案资源管理器中,右键单击数据源视图文件夹 -> 单击新建数据源视图。
- Choose one of the available data source objects, or add a new one.
- Click Advanced on the same page to specifically select schemas, apply a filter, or exclude information about table relationships.
- Filter Available Objects (If we use a string as a selection criterion, it is possible to prune the list of the available objects).
- A Name Matching page appears if there are no table relationships defined for the relational data source, and you can choose the appropriate method for matching names by clicking on it.
96. Write about the difference between power mart and power center.
请写出 Power Mart 和 Power Center 之间的区别。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3d1 | 官方: 否 | 付费: 否
答案:
| Power Mart | Power Center |
|---|---|
| It only processes small amounts of data and is considered good if the processing requirements are low. 它仅处理少量数据,如果处理需求较低,则被认为是合适的。 | It is considered good when the amount of data to be processed is high, as it processes bulk data in a short period of time. 当要处理的数据量较大时,它被认为是合适的,因为它能在短时间内处理批量数据。 |
| ERP sources are not supported. 不支持 ERP 源。 | ERP sources such as SAP, PeopleSoft, etc. are supported. 支持 SAP、PeopleSoft 等 ERP 源。 |
| Currently, it only supports local repositories. 目前,它仅支持本地存储库。 | Local and global repositories are supported. 支持本地和全局存储库。 |
| There are no specifications for turning a local repository into a global repository. 没有将本地存储库转换为全局存储库的规范。 | It is capable of converting local repositories into global ones. 它能够将本地存储库转换为全局存储库。 |
| Session partitions are not supported. 不支持会话分区。 | To improve the performance of ETL transactions, it supports session partitioning. 为了提高 ETL 事务的性能,它支持会话分区。 |
97. State difference between ETL and OLAP (Online Analytical Processing) tools.
说明 ETL 和 OLAP(联机分析处理)工具之间的区别。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3d5 | 官方: 否 | 付费: 否
答案:
- ETL tools: The data is extracted, transformed, and loaded into the data warehouse or data mart using ETL tools. Several transformations are necessary before data is loaded into the target table in order to implement business logic. Example: Data stage, Informatica, etc.
- OLAP (Online Analytical Processing) tools: OLAP tools are designed to create reports from data warehouses and data marts for business analysis. It loads data from the target tables into the OLAP repository and performs the required modifications to create a report. Example: Business Objects, Cognos etc.
98. What do you mean by data purging?
数据清除是什么意思?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3d8 | 官方: 否 | 付费: 否
答案:
When data needs to be deleted from the data warehouse, it can be a very tedious task to delete data in bulk. The term data purging refers to methods of permanently erasing and removing data from a data warehouse. Data purging, often contrasted with deletion, involves many different techniques and strategies. When you delete data, you are removing it on a temporary basis, but when you purge data, you are permanently removing the data and freeing up memory or storage space. In general, the data that is deleted is usually junk data such as null values or extra spaces in the row. Using this approach, users can delete multiple files at once and maintain both efficiency and speed.
当需要从数据仓库中删除数据时,批量删除数据可能是一项非常繁琐的任务。术语“数据清除”指的是从数据仓库中永久擦除和移除数据的方法。数据清除通常与删除相对比,涉及多种不同的技术和策略。当您删除数据时,您是临时性地移除它,但当您清除数据时,您是永久性地移除数据并释放内存或存储空间。通常,被删除的数据通常是垃圾数据,如行中的空值或额外空格。使用此方法,用户可以一次删除多个文件,并同时保持效率和速度。
99. Explain how a data warehouse differs from data mining.
解释数据仓库与数据挖掘有何不同。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3db | 官方: 否 | 付费: 否
答案:
Both data mining and data warehousing are powerful data analysis and storage techniques. - Data warehousing: To generate meaningful business insights, it involves compiling and organizing data from various sources into a common database. In a data warehouse, data are cleaned, integrated and consolidated to support management decision-making processes. Object-oriented, integrated, time-varying, and nonvolatile data can be stored within a Data warehouse.
数据挖掘和数据仓库都是强大的数据分析和存储技术。- 数据仓库:为了产生有意义的业务洞察,它涉及将来自各种来源的数据编译和组织到公共数据库中。在数据仓库中,数据被清洗、集成和整合,以支持管理决策过程。面向对象、集成、随时间变化且非易失性的数据可以存储在数据仓库中。
- Data mining: Also referred to as KDD (Knowledge Discover in Database), it involves searching for and identifying hidden, relevant, and potentially valuable patterns in large data sets. An important goal of data mining is to discover previously unknown relationships among the data. Through data mining, insights can be extracted that can be used for things such as marketing, fraud detection, and scientific discoveries.
Difference between Data Warehouse and Data Mining -
数据仓库与数据挖掘之间的区别 -
| Data Warehousing 数据仓库 | Data Mining 数据挖掘 |
|---|---|
| It involves gathering all relevant data for analytics in one place. 它涉及将所有相关数据收集到一处用于分析。 | Data is extracted from large datasets using this method. 使用此方法从大型数据集中提取数据。 |
| Data extraction and storage assist in facilitating easier reporting. 数据提取和存储有助于简化报告流程。 | It identifies patterns by using pattern recognition techniques. 它通过使用模式识别技术来识别模式。 |
| Engineers are solely responsible for data warehousing, and data is periodically stored. 工程师全权负责数据仓库,并且数据定期存储。 | Data mining is carried out by business users in conjunction with engineers, and data is analyzed regularly. 数据挖掘由业务用户与工程师共同执行,并且数据定期进行分析。 |
| In addition to making data mining easier and more convenient, it helps sort and upload important data to databases. 除了使数据挖掘更简单便捷外,它还有助于将重要数据排序并上传到数据库。 | Analyzing information and data is made easier. 使分析信息和数据变得更加容易。 |
| It is possible to accumulate a large amount of irrelevant and unnecessary data. Loss and erasure of data can also be problematic. 可能会积累大量无关和不必要的数据。数据丢失和擦除也可能成为问题。 | Not doing it correctly can create data breaches and hacking since data mining isn't always 100% accurate. 由于数据挖掘并非总是100%准确,操作不当可能导致数据泄露和黑客攻击。 |
| Data mining cannot take place without this process, since it compiles and organizes data into a common database. 数据挖掘离不开此过程,因为它将数据编译和组织到公共数据库中。 | Because the process requires compiled data, it always takes place after data warehousing. 由于该过程需要编译数据,因此它总是在数据仓库之后进行。 |
| Data warehouses simplify every type of business data. 数据仓库简化了所有类型的业务数据。 | Comparatively, data mining techniques are inexpensive. 相比之下,数据挖掘技术成本较低。 |
100. Explain data mart.
解释数据集市。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3de | 官方: 否 | 付费: 否
答案:
An enterprise data warehouse can be divided into subsets, also called data marts, which are focused on a particular business unit or department. Data marts allow selected groups of users to easily access specific data without having to search through an entire data warehouse. Some companies, for example, may have a data mart aligned with purchasing, sales, or inventories as shown below:
企业数据仓库可以被划分为子集,也称为数据集市,这些子集专注于特定的业务单元或部门。数据集市允许选定的用户组轻松访问特定数据,而无需搜索整个数据仓库。例如,一些公司可能有一个与采购、销售或库存对齐的数据集市,如下所示:
In contrast to data warehouses, each data mart has a unique set of end users, and building a data mart takes less time and costs less, so it is more suitable for small businesses. There is no duplicate (or unused) data in a data mart, and the data is updated on a regular basis.
与数据仓库相比,每个数据集市都有一组独特的最终用户,且构建数据集市所需时间和成本更少,因此更适合小型企业。数据集市中不存在重复(或未使用)的数据,并且数据会定期更新。
101. Explain the three-layer architecture of an ETL cycle.
解释ETL周期的三层架构。
- 知识点: 测试 / 数据工程与数据科学/AI / 行为与软技能 (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: behavioral | 难度: easy | 子类型: system-design
- 分类: fullstack
- id: 69b37aec58d557c902bab3e1 | 官方: 否 | 付费: 否
答案:
Typically, ETL tool-based data warehouses use staging areas, data integration layers, and access layers to accomplish their work. In general, the architecture has three layers as shown below:
通常,基于ETL工具的数据仓库使用暂存区、数据集成层和访问层来完成其工作。一般来说,该架构包含三层,如下所示:
- Staging Layer: In a staging layer, or source layer, data is stored that is extracted from multiple data sources.
- Data Integration Layer: The integration layer plays the role of transforming data from the staging layer to the database layer.
- Access Layer: Also called a dimension layer, it allows users to retrieve data for analytical reporting and information retrieval.
102. What are the different challenges of ETL testing?
ETL测试有哪些不同的挑战?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3e4 | 官方: 否 | 付费: 否
答案:
In spite of the importance of ETL testing, companies may face some challenges when trying to implement it in their applications. The volume of data involved or the heterogeneous nature of the data makes ETL testing challenging. Some of these challenges are listed below: - Changing customer requirements result in re-running test cases.
尽管ETL测试很重要,公司在尝试将其应用于应用程序时可能会面临一些挑战。涉及的数据量或数据的异构性使ETL测试具有挑战性。其中一些挑战如下所列:- 不断变化的客户需求导致重新运行测试用例。
- Changing customer requirements may necessitate a tester creating/modifying new mapping documents and SQL scripts, resulting in a long and tedious process.
- Uncertainty about business requirements or employees who are not aware of them.
- During migration, data loss may occur, making it difficult for source-to-destination reconciliation to take place.
- An incomplete or corrupt data source.
- Reconciliation between data sources and targets may be impacted by incorporating real-time data.
- There may be memory issues in the system due to the large volume of historical data.
- Testing with inappropriate tools or in an unstable environment.
103. Why is functional testing important?
为什么功能测试很重要?
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37afa58d557c902babd78 | 官方: 否 | 付费: 否
答案:
Validating/Testing the quality and functionality of software requires functional testing. The purpose is as follows: - Ensures the delivery of high-quality products.
验证/测试软件的质量和功能需要功能测试。其目的如下:- 确保交付高质量产品。
- A quality assurance team uses this software testing technique to ensure software functionality is in line with the Software Requirements Specification (SRS) and to ensure the system functions as intended by the user.
- In essence, this testing method is utilized for testing user-friendliness features, specific error conditions, accessibility features and other important features of the software.
- This allows testers to verify that the software they test works as intended and gives developers feedback about how to improve software products.
- Functional testing is crucial to determine whether your code is working correctly or if errors are likely to arise in the future.
104. What are different types of functional testing?
功能测试有哪些不同类型?
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37afa58d557c902babd7b | 官方: 否 | 付费: 否
答案:
Ultimately, functional testing is aimed at ensuring that software works as specified and meets user expectations. Functional testing may seem simple on its face, but it involves a variety of methods, some of which may be preferred or prioritized over others based on the application and organization. These methods are outlined below:
最终,功能测试旨在确保软件按规格运行并满足用户期望。功能测试表面上看似简单,但它涉及多种方法,其中一些方法可能基于应用程序和组织而优先于其他方法。这些方法概述如下:
- Unit testing: It involves testing the individual units/blocks of code of the software to validate that they perform as intended.
- 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.
- Integration testing: This test combines individual components/units and tests them together. Tests will ensure that they interact appropriately, as well as reveal any faults between the integrated units if present.
- Regression testing: This type of testing makes sure that alterations to the code won't affect the system's functionality. 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.
- User Acceptance testing: It involves testing software systems from the user's perspective to ensure they meet the requirements. Before software is released to market or production, it must pass the user acceptance test.
105. Explain how functional testing is performed or what are the steps to carry out functional testing.
解释如何执行功能测试,或执行功能测试的步骤是什么。
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37afa58d557c902babd7e | 官方: 否 | 付费: 否
答案:
When performing functional testing, you should follow the steps below as outlined in the following diagram:
执行功能测试时,应按照下图所示的步骤进行:
- Understand the requirements: Prior to conducting functional testing, it is necessary to thoroughly understand the business requirements. Understand the requirements document specification and clarify any doubts and queries if there are any.
- Prepare a test plan: An effective test plan is critical for successful functional testing. Test engineers need to focus on the objectives of tests so that planning and organizing test activities will become easier.
- Write test cases: Write the test cases considering the software requirements and keeping all of the test scenarios in mind.
- Create input data according to requirements: Testers need to prepare input data to test specific functionality of software applications. When this type of data is used to test an application, it is referred to as test input data. From these inputs, determine what the expected outcome should be.
- Execute test cases: Next, the test input data is used to execute the test cases.
- Compare actual and expected outcomes through the result validation: In this step, the actual test results are compared with the expected results to determine whether the test has passed or failed.
- Log defects: The variation of the difference between the actual and expected output is referred to as a log defect. It is the task of the testers to log defects so that the development teams can fix them as soon as possible.
106. State difference between functional and non-functional testing.
说明功能测试与非功能测试之间的区别。
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37afb58d557c902babd81 | 官方: 否 | 付费: 否
答案:
The two major types of software testing are functional testing and non-functional testing. - Functional Testing: This type of testing verifies that each feature/function of a software application works as intended. A functional test can only be passed if a software system has all its functions working as intended.
软件测试的两大类型是功能测试和非功能测试。- 功能测试:此类测试验证软件应用程序的每个特性/功能是否按预期工作。如果软件系统所有功能均按预期运行,功能测试才能通过。
Non-Functional Testing: This type of testing examines non-functional aspects like performance, usability, compatibility, reliability, etc., of a software system. This process verifies whether the system behaves as expected or not.
Functional vs Non-Functional Testing:功能测试与非功能测试:
| Functional Testing 功能测试 | Non-Functional Testing 非功能测试 |
|---|---|
| It verifies that the actions and operations of an application perform as expected. 它验证应用程序的操作和运行是否符合预期。 | It verifies how an application behaves. 它验证应用程序的行为方式。 |
| Business requirements are taken into account when functional testing is done. 功能测试时考虑业务需求。 | Non-functional testing is performed according to customer expectations and performance requirements. 非功能测试根据客户期望和性能要求进行。 |
| This testing determines whether the results are consistent with expectations. 此测试确定结果是否与预期一致。 | This testing measures the speed and response time of a software application under specific conditions. 此测试测量软件应用程序在特定条件下的速度和响应时间。 |
| Customer feedback assists in reducing the risks associated with a product. 客户反馈有助于降低与产品相关的风险。 | Feedback from the customer is more valuable for non-functional testing because it allows for improvement and enables the tester to learn the customer's expectations. 客户反馈对于非功能测试更有价值,因为它允许改进,并使测试人员了解客户的期望。 |
| Testing tools such as manual and automation are used to perform functional testing first. 首先使用手动和自动化等测试工具进行功能测试。 | Manual testing can be problematic due to the non-functional testing process, which takes into account scalability, reliability, speed, and other performance parameters. 手动测试可能存在问题,因为非功能测试过程要考虑到可扩展性、可靠性、速度和其他性能参数。 |
| Functional Testing Examples: Unit Testing, Smoke Testing, Integration Testing, Regression Testing, Sanity Testing, etc. 功能测试示例:单元测试、冒烟测试、集成测试、回归测试、健全性测试等。 | Examples: Performance Testing, Load Testing, Stress Testing, Scalability Testing, Volume Testing, etc. 示例:性能测试、负载测试、压力测试、可扩展性测试、容量测试等。 |
107. Explain unit testing vs functional testing.
解释单元测试与功能测试的比较。
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37afb58d557c902babd84 | 官方: 否 | 付费: 否
答案:
Testing software or applications aims to build a quality product. Functional testing and unit testing are the backbones of software testing. - Unit Testing: In its simplest form, unit testing entails testing individual components or units within the software. In this step, each unit of code is validated and checked to determine if it is performing as you expected it to.
测试软件或应用程序旨在构建高质量的产品。功能测试和单元测试是软件测试的支柱。- 单元测试:最简单的形式是,单元测试涉及对软件中的各个组件或单元进行测试。在此步骤中,每个代码单元都会被验证和检查,以确定其是否按预期执行。
Functional Testing: This type of software testing evaluates a system's functionality against the functional requirements. Each software component is first checked for its expected output, then tested twice to ensure that its output does not impact the rest of the system.
Unit Testing Vs Functional Testing:单元测试与功能测试的对比:
| Unit Testing 单元测试 | Functional Testing 功能测试 |
|---|---|
| In this type of test, the smallest units or modules are tested individually. 在这种测试中,最小的单元或模块会被单独进行测试。 | It verifies that an application performs as expected. 它验证应用程序是否按预期执行。 |
| It is possible to find issues that crop up frequently in modules by running unit tests. 通过运行单元测试,可以发现在模块中频繁出现的问题。 | A functional test identifies the issues preventing an application from performing correctly. This may include scenario-based issues as well. 功能测试会识别阻止应用程序正常运行的问题,这也可能包括基于场景的问题。 |
| There is no chance for the issue to escape. 问题没有逃脱的机会。 | As the number of tests to run is always infinite, there is a higher chance of issues escaping. 由于需要运行的测试数量总是无限的,因此问题逃脱的机会更高。 |
| In other words, it is a form of white-box testing. 换句话说,它是白盒测试的一种形式。 | Essentially, it is black-box testing. 本质上,它是黑盒测试。 |
| A unit test is fast and can help write clean code, but it cannot assure that the app will work as intended. It shows us where errors are in the code, though. 单元测试速度快,有助于编写干净的代码,但不能保证应用程序会按预期运行。不过,它能向我们展示代码中的错误位置。 | A functional test takes time and effort but ensures the system will meet functional requirements. The test identifies any problems or defects in the functionality. 功能测试需要花费时间和精力,但确保系统能满足功能需求。该测试会识别功能中的任何问题或缺陷。 |
- Data Science
- All Events
- My Events
108. What do you mean by functional testing vs regression testing?
你所说的功能测试与回归测试有何区别?
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37afb58d557c902babd87 | 官方: 否 | 付费: 否
答案:
- Functional testing: It involves checking that an application's functions work as expected. It is usually a black box testing process. The purpose of functional testing is to make sure the product designed by developers meets the requirements as specified by stakeholders.
- Regression testing: This process is conducted once a software build has been released. The purpose of this test is to ensure adding fresh code, improvements, or fixing bugs does not cause instability or compromise the software functionality.
109. Explain Adhoc testing.
解释什么是随意的(Adhoc)测试。
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37afb58d557c902babd8a | 官方: 否 | 付费: 否
答案:
The term Adhoc Testing, also known as random testing, generally refers to a type of testing that occurs without proper planning or documentation. Adhoc testing has - No documentation
术语“Adhoc 测试”,也称为随机测试,通常指一种在没有适当规划或文档的情况下进行的测试类型。Adhoc 测试具有 - 无文档记录
- No Test cases
- No Test Design
Ad hoc testing is usually performed randomly without documentation or testing design and it is usually unplanned. Ad hoc Testing does not adhere to any particular structure and is done randomly on any part of the application to identify defects/bugs. When time is limited and exhaustive testing cannot be performed, adhoc testing may be conducted. The tester needs to have a thorough understanding of the system under test in order to conduct effective adhoc testing.
Ad hoc 测试通常在无文档或测试设计的情况下随机执行,并且通常是无计划的。Ad hoc 测试不遵循任何特定结构,并在应用程序的任何部分随机进行以识别缺陷/错误。当时间有限且无法进行详尽测试时,可能会进行 adhoc 测试。测试人员需要对被测系统有透彻的了解,才能有效地执行 adhoc 测试。
Example: Adhoc testing is cost-effective and can save you a lot of time; one example would be when the client needs the product by 4 PM today, but the development will be finished by 2 PM. With only 2 hours to work with, the developer and tester team can test the system as a whole by taking some random inputs and checking for bugs.
示例:Adhoc 测试具有成本效益且能节省大量时间;一个例子是,当客户需要在今天下午 4 点前拿到产品,但开发将在下午 2 点完成时。只有 2 个小时可用,开发人员和测试人员团队可以通过输入一些随机输入并检查错误来整体测试系统。
110. How does 'Build' differ from 'Release'?
“构建”(Build)与“发布”(Release)有何不同?
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37afb58d557c902babd8d | 官方: 否 | 付费: 否
答案:
- Build: Once the source code for the software application is developed, developers convert it into standalone or executable form (build). As soon as the build has been completed, the development team passes it on to the testing team for testing. The software testing team checks this build for multiple bugs and if it fails to meet the requirements, the build is rejected. A build occurs prior to the release, and it is generated more frequently. During software development, several builds are generated.
- Release: At the end of development and testing, the release is the final product. As soon as the software is tested and certified, it is delivered to the customer. It is possible, however, for a release to have multiple builds. As such, it refers to the software developed after the testing and development phases are completed.
111. Explain risk-based testing and what important factors are needed to be considered in risk-based testing.
解释基于风险的测试,以及基于风险的测试中需要考虑哪些重要因素。
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37afb58d557c902babd90 | 官方: 否 | 付费: 否
答案:
Risk-based testing refers to the process of prioritizing tests according to risk, which is used as a basis for developing a Test Strategy. An organization can use risk-based testing (RBT) to prioritize testing software features and functions according to the probability of failure, the importance of the feature, and the impact of a failure. Testing is then performed, starting with the highest risk. Testers who use a risk-based approach are more likely to be aware of risk factors that can lead to project failures.
基于风险的测试是指根据风险对测试进行优先级排序的过程,这被用作制定测试策略的基础。组织可以使用基于风险的测试(RBT)来根据失败概率、功能的重要性以及失败的影响,对测试软件特性和功能进行优先级排序。然后从最高风险开始执行测试。采用基于风险方法的测试人员更有可能意识到可能导致项目失败的风险因素。
Following are the main factors to be considered in risk-based testing: - Identification of when and how risk-based testing should be implemented on an appropriate application.
以下是基于风险的测试中需要考虑的主要因素:- 确定何时以及如何在适当的应用程序上实施基于风险的测试。
- To determine which measures are effective in detecting as well as handling risks in critical areas of the software application.
- Achieving the project outcome while balancing risk and quality.
112. What are the different Test Techniques used in Functional testing?
功能测试中使用了哪些不同的测试技术?
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37afb58d557c902babd93 | 官方: 否 | 付费: 否
答案:
Functional testing involves two distinct test techniques, which can be defined as follows: - Requirement based testing: This type of testing prioritizes the requirements based on risk factors. Furthermore, this will ensure that all critical test paths are covered in the testing process.
功能测试涉及两种不同的测试技术,可以定义如下:- 基于需求的测试:此类测试根据风险因素对需求进行优先级排序。此外,这将确保所有关键测试路径都涵盖在测试过程中。
- Business process-based testing: This type of functional testing examines the business process. Testing scenarios are based on knowledge of the business process. Examples include service delivery and deployment, etc.
113. State difference between Alpha and Beta testing.
说明 Alpha 测试和 Beta 测试之间的区别。
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37afb58d557c902babd96 | 官方: 否 | 付费: 否
答案:
- Alpha Testing: This is a type of internal acceptance testing performed by the company's software quality assurance team/developers. Testing is done to identify bugs before releasing a product to end-users or to the public.
- Beta Testing: It is the last phase following the internal full alpha test cycle, which is a form of external user acceptance testing. In this phase, companies release the software to a few outside groups other than their own test teams and employees. As a result, beta testing can be summarized as testing conducted by real users in a real environment.
Alpha vs Beta Testing: Learn More
Alpha 与 Beta 测试:了解更多
| Alpha Testing Alpha 测试 | Beta Testing Beta 测试 |
|---|---|
| Testers within the organization are responsible for performing Alpha Testing. 组织内部的测试人员负责执行 Alpha 测试。 | Beta testing is carried out by a few individuals/clients/users outside the organization. Beta 测试由组织外部的少数个人/客户/用户进行。 |
| During Alpha Testing, reliability and security are not thoroughly tested. 在 Alpha 测试期间,可靠性和安全性不会进行彻底测试。 | While Beta Testing, the product's availability, security, and robustness are examined. 而在 Beta 测试期间,会检查产品的可用性、安全性和健壮性。 |
| Blackbox and Whitebox testing are both included in Alpha Testing. Alpha 测试既包括黑盒测试也包括白盒测试。 | Blackbox testing is mostly involved in Beta testing. Beta 测试主要涉及黑盒测试。 |
| Issues and bugs encountered in Alpha Testing are immediately addressed and fixed. Alpha 测试中遇到的问题和缺陷会立即处理和修复。 | The majority of the issues and feedback from the beta testing will be implemented in the next software product version. Beta 测试中的大多数问题和反馈将在下一个软件产品版本中实现。 |
| During Alpha testing, quality is ensured before moving on to Beta testing. 在 Alpha 测试期间,确保质量后再进入 Beta 测试。 | During beta testing, the focus is not only on the quality of the product but also on gathering users' feedback and assessing whether it is ready for real-world usage. 在 Beta 测试期间,重点不仅在于产品质量,还在于收集用户反馈,并评估产品是否已准备好用于实际环境。 |
| Before launching the product into the market, it undergoes alpha testing. 产品投放市场前,会进行 Alpha 测试。 | During the marketing of a software product, beta testing is conducted. 在软件产品营销期间,会进行 Beta 测试。 |
114. What is the main difference between Monkey testing and Adhoc testing?
Monkey 测试和 Adhoc 测试之间的主要区别是什么?
- 知识点: 测试 (主题: functional-testing;标签: interviewbit, functional-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37afb58d557c902babd99 | 官方: 否 | 付费: 否
答案:
There are two different types of software testing that can be run on the software: monkey testing and adhoc testing. Tests are conducted to ensure that the system is bug-free. - Adhoc Testing: It is usually performed randomly without documentation or testing design and it is usually unplanned. The tester needs to have a thorough understanding of the system under test in order to conduct effective adhoc testing. It is meant to ensure that the application or system does not crash.
有两种不同类型的软件测试可以运行在软件上:monkey 测试和 adhoc 测试。测试是为了确保系统没有缺陷。 - Adhoc 测试:它通常随机执行,没有文档或测试设计,且通常是无计划的。测试人员需要对被测系统有透彻理解,才能进行有效的 adhoc 测试。其目的是确保应用程序或系统不会崩溃。
- Monkey Testing: This is similar to Ad Hoc Testing, except that it can be done by testers without any prior knowledge or information about the software. The monkey test is an automated test conducted without planning any specific test in advance. A tester tests the system by randomly trying its features to see if he can break it.
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万+职业规划
115. Discuss the working of the Test Script Recorder.
讨论测试脚本记录器的工作原理。
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1001 | 官方: 否 | 付费: 否
答案:
The HTTP(s) Test Script Recorder records all of your application's HTTP(s) queries to the server. It will only collect HTTP(s) requests, as the name implies. You can also use this recorder's grouping feature to structure your requests so that comparable requests are kept together. As needed, add URL patterns to the include and exclude lists. In order for JMeter to work, some configurations must be done there.
HTTP(s) 测试脚本记录器会记录应用程序发送到服务器的所有 HTTP(s) 查询。顾名思义,它只收集 HTTP(s) 请求。你还可以使用此记录器的分组功能来组织请求,以便将类似的请求放在一起。根据需要,将 URL 模式添加到包含和排除列表中。为了让 JMeter 正常工作,必须在那里进行一些配置。
The following are the steps to capture HTTPS traffic: - - HTTP(s) Test script recorder is to be added to WorkBench.
以下是捕获 HTTPS 流量的步骤: - - HTTP(s) 测试脚本记录器需要添加到 WorkBench 中。
- To start the proxy server, type in the port number.
- Select "Workbench" as the target, or include a Recording Controller in the test plan and use the same target to save all recordings.
- The proxy server should now be running.
- Manually configure your browser's proxy settings to the same port number as the test script recorder.
116. Explain the JMeter variable and function syntax.
解释 JMeter 变量和函数语法。
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37b7b58d557c902bb1004 | 官方: 否 | 付费: 否
答案:
Variables and functions are utilised in JMeter, just as they are in any other programming language, to make scripts reusable (since a function can be called again and again without having the need to write the same code again and again). Variables can be used to hold any value and then referenced anywhere in your code, just like any other programming language. So, with JMeter, it may be your server name, path, port number, or whatever else you want to save in a variable and utilise in multiple places afterwards.
JMeter 中使用了变量和函数,就像在任何其他编程语言中一样,以使脚本可重用(因为函数可以反复调用,而无需重复编写相同的代码)。变量可以用来保存任何值,然后在代码中的任何位置引用,就像任何其他编程语言一样。因此,使用 JMeter,它可以是你的服务器名称、路径、端口号,或者你想保存在变量中并在以后多个位置使用的任何其他内容。
JMeter has a number of built-in routines that can be used to test various situations. If you're accessing an application on your machine IP rather than an external URL, for example, you can use the machine IP function to get your IP address. JMeter's Function Dialogue may be found in the settings menu, where you can examine the definition and function string.
JMeter 有许多内置例程,可用于测试各种情况。例如,如果你通过机器的 IP 访问应用程序,而不是使用外部 URL,可以使用机器 IP 函数来获取你的 IP 地址。JMeter 的“函数对话框”可以在设置菜单中找到,你可以在那里查看定义和函数字符串。
The syntax for calling a variable and function in your script is shown below. - Variable – {varName}.Here, varName denotes the name of the variable.Example – {name}
在脚本中调用变量和函数的语法如下所示。 - 变量 – {varName}。这里,varName 表示变量的名称。例如 – {name}
- Function – {_functionName}.Here, functionName denotes the name of the function.Example – {_counter()}, {_threadNum} etc.
117. What protocols are supported by JMeter?
JMeter 支持哪些协议?
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1007 | 官方: 否 | 付费: 否
答案:
JMeter supports a number of standard protocols, including: - Web: HTTP/HTTPs
JMeter 支持多种标准协议,包括: - Web:HTTP/HTTPs
- Web Services: SOAP / XML-RPC
- Database via JDBC drivers
- Directory: LDAP
- Messaging Oriented service via JMS
- Service: POP3, IMAP, SMTP
- FTP (File Transfer Protocol) Service
118. Discuss some of the features of JMeter.
讨论 JMeter 的一些特性。
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb100a | 官方: 否 | 付费: 否
答案:
The following are some of the features of Apache JMeter: - The ability to load and performance test a wide range of apps, servers, and protocols. This includes the following :
以下是 Apache JMeter 的一些特性: - 能够对广泛的应用程序、服务器和协议进行负载和性能测试。这包括以下内容:
Web - HTTP, HTTPS (Java, NodeJS, PHP, ASP.NET, …) SOAP (Simple Object Access Protocol)/ REST (Representational State Transfer) Web Services FTP (File Transfer Protocol) Database via JDBC (Java Database Connectivity) LDAP (Lightweight Directory Access Protocol) Message-oriented middleware (MOM) via JMS (Java Message Service) Mail - SMTP (Simple Mail Transfer Protocol)(S), POP3 (Post Office Protocol 3)(S) and IMAP (Internet Message Access Protocol)(S) Native commands or shell scripts TCP (Transmission Control Protocol) Java Objects - Full-featured Test IDE for recording (from browsers or native applications), developing, and debugging Test Plans (A Test Plan is where you add elements that are needed for your JMeter Test.)
Web - HTTP、HTTPS(Java、NodeJS、PHP、ASP.NET 等)SOAP(简单对象访问协议)/ REST(表征状态传输)Web 服务 FTP(文件传输协议)通过 JDBC(Java 数据库连接)访问数据库 LDAP(轻量级目录访问协议)通过 JMS(Java 消息服务)访问面向消息的中间件(MOM)邮件 - SMTP(简单邮件传输协议)(S)、POP3(邮局协议 3)(S) 和 IMAP(互联网消息访问协议)(S) 原生命令或 Shell 脚本 TCP(传输控制协议)Java 对象 - 用于记录(从浏览器或原生应用程序)、开发和调试测试计划的全功能测试 IDE(测试计划是添加 JMeter 测试所需元素的地方。)
- To load-test from any Java-compatible OS (Linux, Windows, Mac OSX,...), use CLI mode (Command-line mode (formerly termed Non-GUI) / headless mode).
- It has the option to generate a dynamic HTML report that is full and ready to present.
- The ability to extract data from the most popular response formats, such as HTML, JSON, XML, or any textual format, allows for easy correlation.
- Complete portability and Java purity are guaranteed in Jmeter.
- Concurrent sampling by several threads and simultaneous sampling of distinct functions by separate thread groups are both possible with a full multithreading framework.
- It also has the option of test results caching and analysis/replaying offline.
Extensible core:
Pluggable Samplers offer limitless testing capabilities. With pluggable timers, you can choose from a variety of load statistics. Plugins for data analysis and visualisation offer a lot of flexibility and personalization. The employment of functions can be utilised to offer dynamic input to a test or to manipulate data. 3rd party Open Source libraries for Maven, Gradle, and Jenkins make Continuous Integration simple.可插拔的采样器提供了无限制的测试能力。使用可插拔的定时器,你可以从多种负载统计中选择。用于数据分析和可视化的插件提供了很大的灵活性和个性化程度。函数的使用可以用于为测试提供动态输入或操作数据。用于 Maven、Gradle 和 Jenkins 的第三方开源库使持续集成变得简单。
119. What exactly is a workbench?
工作台到底是什么?
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb100d | 官方: 否 | 付费: 否
答案:
A workbench is a storage location for adding some components to the test plan if necessary. Workbench components are not immediately saved with the test plan. They must be saved as test fragments individually. The HTTP(s) Test script recorder is a key component of the Workbench, as it allows you to record HTTPS requests and then apply a load on +9859 them to assess response time.
工作台是一个存储位置,用于在必要时向测试计划添加一些组件。工作台组件不会立即随测试计划保存,它们必须单独保存为测试片段。HTTP(S)测试脚本录制器是工作台的关键组件,因为它允许你录制HTTPS请求,然后对它们施加负载以评估响应时间。
120. What are the various kinds of listeners?
监听器有哪些种类?
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1010 | 官方: 否 | 付费: 否
答案:
Performance testing is examining server responses in multiple formats before delivering them to the client. As a sampler component of JMeter is implemented, listeners give a graphical representation of data gathered by JMeter regarding those test cases. The user can view sampler results in the form of tables, graphs, trees, or plain text in a log file.
性能测试是在将服务器响应交付给客户端之前,以多种格式对其进行检查。作为JMeter的采样器组件实现,监听器以图形化方式呈现JMeter针对这些测试用例收集的数据。用户可以以表格、图形、树形或日志文件中的纯文本形式查看采样器结果。
Listeners can be changed at any point during the test, including within the test plan. JMeter provides roughly 15 listeners, but the most commonly used ones are table, tree, and graph. In short, Listeners are used to storing the results of load testing execution in various formats, such as a table, tree, graph or any other appropriate format that may be given to the client. JMeter comes with a variety of built-in listeners, and many more can be added through plugins, depending on your needs. The following are a few of the inbuilt listeners: View Results in Table, Graph Results, Aggregate Report, Aggregate Graph, Response Time Graph and Assertion Results.
监听器可以在测试期间任何时点更改,包括测试计划内。JMeter大约提供15种监听器,但最常用的是表格、树形和图形。简而言之,监听器用于以各种格式(如表格、树形、图形或任何其他可提供给客户端的适当格式)存储负载测试执行结果。JMeter自带多种内置监听器,并且根据需求,可通过插件添加更多。以下是几种内置监听器:在表格中查看结果、图形结果、聚合报告、聚合图形、响应时间图形和断言结果。
121. In JMeter, explain the purpose of correlation.
在JMeter中,解释关联的用途。
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1015 | 官方: 否 | 付费: 否
答案:
Correlation is the process of taking values from a server response and then storing them in a variable that will be used in subsequent requests. Correlation is the way of acquiring some value from one step's response and transferring it to another step's request. It catches and saves the server's dynamic answer before passing it on to subsequent requests. When a response returns different data for each iterating request, it is termed dynamic, and this can sometimes affect subsequent requests. Correlation is a critical step in the performance load test scripting process since if it isn't handled properly, the script will become ineffective. One of the most fundamental components of scripting is a correlation. It retrieves dynamic data from previous requests and posts it to new requests.
关联是从服务器响应中获取值,然后将其存储在变量中,用于后续请求的过程。关联是从一个步骤的响应中获取某个值并将其传输到另一个步骤的请求中的方式。它捕获并保存服务器的动态响应,然后再将其传递给后续请求。当每个迭代请求的响应返回不同数据时,这被称为动态响应,有时可能影响后续请求。关联是性能负载测试脚本编写过程中的一个关键步骤,因为如果处理不当,脚本将变得无效。关联是脚本编写最基本组成部分之一,它从先前请求中检索动态数据,并将其发布到新请求中。
For example, if you need to test any login feature and need to use the session ID or the cookie ID, you can obtain the values from the login page's GET response and use them dynamically for login in a POST request.
例如,如果你需要测试任何登录功能并使用会话ID或Cookie ID,可以从登录页面的GET响应中获取这些值,并在POST请求中动态使用它们进行登录。
122. Discuss Gaussian and Poisson Timers.
讨论高斯和泊松定时器。
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1018 | 官方: 否 | 付费: 否
答案:
JMeter sends requests immediately, with no latency between samplers or requests. Your server will be overburdened if you perform load/stress testing immediately. Then it won't be able to provide you with realistic findings and won't be able to mimic real-world user traffic. JMeter Timers are the answer to all of these issues. To apply a wait between each sampler/request, a timer element can be added to a test plan.
JMeter会立即发送请求,在采样器或请求之间没有延迟。如果你立即执行负载/压力测试,你的服务器会过载,这样将无法提供真实的结果,也无法模拟真实世界的用户流量。JMeter定时器是所有这些问题的解决方案。为了在每个采样器/请求之间应用等待时间,可以向测试计划添加定时器元素。
Both Gaussian and Poisson Timers are based on a mathematical formula with a constant delay and offset. - JMeter Gaussian Random Timer is used to produce and add a random delay before executing a sampler, as the name implies. Each user request is delayed for a random period of time using the Gaussian Random Timer element. Based on the Gaussian curve distribution, it has a random deviation around the Constant Delay Offset. The sum of the Gaussian distributed value (with mean 0.0 and standard deviation 1.0) times the deviation value you choose and the offset value is the delay (think) time.
高斯和泊松定时器都基于包含恒定延迟和偏移的数学公式。- JMeter高斯随机定时器用于在执行采样器之前产生并添加随机延迟,顾名思义。每个用户请求都使用高斯随机定时器元素延迟随机时间。基于高斯曲线分布,它在恒定延迟偏移周围有随机偏差。延迟(思考)时间等于高斯分布值(均值为0.0,标准差为1.0)乘以你选择的偏差值再加上偏移值的总和。
- JMeter Poisson Random Timer is also used to produce and add a random delay before executing a sampler. The Poisson Distribution Function is used to create this timer. The total of the Poisson distributed value multiplied by the defined lambda value and the offset value is the delay (think) time.
123. What is the maximum number of threads that should be allowed on a single system?
在单个系统上应允许的最大线程数是多少?
- 知识点: 测试 / 行为与软技能 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: behavioral | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb101c | 官方: 否 | 付费: 否
答案:
It depends on your system's hardware setup, which includes a processor, JVM, and allotted memory -Xmx, among other things. The number of components in your test plan, such as the number of config items or processors, as well as whether you are using GUI or Non-GUI Mode, have an impact on thread count.
这取决于你系统的硬件配置,包括处理器、JVM和分配的内存(-Xmx)等。测试计划中的组件数量(如配置项或处理器数量),以及你是否使用GUI或非GUI模式,都会影响线程数。
124. What is assertions in JMeter?
JMeter中的断言是什么?
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb101f | 官方: 否 | 付费: 否
答案:
In JMeter, assertions are used to validate the response to a request that you have given to the server. The assertion is the process of comparing the expected and actual results of a request at runtime. If you want to apply assertion to a certain Sampler, make it a child of that Sampler. By adding "Assertion Listener" to the Thread Group, you can see assertion outcomes. Other listeners will be able to see failed assertions as well.
在JMeter中,断言用于验证你发送给服务器的请求的响应。断言是在运行时比较请求的预期结果和实际结果的过程。如果要对某个采样器应用断言,请将其设为该采样器的子节点。通过向线程组添加“断言监听器”,你可以查看断言结果。其他监听器也能看到失败的断言。
Some common assertions in JMeter are: - Response Assertion: Response Assertion is used for combining and comparing pattern strings against one or more server response values.
JMeter中一些常见的断言包括:- 响应断言:响应断言用于将一个或多个服务器响应值与模式字符串进行组合和比较。
- Size Assertion: Size Assertion is used to check whether the server response includes the expected number of bytes.
- Duration Assertion: The Duration Assertion is used to check whether or not a server response is received within a defined time limit. If the response takes longer than the specified time, the sample request will be marked as unsuccessful.
- XML Assertion: XML Assertion is used to check whether the server response data contains a valid XML document.
- HTML Assertion: HTML Assertion is used to ensure that the response contains proper HTML syntax and that JTidy is not being used (HTML Syntax Checker). If the HTML syntax response is incorrect, the test will fail.
125. What are the various data parameterization options in JMeter?
JMeter 中有哪些数据参数化选项?
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1022 | 官方: 否 | 付费: 否
答案:
Data parameterization allows test scripts to be reused by removing the need for hardcoding values for the same request with varied parameters. In a single test script, parameterization is the process of establishing distinct datasets for different users. For instance, in the same script, executing numerous users with different credentials. As a result, it's one of the most important components of creating performance testing.
数据参数化允许通过消除对相同请求硬编码不同参数值的需求,使测试脚本可重用。在单个测试脚本中,参数化是为不同用户建立不同数据集的过程。例如,在同一脚本中,使用不同凭据执行多个用户。因此,它是创建性能测试最重要的组成部分之一。
The data parameterization provided by JMeter is listed below: - Config of a CSV Data Set - The CSV Data Set Config reads all values from a CSV file, stores them in variables, and uses them as Test Data during execution. The "CSV Data Set Config" allows you to save unique user data such as names, emails, and passwords in CSV files as an external data source. JMeter can read the CSV file line by line with the help of this config element, and then use split parameters to assign different values to separate threads.
JMeter 提供的数据参数化如下: - CSV 数据集配置 - CSV 数据集配置从 CSV 文件中读取所有值,将其存储在变量中,并在执行期间用作测试数据。“CSV 数据集配置”允许您将唯一的用户数据(如姓名、电子邮件和密码)作为外部数据源保存在 CSV 文件中。借助此配置元素,JMeter 可以逐行读取 CSV 文件,然后使用分割参数将不同值分配给不同线程。
Variables that are defined by the user - User-defined variables (UDV) are used to define specific variables that can hold values that you need in several places. UserDefinedVariables differ from CSVDataSetConfig in that CSV can hold hundreds of thousands of values, whilst UDV is only suited for tiny data sets.
You can also specify variable/user values in UDV. This could be useful in instances where two users should use the same value and the next two users should use a different value. Also, if you declare a variable at the Test Plan/Thread Group level and then have the same variable with a different value inside one of two thread groups or a specific sampler. In this scenario, the local variable will override the global variable.您还可以在 UDV 中指定变量/用户值。这在两个用户应使用相同值,而接下来的两个用户应使用不同值的情况下可能很有用。此外,如果您在测试计划/线程组级别声明一个变量,然后在两个线程组之一或特定采样器中拥有相同变量但不同值,则局部变量将覆盖全局变量。
126. Explain configuration elements in JMeter.
解释 JMeter 中的配置元素。
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1025 | 官方: 否 | 付费: 否
答案:
JMeter's config components are used to customise or change the sampler queries sent to the server. These components are inserted at the same level as or higher than the samplers we want to configure. A Sampler and a configuration element work in conjunction. Configuration elements can be used to set defaults and variables for subsequent usage by samplers. These elements are processed at the start of the scope before any samplers in the same scope.
JMeter 的配置组件用于自定义或更改发送到服务器的采样器查询。这些组件插入在与我们要配置的采样器相同或更高的级别。采样器和配置元素协同工作。配置元素可用于设置默认值和变量,以供后续采样器使用。这些元素在作用域开始时、同一作用域中任何采样器之前被处理。
127. Mention the order of execution of JMeter test plan elements.
提及 JMeter 测试计划元素的执行顺序。
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1028 | 官方: 否 | 付费: 否
答案:
The execution order of the test plan elements is - - Configuration elements- The Configuration Element allows us to declare variables that Samplers can utilise to access data.
测试计划元素的执行顺序为 - - 配置元素 - 配置元素允许我们声明变量,采样器可利用这些变量访问数据。
- Pre-processors- PreProcessors are JMeter elements that are used to perform actions prior to the execution of sampler queries in a test scenario.
- Timers- A JMeter Timer is an inbuilt JMeter plug-in that can assist you in timing out your sampler requests. Many testers refer to this pause in requests as "think time," as it simulates the time spent by real users between steps in a real-world scenario.
- Samplers- JMeter uses samplers to make several types of queries to a server. JMeter provides genuine queries to the web server under test using samplers. Except for Test Action, each sampler delivers one or maybe more sample results.
- Post-processors- After the sampler, a Post-Processor element is executed and can be used for the post-condition response. If a Preprocessor is included in a test plan, it will be run after the response has been received. A Post-Processor is frequently used to extract information from a response to a specific action.
- Assertions- In JMeter, assertions are used to verify the response to a request that you have given to the server. The assertion is the process of comparing the expected and actual results of a request at runtime.
- Listeners- A listener is a component that displays the sample results. The output can be displayed in the form of a tree, tables, graphs, or simply sent to a log file.
128. What are the different types of processors available in JMeter?
JMeter 中有哪些不同类型的处理器?
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb102d | 官方: 否 | 付费: 否
答案:
In JMeter, there are two types of processors: the Pre-Processor and the Post-Processor. - Pre-Processors run before the main sampler and have the ability to change the scope of the sampler. PreProcessors are JMeter elements that are used to perform actions prior to the execution of sampler requests in a test scenario. PreProcessors can be used for a variety of performance testing tasks, such as retrieving data from a database, setting a timeout between sampler operations, or generating test data.
在 JMeter 中,有两种类型的处理器:预处理器和后处理器。 - 预处理器在主采样器之前运行,并具有更改采样器作用域的能力。预处理器是 JMeter 元素,用于在测试场景中采样器请求执行之前执行操作。预处理器可用于各种性能测试任务,例如从数据库检索数据、设置采样器操作之间的超时时间或生成测试数据。
- Post Processors run after the main sampler and apply to all samplers in the same Test Plan scope. They're useful for extracting fields from server responses and storing them in variables. The Post Processors are test plan elements that are used to do certain activities after a sampler request has been processed. These post processors are typically used to extract specific data from a sampling request's response, for example, we can extract the value of session variables from an HTTP request and send the value of the session variable to subsequent requests.
129. Discuss about Samplers and Thread Groups in JMeter.
讨论 JMeter 中的采样器和线程组。
- 知识点: 测试 / 行为与软技能 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: behavioral | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1030 | 官方: 否 | 付费: 否
答案:
- A Thread Group is a collection of threads that are all working on the same problem. Every JMeter test plan starts with this element. Multiple thread groups are provided, each of which can be set to imitate how users interact with the application, how the load is sustained, and for how long.
- JMeter's samplers allow JMeter to make various types of requests to a server. JMeter provides genuine queries to the web server under test using samplers. Except for Test Action, each sampler generates one or more sample results. The sample results can be viewed in several ways and have various features (success/failure, elapsed time, data quantity, etc.).
130. Explain the usage of Regular Expression in JMeter. Also discuss the difference between ‘contains’ and ‘matches’.
解释 JMeter 中正则表达式的使用。同时讨论“包含”和“匹配”之间的区别。
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1033 | 官方: 否 | 付费: 否
答案:
Pattern-based regular expressions are used to find and manipulate text in Jmeter. JMeter uses the pattern matching software Apache Jakarta ORO to parse regular expressions or patterns used throughout a JMeter test plan.
基于模式的正则表达式用于在 JMeter 中查找和操作文本。JMeter 使用模式匹配软件 Apache Jakarta ORO 来解析 JMeter 测试计划中使用正则表达式或模式。
We can save a lot of time and have more flexibility when creating or improving a Test Plan by using regular expressions. When it's impossible or very difficult to predict an outcome, regular expressions provide an easy way to acquire information from sites. Regular Expressions are used to dynamically extract values from responses. These values can be kept for reporting purposes or used in a subsequent request. Both Pre-Processors and Post-Processors make use of regular expressions.
通过使用正则表达式,我们在创建或改进测试计划时可以节省大量时间并具有更多灵活性。当预测结果不可能或非常困难时,正则表达式提供了一种从站点获取信息的简单方法。正则表达式用于从响应中动态提取值。这些值可保留用于报告目的,或在后续请求中使用。预处理器和后处理器都使用正则表达式。
The distinction between contains and matches, as used on the Response Assertion test element, is worth mentioning. - The term “contains” indicates that at least some of the target was matched by the regular expression. Consider the string ‘alphabet’ and the regular expression ‘ph.b.’. Because the regular expression matches the substring 'phabe', we can say that 'alphabet' contains 'ph.b.'.
值得提及“包含”和“匹配”在响应断言测试元素中的区别。 - 术语“包含”表示正则表达式匹配了目标的至少一部分。考虑字符串“alphabet”和正则表达式“ph.b.”。由于正则表达式匹配子字符串“phabe”,我们可以说“alphabet”包含“ph.b.”。
- The term "matches" refers to the regular expression matching the entire target. As a result, 'alphabet' and 'al.*t' are "matched."
131. In JMeter, how do you set up a master-slave configuration?
在 JMeter 中,如何设置主从配置?
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7b58d557c902bb1036 | 官方: 否 | 付费: 否
答案:
A master-slave configuration is a type of distributed testing in which multiple machines are used to load test a single server.
主从配置是一种分布式测试类型,其中使用多台机器对单个服务器进行负载测试。
It's critical that all machines are connected to the same network and have the same JMeter version. In distributed testing, one machine is designated as the master, while the others are designated as slaves.
所有机器必须连接到同一网络并具有相同的 JMeter 版本,这一点至关重要。在分布式测试中,一台机器被指定为主机,而其他机器被指定为从机。
The procedure is as follows: - Edit the JMeter.properties file on the master system and add the IP addresses of slave machines to the remote host column.
过程如下:- 在主系统上编辑 JMeter.properties 文件,并将从机器的 IP 地址添加到远程主机列中。
- Save the file and then reopen JMeter.
- Select Remote Start from the RUN menu in JMeter and enter the IP address of the system to be invoked.
- To start all the slave machines for testing, go to the RUN menu and select Remote Start all.
132. What is Distributed Testing?
什么是分布式测试?
- 知识点: 测试 (主题: jmeter, performance-testing;标签: interviewbit, jmeter, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: system-design
- 分类: fullstack
- id: 69b37b7b58d557c902bb1039 | 官方: 否 | 付费: 否
答案:
Distributed testing refers to the use of numerous machines for load testing (Load testing is the technique of simulating several users accessing a software at the same time in order to mimic the expected usage of the application), with one serving as the master and the others as slaves. It is critical to notice that all machines must be connected to the same network and run the same version of Java and JMeter.
分布式测试指使用多台机器进行负载测试(负载测试是模拟多个用户同时访问软件以模仿预期应用使用情况的技术),其中一台作为主机,其他作为从机。关键要注意所有机器必须连接到同一网络,并运行相同版本的 Java 和 JMeter。
We'll utilise a local client as a master to manage the test execution for multiple remote clients, and each remote client will act as a slave to run the test on our target server. Each slave system runs the load tests according to the master's exact device specifications. As a result, distributed performance testing enables us to handle a greater number of concurrent users contacting the target server.
我们将使用本地客户端作为主机来管理多个远程客户端的测试执行,每个远程客户端将作为从机在我们的目标服务器上运行测试。每个从机系统根据主机的精确设备规格运行负载测试。因此,分布式性能测试使我们能够处理更多并发用户访问目标服务器。
133. What is a test suite?
什么是测试套件?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12e4 | 官方: 否 | 付费: 否
答案:
A test suite is a bundle of multiple unit test cases which can be run together. The following image represents how to test suite looks like:
测试套件是多个单元测试用例的集合,可以一起运行。下图展示了测试套件的外观:
We can use @RunWith and @Suite annotations over the test class for running the test suite.
我们可以使用 @RunWith 和 @Suite 注解在测试类上运行测试套件。
134. What is Unit Testing?
什么是单元测试?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12e7 | 官方: 否 | 付费: 否
答案:
Unit testing is a software testing strategy that tests single entities like methods or classes at a time. This helps to ensure that the product quality is met as per the business requirements. It also helps in reducing the technical debt of the application by helping developers discover issues in the code logic due to any changes. It also gives insights into how the code logic implemented could impact future changes.
单元测试是一种软件测试策略,一次测试单个实体(如方法或类)。这有助于确保产品质量满足业务需求。它还有助于通过帮助开发人员发现由于任何更改导致的代码逻辑问题来减少应用程序的技术债务。它还能深入了解代码逻辑实现如何影响未来的更改。
The lifecycle of the unit testing process is as shown in the image below:
单元测试过程的生命周期如下图所示:
135. Why do we use JUnit? Who uses JUnit more - Developers or Testers?
为什么使用 JUnit?谁使用 JUnit 更多——开发人员还是测试人员?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12ea | 官方: 否 | 付费: 否
答案:
JUnit is used more often by developers for implementing unit test cases for the functionalities they have developed. However, these days testers also use this framework for performing unit testing of the applications.
JUnit 更常被开发人员用于实现其为已开发功能编写的单元测试用例。然而,如今,测试人员也使用此框架对应用程序执行单元测试。
JUnit is used due to the following reasons: - Helps in automating test cases.
使用 JUnit 的原因如下:- 有助于自动化测试用例。
- Helps in reducing defects in the code logic whenever the logic changes.
- Helps in reducing the cost of testing as the bugs are identified, captured and addressed at early phases in the software development.
- Helps to identify the gaps in coding and gives a chance to refactor the code.
136. What are the features of JUnit?
JUnit 的特性有哪些?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12ed | 官方: 否 | 付费: 否
答案:
Following are the features of JUnit : - JUnit is an open-source framework.
以下是 JUnit 的特性:- JUnit 是一个开源框架。
- Supports automated testing of test suites.
- Provides annotations for identifying the test methods.
- Provides assertions to test expected results or exceptions of the methods under test.
- Provides a platform for running test cases automatically and checking their results and giving feedback.
137. Is it mandatory to write test cases for every logic?
是否必须为每个逻辑编写测试用例?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12f0 | 官方: 否 | 付费: 否
答案:
No, it is not mandatory. However, test cases can be written for the logic which can be reasonably broken and tested independently.
不,这不是必须的。但是,可以为能够合理拆分并独立测试的逻辑编写测试用例。
138. What are some of the important annotations provided by JUnit?
JUnit 提供的一些重要注解有哪些?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12f3 | 官方: 否 | 付费: 否
答案:
Some of the annotations provided by JUnit are as follows: - @Test: This annotation over a public method of void return type can be run as a test case. This is a replacement of the org.junit.TestCase annotation.
JUnit 提供的一些注解如下:- @Test:此注解在返回类型为 void 的公共方法上,可作为测试用例运行。它是 org.junit.TestCase 注解的替代品。
- @Before: This is used when we want to execute the preconditions or any initialisation based statements before running every test case.
- @BeforeClass: This is used when we want to execute statements before all test cases. The statements may include test connections, common setup initialisation etc.
- @After: This is used when we want to execute statements after each test case. The statements can be resetting the variables, deleting extra memory used etc.
- @AfterClass: This is used when certain statements are required to be executed after all the test cases of the class are run. Releasing resource connections post-execution of test cases is one such example.
- @Ignores: This is used when some statements are required to be ignored during the execution of test cases.
- @Test(timeout=x): This is used when some timeout during the execution of test cases is to be set. The value of x is an integer that represents the time within which the tests have to be completed.
- @Test(expected=NullPointerException.class): This is used when some exception thrown by the target method needs to be asserted.
139. How will you write a simple JUnit test case?
你将如何编写一个简单的 JUnit 测试用例?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12f6 | 官方: 否 | 付费: 否
答案:
Let us understand how to write a simple JUnit Test Case using an example. Consider a Calculator class that has a method that adds 2 numbers:
让我们通过一个示例来理解如何编写简单的 JUnit 测试用例。考虑一个 Calculator 类,其中有一个方法用于将 2 个数相加:
public class Calculator {
公共类 Calculator {
public int add(int num1, int num2) {
公共 int add(int num1, int num2) {
return num1 + num2;
返回 num1 + num2;
}
}
Let us write a test case in JUnit 5 to this method under a class named CalculatorTest.
让我们在名为 CalculatorTest 的类下为这个方法编写一个 JUnit 5 的测试用例。
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Test;
public class CalculatorTest {
public class CalculatorTest {
Calculator calcObject;
Calculator calcObject;
@BeforeEach
@BeforeEach
void setUp() {
void setUp() {
calcObject = new Calculator();
calcObject = new Calculator();
}
@Test
@Test
@DisplayName("Add 2 numbers")
@DisplayName("将两个数字相加")
void addTest() {
void addTest() {
assertEquals(15, calcObject.add(10, 5));
assertEquals(15, calcObject.add(10, 5));
}
@RepeatedTest(5)
@RepeatedTest(5)
@DisplayName("Adding a number with zero to return the same number")
@DisplayName("将一个数字与零相加,返回相同的数字")
void testAddWithZero() {
void testAddWithZero() {
assertEquals(15, calcObject.add(0, 15));
assertEquals(15, calcObject.add(0, 15));
}
}
From the above example, we can see that: - @BeforeEach annotated method runs before each test case. In JUnit 4, this annotation was @Before.
从上述示例中可以看出:- 带有@BeforeEach注解的方法会在每个测试用例之前运行。在JUnit 4中,这个注解是@Before。
- @Test annotation indicates that the method is a test method.
- @DisplayName is used for defining the test name displayed to the user.
- assertEquals() method is used for validating whether the expected and actual values are equal.
- @RepeatedTest annotation indicates that the test method will be run 5 times.
140. What will happen if the return type of the JUnit method is String?
如果JUnit方法的返回类型是String,会发生什么?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12f9 | 官方: 否 | 付费: 否
答案:
The test case execution will fail because the JUnit methods are designed to return void.
测试用例的执行将会失败,因为JUnit方法被设计为返回void。
141. What is the importance of @Test annotation?
@Test注解的重要性是什么?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12fc | 官方: 否 | 付费: 否
答案:
@Test annotation is used for marking the method as a test method.
@Test注解用于将方法标记为测试方法。
142. What is a JUnit fixture?
什么是JUnit装置?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb12ff | 官方: 否 | 付费: 否
答案:
Fixture represents a fixed state of object sets used as a baseline for running test methods. This is to ensure there is a fixed and well-known environment where the results of the test methods are repeatable when run multiple times. The fixture has the following 2 methods: - setUp()This runs before every test case is run.
装置代表一组对象集的固定状态,用作运行测试方法的基线。这是为了确保有一个固定且已知的环境,使得测试方法的结果在多次运行时是可重复的。该装置有以下2个方法:- setUp() 它在每个测试用例运行之前执行。
- tearDown() This method is run after every test is run.
143. What is JUnit?
什么是JUnit?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb1302 | 官方: 否 | 付费: 否
答案:
JUnit is an open-source, Java-based unit testing framework that plays a crucial role in achieving the culture of TDD (Test Driven Development). The TDD culture lays strong emphasis on setting up the test data for testing a logic that would be implemented once the testing is successful. JUnit helps to increase the software stability as it helps in identifying the bug in the code logic at an early stage without requiring the software to go to production. This helps in reducing the time required to debug any issues later on.
JUnit是一个开源的、基于Java的单元测试框架,在实现TDD(测试驱动开发)文化中起着关键作用。TDD文化着重于设置测试数据来测试某个逻辑,该逻辑将在测试成功后实现。JUnit有助于提高软件稳定性,因为它能在早期识别代码逻辑中的错误,而不需要软件进入生产环境。这有助于减少后期调试任何问题所需的时间。
144. What is mocking and stubbing?
什么是模拟和桩?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb1305 | 官方: 否 | 付费: 否
答案:
Mocking is a phenomenon where an object mimics a real object. Whereas, stubbing are the codes responsible for taking place of another component. Mockito, EasyMock are some of the mocking frameworks in Java.
模拟是一种对象模仿真实对象的现象。而桩是负责替代另一个组件的代码。Mockito、EasyMock是Java中的一些模拟框架。
145. What are the JUnit Assert Methods?
JUnit断言方法有哪些?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb1308 | 官方: 否 | 付费: 否
答案:
Assert methods are utility methods that support assert conditions in test cases. They belong to the Assert class in JUnit 4 and the Assertions class in JUnit 5. It is recommended to import the assert methods statically to the test class for avoiding using the class as a prefix to the method. Let us consider an example of the Multiplier class:
断言方法是支持测试用例中断言条件的实用方法。它们属于JUnit 4中的Assert类和JUnit 5中的Assertions类。建议将断言方法静态导入到测试类中,以避免在方法前使用类名作为前缀。让我们考虑一个Multiplier类的示例:
public class Multiplier{
public class Multiplier{
public int multiply(int num1, int num2){
public int multiply(int num1, int num2){
return num1 * num2;
return num1 * num2;
}
}
Following are some of the assert methods: - assertEquals(): This method compares 2 objects for equality by making use of the equals() method of the object. This is shown in the test case that multiplies 2 methods and checks for the expected and actual value below.
以下是一些断言方法:- assertEquals():此方法通过使用对象的equals()方法比较两个对象是否相等。这在下面的测试用例中展示,该用例将两个数字相乘并检查预期值和实际值。
@Test
@Test
@DisplayName("Multiplying 2 numbers")
@DisplayName("Multiplying 2 numbers")
public void multiplyTest() {
public void multiplyTest() {
assertEquals(50, multiplier.multiply(10, 5));
assertEquals(50, multiplier.multiply(10, 5));
}
When two objects are found to be equal based on the equals() method implementation of the object, then assertEquals() returns normally. Else, an exception will be thrown and the test will stop its execution. - assertTrue(): This method tests whether the value of a variable is true.
当两个对象根据对象的 equals() 方法实现被判定为相等时,assertEquals() 正常返回。否则,会抛出异常并停止测试执行。- assertTrue():此方法测试变量的值是否为 true。
@Test
@Test
public void checkNumTest() {
public void checkNumTest() {
int num1 = 20;
int num1 = 20;
assertTrue("Number is not equal to 0", num1!=0);
assertTrue("Number is not equal to 0", num1!=0);
}
If the assertion fails, then an exception will be thrown and the test execution will be stopped. - assertFalse(): This method tests whether the value of a variable is false.
如果断言失败,则会抛出异常并停止测试执行。- assertFalse():此方法测试变量的值是否为 false。
@Test
@Test
public void checkNumTest() {
public void checkNumTest() {
int num1 = -20;
int num1 = -20;
assertFalse("Number is not greater than 0",num1>0);
assertFalse("Number is not greater than 0",num1>0);
}
If the assertion fails, then an exception will be thrown and the test execution will be stopped. - assertNull(): This method tests if a variable is null. If null, it returns normally else an exception will be thrown and the test stops execution.
如果断言失败,则会抛出异常并停止测试执行。- assertNull():此方法测试变量是否为 null。如果为 null,则正常返回,否则会抛出异常并停止测试执行。
@Test
@Test
public void checkNullTest() {
public void checkNullTest() {
int num1 = null;
int num1 = null;
assertNull("Number is null",num1);
assertNull("Number is null",num1);
} - assertNotNull(): This method tests whether a variable is not null. If it is not null, then the test returns normally else an exception will be thrown and the test stops its execution.
} - assertNotNull():此方法测试变量是否不为null。如果不为null,则测试正常返回,否则将抛出异常并停止测试执行。
@Test
@Test
public void checkNotNullTest() {
public void checkNotNullTest() {
int num1 = null;
int num1 = null;
assertNotNull("Number is null",num1);
assertNotNull("Number is null",num1);
} - assertSame(): This method checks if two references of the object are pointing to the same object.
} - assertSame():此方法检查对象的两个引用是否指向同一个对象。
@Test
@Test
public void checkAssertSameTest() {
public void checkAssertSameTest() {
Object num1 = new Object();
Object num1 = new Object();
Object num2 = new Object();
Object num2 = new Object();
assertSame(num1, num2);
assertSame(num1, num2);
}
If the object references are pointing to the same object, the test runs normally else, it will throw an exception and the test execution is aborted. - assertNotSame(): This method checks if two references of an object are not pointing to the same object.
如果对象引用指向同一个对象,测试正常运行;否则,将抛出异常并中止测试执行。 - assertNotSame():此方法检查对象的两个引用是否不指向同一个对象。
@Test
@Test
public void checkAssertSameTest() {
public void checkAssertSameTest() {
Object num1 = new Object();
Object num1 = new Object();
Object num2 = new Object();
Object num2 = new Object();
assertSame(num1, num2);
assertSame(num1, num2);
}
If the object references are not pointing to the same object, the test runs normally else, it will throw an exception and the test execution is aborted. - assertThat(): This method compares the object to org.hamcrest.Matcher for checking if it matches whatever the Matcher class requires for the object to match. Consider the following code.
如果对象引用未指向同一个对象,则测试正常运行;否则,它将抛出异常并中止测试执行。- assertThat():此方法将对象与org.hamcrest.Matcher进行比较,以检查对象是否符合Matcher类要求的匹配条件。考虑以下代码。
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.hasItems;
import static org.hamcrest.Matchers.hasItems;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Test;
public class MultiplierTest {
public class MultiplierTest {
@Test
@Test
public void assertThatTest() {
public void assertThatTest() {
assertThat(
assertThat(
Arrays.asList(1,2,3,4),
Arrays.asList(1,2,3,4),
hasItems(2,3));
hasItems(2,3));
}
}
In this code, we will be asserting that the list has some items specified in the hamcrest’s hasItems() method. If the assertThat is successful, i.e if the list indeed has items specified, then the test runs normally. Else, the test throws an exception and the test stops executing.
在此代码中,我们断言列表包含hamcrest的hasItems()方法中指定的某些元素。如果assertThat成功,即列表确实包含指定的元素,则测试正常运行。否则,测试抛出异常并停止执行。
146. What is the importance of @RunWith annotation?
@RunWith注解的重要性是什么?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb130b | 官方: 否 | 付费: 否
答案:
@RunWith annotation lets us run the JUnit tests with other custom JUnit Runners like SpringJUnit4ClassRunner, MockitoJUnitRunner etc. We can also do parameterized testing in JUnit by making use of @RunWith(Parameterized.class).
@RunWith注解允许我们使用其他自定义JUnit运行器(如SpringJUnit4ClassRunner、MockitoJUnitRunner等)运行JUnit测试。我们还可以通过使用@RunWith(Parameterized.class)在JUnit中进行参数化测试。
147. How does JUnit help in achieving tests isolation?
JUnit如何帮助实现测试隔离?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b7f58d557c902bb130e | 官方: 否 | 付费: 否
答案:
For calling test methods, JUnit creates separate individual instances of the test class. For example, if the test class contains 10 tests, then JUnit creates 10 instances of the class to execute the test methods. In this way, every test is isolated from the other.
为了调用测试方法,JUnit会为测试类创建单独的独立实例。例如,如果测试类包含10个测试,那么JUnit会创建10个类的实例来执行测试方法。这样,每个测试都是与其他测试隔离的。
148. What is Load Testing?
什么是负载测试?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1b96 | 官方: 否 | 付费: 否
答案:
Load testing is the process of examining how a system behaves under normal and significantly high loads by simulating real-world loads on the application. This testing helps us understand how well our application can cope with the peak loads simultaneously on the servers during the maximum demand scenarios. Without load testing, there are chances that we might have underestimated how well the application would perform, and when the application is under heavy user loads, the application might crash which could potentially result in huge losses to the business. Load testing is typically done when the development of the software/application is close to completion.
负载测试是通过在应用程序上模拟真实世界的负载,来检查系统在正常和显著高负载下表现如何的过程。这种测试帮助我们了解应用程序在最大需求场景下,服务器同时承受峰值负载时的应对能力。如果没有负载测试,我们可能会低估应用程序的性能表现,当应用程序承受大量用户负载时,应用程序可能会崩溃,这可能导致业务遭受巨大损失。负载测试通常在软件/应用程序的开发接近完成时进行。
149. Why do we need checkpoints and what are the types of checkpoints available in LoadRunner?
为什么我们需要检查点,以及LoadRunner中有哪些类型的检查点可用?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1b99 | 官方: 否 | 付费: 否
答案:
Checkpoints are the verification points that help to identify if your script has tested the flow properly. Sometimes, the script may not have tested the flow properly, but still, returned the test as PASS. To ensure that proper workflow has been followed, we use checkpoints. LoadRunner supports two types of checkpoints:
检查点是验证点,有助于识别你的脚本是否正确测试了流程。有时,脚本可能没有正确测试流程,但仍然返回测试结果为PASS。为了确保遵循了正确的工作流,我们使用检查点。LoadRunner支持两种类型的检查点:
Text checkpoint: This checkpoint confirms if a text string is present on the web page during run-time 2. Image checkpoint: This checkpoint confirms if an image is present on the web page during run-time
- 文本检查点:此检查点确认在运行期间网页上是否存在文本字符串。2. 图像检查点:此检查点确认在运行期间网页上是否存在图像。
We can enable the text and image checks in VuGen by making use of the web_find and web_image_check functions respectively. We can also enable this by enabling text and image checks from runtime settings as --> Go to Runtime Settings -> Click on “Preference” -> Enable Image and Text checkbox.
我们可以通过在VuGen中使用web_find和web_image_check函数分别启用文本和图像检查。我们还可以通过运行时设置来启用这些检查,操作如下:转到运行时设置 -> 点击“首选项” -> 勾选图像和文本检查框。
150. What is Elapsed Time in Load Runner?
什么是Load Runner中的已用时间(Elapsed Time)?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1b9c | 官方: 否 | 付费: 否
答案:
Elapsed time indicates how much time has elapsed (or passed) since the start of the current event. For the scenario status window, the elapsed time is measured from the exact moment the “Start Scenario” or “Initialize/Run Vuser” button is clicked. For the Vuser window, the elapsed time is calculated from the moment Vuser enters the “running” state.
已用时间表示自当前事件开始以来已经经过(或流逝)的时间。对于场景状态窗口,已用时间是从点击“开始场景”或“初始化/运行Vuser”按钮的确切时刻开始测量的。对于Vuser窗口,已用时间是从Vuser进入“运行”状态那一刻开始计算的。
151. How many types of scenarios are there in LoadRunner?
LoadRunner中有多少种场景类型?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1b9f | 官方: 否 | 付费: 否
答案:
LoadRunner has two types of scenarios:
LoadRunner有两种类型的场景:
Manual Scenario: Here, the user should specify the ramp-up, ramp-down, test duration time, Vusers, Vuser scripts, etc that gives the testers control over how they can run the script and at what instance of time. 2. Goal-oriented Scenario: This scenario is created on the basis of the goal provided by us that allows the LoadRunner Controller to do it. Goals can be in terms of throughput, the number of concurrent Vusers, the response time of transactions, hits per second, and pages per minute.
- 手动场景:在这里,用户应指定渐进加载、渐进卸载、测试持续时间、Vuser、Vuser脚本等,这让测试人员可以控制如何运行脚本以及在什么时间点运行。2. 目标导向场景:此场景是基于我们提供的目标创建的,允许LoadRunner控制器来完成。目标可以是吞吐量、并发Vuser数量、事务响应时间、每秒点击数以及每分钟页面数等。
152. What is a scenario? How do you create and run a scenario?
什么是场景?你如何创建和运行场景?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1ba2 | 官方: 否 | 付费: 否
答案:
A scenario is a description of events that is supposed to take place during testing. It regulates and specifies the number of users that need to be emulated, the sequence of actions which has to be performed, and the machines on which virtual users should execute the actions and simulations. To create a scenario:
场景是对测试期间应发生事件的描述。它规定和指定了需要模拟的用户数量、必须执行的行动序列,以及虚拟用户应在哪些机器上执行行动和模拟。要创建场景:
Install the LoadRunner controller on the host. 2. Add a list of hosts where the Vuser scripts have to run and add the list of Vusers that should run the specified scenario. 3. Save.
- 在主机上安装LoadRunner控制器。2. 添加需要运行Vuser脚本的主机列表,并添加应运行指定场景的Vuser列表。3. 保存。
To run a scenario:
要运行场景:
Open existing scenario. 2. Configure the scenario with Vusers and Vuser scripts. 3. Set result directory. 4. Run scenario.
- 打开现有场景。 2. 使用Vusers和Vuser脚本配置场景。 3. 设置结果目录。 4. 运行场景。
153. What is a Correlation? What are the types?
什么是相关性?有哪些类型?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1ba5 | 官方: 否 | 付费: 否
答案:
Correlation deals with managing dynamic values in a test script. The values could change depending on every user action dynamically. Correlation ensures that the dynamic values do not break down during the execution of the script. There are two types of correlation:
相关性涉及管理测试脚本中的动态值。这些值可能根据每个用户操作动态变化。相关性确保动态值在脚本执行过程中不会中断。相关性有两种类型:
Manual Correlation: This deals with manually locating dynamic values, finding unique boundaries of value capture, determining the first occurrence of that value and finally developing the “web_reg_save_param” correlation function before a request has the first occurrence of a dynamic value in response. 2. Automatic Correlation: This works based on the predefined rules of correlation. When a script fails, it would be replayed and inspected for autocorrelation. VuGen helps to identify areas where correlation rules are valid and approval value is correlated. Automated Correlation can be set by going to General Options --> Correlation. Correlation rules can be set by going to Recording Options --> Correlations.
- 手动相关性:这涉及手动定位动态值,找到值捕获的唯一边界,确定该值的第一次出现,最后在请求在响应中第一次出现动态值之前开发“web_reg_save_param”相关性函数。 2. 自动相关性:这基于预定义的相关性规则工作。当脚本失败时,会重放并检查以进行自动关联。VuGen帮助识别相关性规则有效的区域,并且批准的值被关联。自动相关性可以通过转到常规选项 --> 相关性来设置。相关性规则可以通过转到录制选项 --> 相关性来设置。
154. What do you understand by ramp up and ramp down?
你对逐渐增加和逐渐减少有何理解?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1ba8 | 官方: 否 | 付费: 否
答案:
- Ramp up: This refers to increasing (ramping up) load gradually on a server. For example, we can gradually increase the number of Vusers that creates load on the server under test. The initial value for ramp-up would be set by default and we can specify what is the value to wait between intervals. This can be configured by just going to ‘Scenario Scheduling Options’ in LoadRunner.
- Ramp down: This refers to decreasing the load (ramping down) gradually on a server. Gradually decreasing the number of Vusers is an example of a ramp-down. Ramp-down can be correlated to the scenario when an application in real-time sees a drop in concurrent users after the peak time.
Following are the benefits of ramp up and ramp down :
以下是逐渐增加和逐渐减少的好处:
They help to mimic real-time end-user behaviour and pattern that aids in understanding how the application behaviour varies with an increase or decrease in concurrent users at a steady pace. 2. They help to test auto-scaling in a server by verifying if more servers are spinned up with increasing load or not. 3. Server metrics like memory and CPU utilization can be calculated that would closely reflect the real-time behaviour of applications under varying loads.
- 它们有助于模拟实时的最终用户行为和模式,这有助于理解应用程序行为如何随着并发用户以稳定速度的增加或减少而变化。 2. 它们有助于测试服务器中的自动扩展,通过验证是否随着负载增加而启动更多服务器。 3. 可以计算服务器指标,如内存和CPU利用率,这将密切反映应用程序在不同负载下的实时行为。
155. What are the types of Vuser logs?
Vuser日志有哪些类型?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1bab | 官方: 否 | 付费: 否
答案:
Logs are files that are crucial for debugging a script. Logging is mainly used for debugging and is disabled during script execution. However, we can enable logs for errors only after the script has been launched. LoadRunner supports two types of Vuser logs, they are: - Standard Logs
日志是调试脚本至关重要的文件。日志记录主要用于调试,在脚本执行期间被禁用。然而,我们可以在脚本启动后仅为错误启用日志。LoadRunner支持两种类型的Vuser日志,它们是: - 标准日志
Extended Logs
Standard logs create logs of messages and functions sent to the server during the execution of the script whereas extended logs are used for logging additional warnings and other messages required for debugging process.标准日志创建脚本执行期间发送到服务器的消息和函数的日志,而扩展日志用于记录调试过程所需的额外警告和其他消息。
156. How is Vuser different from Vuser Script?
Vuser与Vuser脚本有何不同?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1bae | 官方: 否 | 付费: 否
答案:
In LoadRunner, Vuser is a replacement for human users and is used for imitating the behaviour of real users by executing specified business activities mentioned in the Vuser script of the application under test. These activities are recorded in the recording session. Vuser script is a script generated with the help of the VuGen component that controls the activities of Vusers for accomplishing a specific goal. Every Vuser executes the Vuser script. The performance of the application under test is tracked by functions defined in the Vuser script.
在LoadRunner中,Vuser是人工用户的替代品,用于通过执行被测应用程序的Vuser脚本中指定的特定业务活动来模仿真实用户的行为。这些活动在录制会话中记录。Vuser脚本是使用VuGen组件生成的脚本,控制Vusers的活动以实现特定目标。每个Vuser执行Vuser脚本。被测应用程序的性能通过Vuser脚本中定义的函数来跟踪。
157. What is the importance of vuser-init, action and vuser-end sections?
vuser-init、action和vuser-end部分的重要性是什么?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1bb1 | 官方: 否 | 付费: 否
答案:
- vuser-init: This records the initialization operations called pre-operations before the application is actually executed.
- action: This is used for recording business processes.
- vuser-end: This is used for recording log-off activity to the server.
158. How do you create a Vuser Script?
如何创建Vuser脚本?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1bb4 | 官方: 否 | 付费: 否
答案:
Following are the steps involved in the creation of Vuser Script:
以下是创建Vuser脚本所涉及的步骤:
Create: The first step is the creation of a blank script.
Open VuGen, select File, and then you can either select New Script and Solution or New Solution button.打开VuGen,选择文件,然后您可以选择新建脚本和解决方案或新建解决方案按钮。
A dialog box opens up that indicates to Create a New Script. Here select the protocols that you want to test from the Category list and enter the name for your script in the Script Name field. (It is advised not to name the scripts init, run or end as these are the keywords that are being used internally by the VuGen.)
打开一个对话框,提示创建新脚本。在此处从“类别”列表中选择要测试的协议,并在“脚本名称”字段中输入脚本名称。(建议不要将脚本命名为init、run或end,因为这些是VuGen内部使用的关键字。)
Click on Create to create the blank Vuser script.
点击“创建”以创建空白Vuser脚本。- Record: Once an empty script has been created, we can use the VuGen for recording user-action processes into the script. VuGen provides a floating toolbar that aids in recording control - for example - pause, stop, insert rendezvous points, etc.
- Replay and Debug: Once the recording is done, we have the option to replay the script. This aids in testing the basic functionality of the script and recognizes areas with errors/issues that have to be addressed. For example, the script might need correlation adjustment which is usually found during the replaying of the script. VuGen provides various debug features in the toolbar that helps to identify errors.
- Enhance: Once the replay is complete, you can enhance the script by adding functionalities like transaction points, parameterization, rendezvous points, comments, steps etc.
- View/Analyse: Finally view the summary and analyze the scripting process by going through the “Replay Summary Report”. This report is useful while you are creating the Vuser script.
For a more detailed overview of the steps involved in the scripting process, you can refer [here ]
有关脚本编写过程中涉及的步骤更详细概述,您可以参考[此处]。
159. How to run a test on LoadRunner?
如何在LoadRunner上运行测试?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1bb7 | 官方: 否 | 付费: 否
答案:
Following are the steps to run a test on LoadRunner: - Plan Tests - This step involves developing a well-defined test plan that ensures that the performance objectives are accomplished when running LoadRunner scenarios.
以下是在LoadRunner上运行测试的步骤:- 规划测试 - 此步骤涉及制定定义明确的测试计划,确保在运行LoadRunner场景时实现性能目标。
- Create Vuser scripts - This step deals with the creation of a Vuser script which consists of various tasks that are to be performed by each Vuser during the execution of test scenarios.
- Create Scenario – This step deals with the elaboration of events that takes place during the testing. A scenario consists of machines, Vusers, and scripts that Vusers make use of during the execution. These are created in Controllers. Scenarios can be manual or goal-oriented.
- Run the Scenario – The scenario created in the above step is executed under the influence of individual Vusers or Vuser groups. The Vusers are instructed to perform tasks in the scenario at the same time for emulating the load on the system.
- Monitor the performance – During the execution of scenarios, monitoring of resources used during database transactions and various operations can be done. This helps in identifying the performance bottlenecks under varying load conditions.
- Analyse test results - The result of LoadRunner’s scenario execution are analyzed by going through the graphs and reports generated by the “Analysis” component of LoadRunner.
160. What are the various components of LoadRunner?
LoadRunner的各种组件有哪些?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1bba | 官方: 否 | 付费: 否
答案:
The following are the major components of LoadRunner:
以下是LoadRunner的主要组件:
- VuGen (Virtual User Generator): This component helps to record end-user business processes like payment process on abc.com, checking user profile, etc, and generates the automated testing script called Vuser script. This script can be used in various other Micro Focus applications like Business Process Monitor, LoadRunner Cloud etc.
Controller: This component is an administrative center responsible for the creation, maintenance, execution, and monitoring of various load test scenarios. It helps to control the load simulation by providing options to manage:
How many VUsers are needed for simulating each business process?模拟每个业务流程需要多少个VUser?
What should be the behaviour of Vusers? Should they act simultaneously, concurrently or should the count of Vusers ramp up or ramp down?
Vuser的行为应该是什么?他们是应该同时、并发行动,还是Vuser的数量应该逐步增加或减少?
How should the error reporting be done?
错误报告应如何进行?
How should the transaction reporting take place?
事务报告应如何进行?
When do you want the results - periodically or one time? etc
您希望何时获得结果 - 定期还是一次性?等- Load Generator: As the name indicates, this component is used for generating load (or VUsers) which in turn consumes hardware resources like CPU, memory, etc which can put a limit on the machine simulating the tests. This component is also called an Agent Machine as they generate “agents” for the application under test. As good practice, it is recommended to have controllers and load generators on different machines.
- Analysis: This component is used for visualizing and analyzing the results of load tests. It provides tools to generate graphs and reports for summarising the performance of a system. Once the load testing scenarios are completed, the controller dumps the results in raw form. All the exceptions and errors encountered would be tracked in the Microsoft Access Database (.mdb file) and this file is read by the Analysis component for performing different types of analysis on the results to generate graphs. The resultant graphs help us to identify under what scenarios errors have occurred and various other performance bottlenecks which the developers can then work on fixing them.
161. What are the various types of performance testing supported by LoadRunner?
LoadRunner支持哪些类型的性能测试?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1bbd | 官方: 否 | 付费: 否
答案:
Performance testing is the process of evaluating an application’s performance under varying load and stress conditions. Performance is commonly measured by the time it takes for an application to respond to user actions. LoadRunner supports the following types of performance testing: - Load Testing: This testing helps to determine how well an application performs under heavy load.
性能测试是评估应用程序在不同负载和压力条件下性能的过程。性能通常通过应用程序响应用户操作所需的时间来衡量。LoadRunner支持以下类型的性能测试:- 负载测试:此测试有助于确定应用程序在高负载下的表现如何。
- Stress Testing: This helps to identify how the system responds and behaves during sudden spurts of activities.
- Capacity Testing: This helps to recognize the resources (capacity) needed by the system to ensure that it responds to a user action in an acceptable manner.
162. What is LoadRunner? What are the advantages of LoadRunner?
什么是LoadRunner?LoadRunner有哪些优势?
- 知识点: 测试 (主题: loadrunner, performance-testing;标签: interviewbit, loadrunner, topic-specific, performance-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37b8958d557c902bb1bc1 | 官方: 否 | 付费: 否
答案:
LoadRunner is a licensed performance testing tool provided by Micro Focus. Earlier it was called HP LoadRunner. It is essentially used for testing the behaviour and the performance of an application under various load conditions. The following are the advantages of LoadRunner : - It supports various testing types like - Load testing, Stress testing, and capacity testing of software.
LoadRunner是Micro Focus提供的一款许可性能测试工具。早期称为HP LoadRunner。它主要用于测试应用程序在各种负载条件下的行为和性能。以下是LoadRunner的优势:- 它支持多种测试类型,如 - 软件负载测试、压力测试和容量测试。
- LoadRunner can be used to detect performance bottlenecks in our applications.
- It helps reduce the amount of human intervention and interaction by providing means to automate the testing process.
- It helps to accurately identify and fix various system, code-level, and end-user bottlenecks before deployment and helps to reduce the downtime of that application when it is live.
- By identifying the system’s operating capacity and limits, LoadRunner helps improve system scalability.
163. Explain Test Driver and Test Stub.
解释测试驱动器和测试桩。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4007 | 官方: 否 | 付费: 否
答案:
A test driver and a test stub are both types of test harnesses that simulate an environment for testing a module or component. Both are dummy modules designed specifically for testing. - Test stubs: A test stub is used in a top-down testing approach and allows testing of the upper levels of code when the lower code levels have not been developed yet. It serves as a 'called program' when subprograms are being developed.
测试驱动器和测试桩都是测试工具的类型,它们模拟环境以测试模块或组件。两者都是专为测试设计的虚拟模块。- 测试桩:测试桩用于自顶向下的测试方法,当底层代码尚未开发时,允许测试上层的代码。它作为“被调用程序”,用于子程序开发期间。
- Test drivers: A test driver is used in a bottom-up testing approach and allows testing of the lower levels of the code when the upper code levels have not been developed yet. It serves as a 'called program' when main programs are being developed.
164. What are the advantages and Disadvantages of Manual Testing?
手动测试有哪些优点和缺点?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb400f | 官方: 否 | 付费: 否
答案:
Advantages of Manual Testing - Preferable for products with a short life cycle.
手动测试的优点 - 适用于生命周期较短的产品。
- Saves time, money, and resources.
- Ensure the error-free product.
- Usable for exploratory testing, ad hoc testing, and usability testing.
- No need to change the entire code to make minor changes.
- Get accurate user interface feedback.
- Ability to handle difficult use case situations in a better way.
- GUI testing can be done accurately.
- Highly reliable.
- Make user-friendliness better.
Easy to learn for new testers.
Disadvantages of Manual Testing - Not suitable for time-bounded projects and large organizations手动测试的缺点 - 不适用于时间受限的项目和大型组织。
- More prone to human errors and mistakes
- Less efficient as the choice of recording the testing process is not available
- Less Reliable
- Regression testing is time-consuming
- Does not cover all the aspects of testing
- Load testing and performance testing can be performed manually
- More expensive in the long run process
165. Name some of the manual testing tools.
列出一些手动测试工具。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4016 | 官方: 否 | 付费: 否
答案:
Some of the top manual testing tools include: - Postman
一些顶级手动测试工具包括:- Postman
- Message queue monitors
- DB tools, etc.
166. What types of manual testing are there?
手动测试有哪些类型?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb401e | 官方: 否 | 付费: 否
答案:
In the course of the test life cycle, there are different manual testing types or manual testing techniques that may be used. Following is a list of them:
在测试生命周期过程中,可以使用不同的手动测试类型或手动测试技术。以下是它们的列表:
- Black Box Testing
- White Box Testing
- Unit Testing
- System Testing
- Integration Testing
- Acceptance Testing
167. Who is a manual tester? Write its roles and responsibilities.
谁是手动测试员?写出其角色和职责。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4025 | 官方: 否 | 付费: 否
答案:
The manual tester is a professional who conducts quality checks on software applications without using automation tools or scripting. In essence, the speciality involves manually checking software for errors and fixing them. Manual testers must have the appropriate skills and be able to meet the company's requirements.
手动测试员是专业从事软件应用质量检查的人员,不使用自动化工具或脚本。实质上,这一专业涉及手动检查软件错误并进行修复。手动测试员必须具备适当的技能,并能够满足公司的要求。
Manual Tester Roles and Responsibilities - Analyzing client requirements.
手动测试员的角色和职责 - 分析客户需求。
- Reviewing written code for compliance with project specifications.
- Creating a test environment for executing test cases.
- Establishing quality assurance strategies and organizing phased testing.
- Organizing and conducting review meetings.
- Executing and analyzing test cases.
- Detecting and fixing bugs.
- Monitor system errors and discuss them with colleagues.
- Keeping in touch with the test manager, etc.
- Data Science
- All Events
- My Events
168. Describe the manual testing process.
描述手动测试过程。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb402d | 官方: 否 | 付费: 否
答案:
Among the steps involved in manual testing are:
手动测试涉及的步骤包括:
- Requirement analysis
- Test plan creation
- Design test scenarios and test cases
- Test execution and defect reporting
- Evaluating exit criteria and reporting
- Test closure activities
169. Can you tell me what the different levels of manual testing are?
你能告诉我手动测试的不同级别是什么吗?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4034 | 官方: 否 | 付费: 否
答案:
Different levels of testing can be carried out during the development process. Multilevel testing facilitates the identification of bugs early in the development process. The four levels of testing are as follows:
在开发过程中可以进行不同级别的测试。多级测试有助于在开发过程早期识别错误。四个测试级别如下:
- Unit testing: Essentially, it is a way of testing logically isolated pieces of code within a system called units. Mainly, it focuses on the standalone module's functional accuracy.
- Integration Testing: Software testing at this level involves combining and testing individual units to see if they work together as they should. This test focuses on the interface between modules.
- System Testing: It involves testing all components of the product as a whole to ensure that overall product requirements are met. The types of system testing include regression testing, usability testing, and functional testing.
- User Acceptance Testing: Acceptance testing, also known as UAT (User Acceptance Testing), is the final step in the software testing process. This test determines if the software is ready for release.
170. In order to perform manual testing, what skills are required?
为了进行手动测试,需要哪些技能?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb403a | 官方: 否 | 付费: 否
答案:
The following are the important manual testing skills to acquire: - Detail-oriented and able to report test results in a professional manner.
以下是需要掌握的重要手动测试技能:- 注重细节,能够以专业方式报告测试结果。
- A strong analytical ability.
- Ability to perform technical testing.
- Familiarity with Agile methodologies.
- Plan and track the testing process.
- Knowledge of SDLC, STLC, SQL, and manual concepts.
- An understanding of test management tools, test tracking tools, and testing techniques.
171. What is the difference between developer vs tester?
开发人员与测试人员之间有什么区别?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4041 | 官方: 否 | 付费: 否
答案:
Software developers and testers differ in the following ways:
软件开发人员和测试人员有以下不同之处:
| Developer 开发人员 | Tester 测试人员 |
|---|---|
| Software developers write and maintain source code for computer programming. 软件开发人员编写和维护计算机编程的源代码。 | A software tester is responsible for identifying the quality, correctness, and completeness of software. 软件测试人员负责识别软件的质量、正确性和完整性。 |
| Its responsibility is to create individual software applications. 其职责是创建单独的软件应用程序。 | Its responsibility is to evaluate individual software programs. 其职责是评估单独的软件程序。 |
| Basically, it involves developing software through successive phases in an orderly manner. 基本上,这涉及通过有序的各个阶段来开发软件。 | This test evaluates how well a software application works. 此测试评估软件应用程序的运行效果。 |
| They solve problems quickly, reduce costs, increase flexibility, and improve the quality of business. 他们快速解决问题、降低成本、提高灵活性并改善业务质量。 | By reporting problems as soon as possible, they help save money, provide security, and ensure the quality of the software. 通过尽快报告问题,他们帮助节省资金、提供安全性并确保软件质量。 |
| Additionally, they provide suggestions on how to improve software applications. 此外,他们还提供如何改进软件应用程序的建议。 | Not only do they find bugs, but they also identify their root causes, so bugs can be permanently fixed. 他们不仅发现错误,还识别其根本原因,以便永久修复错误。 |
| Coding skills, time management skills, and programming skills are all essential for developers. 编码技能、时间管理技能和编程技能对开发人员来说都是必不可少的。 | An ideal tester should be well versed in the system being developed, possess good communication skills, be a critical thinker, etc. 理想的测试人员应精通所开发的系统,具备良好的沟通技能,善于批判性思考等。 |
| As part of the software development process, they mostly focus on the requirements of the users. 作为软件开发过程的一部分,他们主要关注用户的需求。 | In testing software applications, they are primarily concerned with the behavior of the end-user. 在测试软件应用程序时,他们主要关注最终用户的行为。 |
172. What is test coverage?
什么是测试覆盖?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4044 | 官方: 否 | 付费: 否
答案:
Test coverage is a metric that indicates how much of the source code is covered by the tests, allowing the tester to verify the quality of their testing. Testers can use it to determine whether they're testing everything they're supposed to. Depending on the way people approach testing, test coverage can mean different things to different people. - Product: It means looking at test coverage to answer the question: Which features or areas of the software do your tests cover?
测试覆盖是一种指标,表示测试覆盖了多少源代码,使测试人员能够验证其测试的质量。测试人员可以用它来确定是否正在测试所有应测的内容。根据人们处理测试的方式不同,测试覆盖对不同的人可能意味着不同的东西。- 产品:这意味着查看测试覆盖以回答以下问题:您的测试覆盖了软件的哪些功能或区域?
- Requirements: The software might work well, but it's not useful to the customer if it doesn't satisfy their needs. Requirements coverage indicates how many of the requirements are tested.
- Source Code: This is usually a developer's domain and is a white-box testing technique. The developer can check how much of their source code is covered by the unit tests.
173. Name some methods that can be used in code coverage.
列举一些可用于代码覆盖的方法。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4047 | 官方: 否 | 付费: 否
答案:
Code coverage is a software testing metric that measures how many blocks, lines, or arcs of code are executed when a test suite runs. Code coverage can be determined by several methods, including: - Statement Coverage.
代码覆盖是一种软件测试指标,用于衡量测试套件运行时执行的代码块、行或弧的数量。代码覆盖可以通过多种方法确定,包括:- 语句覆盖。
- Decision Coverage.
- Branch Coverage.
- Toggle Coverage.
174. Define Latent Defect.
定义潜在缺陷。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb404a | 官方: 否 | 付费: 否
答案:
Latent defect, as the name suggests, is a type of defect or bug which has been in the software system for a long time but is discovered now. A latent defect is an existing defect that can be found effectively with inspections. It usually remains hidden or dormant and is a low-priority defect.
潜在缺陷,顾名思义,是一种已在软件系统中存在很长时间但直到现在才发现的缺陷或错误。潜在缺陷是一种现有缺陷,可以通过检查有效发现。它通常保持隐藏或休眠状态,是一种低优先级缺陷。
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万+职业规划
175. Name some attributes of the test case.
列举一些测试用例的属性。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb404d | 官方: 否 | 付费: 否
答案:
There are various attributes of test cases that make them more reliable, clear, and concise, avoiding any sort of redundancy. Some of them are given below: - Test Case Id: Unique identifier of the test case.
测试用例有多种属性,使其更可靠、清晰和简洁,避免任何形式的冗余。下面是一些属性:- 测试用例ID:测试用例的唯一标识符。
- Test Summary: One-liner summary of the test case.
- Description: Detailed description of the test case.
- Prerequisite or pre-condition: Set of conditions to be followed before implementing the test steps.
- Test Steps: Detailed steps for performing test cases.
- Test Data: Test data value used in the test case.
- Expected Result: Estimated result to pass the test.
- Actual Result: Actual result after executing the test steps.
- Test Result: Status of the test execution (Pass or Fail).
- Automation Status: Identifier for automation.
- Date: Test execution date.
- Executed By: Person name executing the test case.
176. What is Positive and Negative Testing?
什么是正测试和负测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4050 | 官方: 否 | 付费: 否
答案:
- Positive Testing: It is a type of testing process where a software application is validated against the valid data sets as input. It is simply used to check whether the application does what it is supposed to do or not.
- Negative Testing: It is a type of testing process where a software application is validated against invalid data sets as input. It is simply used to check whether the system shows an error when it is supposed to do or not. In test case execution, negative testing is considered a very crucial factor.
Positive vs Negative Testing
正测试与负测试
| Positive Testing 正测试 | Negative Testing 负测试 |
|---|---|
| It tests the application or system by giving valid data. 它通过提供有效数据来测试应用程序或系统。 | It tests the application or system by giving invalid data. 它通过提供无效数据来测试应用程序或系统。 |
| It accepts all the numeric and alphabetic values. 它接受所有数字和字母值。 | It does not accept any special character. 它不接受任何特殊字符。 |
| This type of testing is performed to identify a known set of test conditions. 这种类型的测试用于识别一组已知的测试条件。 | This type of testing is performed to identify an unknown set of test conditions. 这种类型的测试用于识别一组未知的测试条件。 |
| It is usually performed on each and every application. 它通常对每个应用程序都执行。 | It is usually performed where the chances of unexpected conditions or errors are more. 它通常在出现意外条件或错误可能性较大的地方执行。 |
| It requires less time and can be performed by people having less knowledge. 它需要较少时间,可以由知识较少的人员执行。 | It requires more time and can only be performed by professionals. 它需要更多时间,只能由专业人员执行。 |
| It makes sure that the software application is normal. 它确保软件应用程序正常。 | It makes sure that the software applications are 100% detect-free. 它确保软件应用程序100%无缺陷。 |
| It does not encompass all the possible cases. 它不涵盖所有可能的情况。 | It encompasses all the possible cases. 它涵盖所有可能的情况。 |
| It is less significant or vital than negative testing. 它不如负测试重要或关键。 | It is more significant and vital than positive testing. 它比正测试更重要和关键。 |
177. What is UAT (User Acceptance Testing)?
什么是UAT(用户验收测试)?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4053 | 官方: 否 | 付费: 否
答案:
A user acceptance test, also known as an end-user test, is a testing methodology undertaken by the client or end-user to approve the production release. As the last step in the SDLC, it takes place only after testing the software thoroughly. This tool is primarily used to validate end-to-end business processes. It verifies whether or not the developed software is ready to float into the market.
用户验收测试,也称为最终用户测试,是由客户或最终用户执行的一种测试方法,用于批准生产发布。作为SDLC中的最后一步,它仅在软件经过彻底测试后进行。此工具主要用于验证端到端的业务流程。它验证开发的软件是否准备好投放市场。
178. What is Manual Testing?
什么是手动测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4056 | 官方: 否 | 付费: 否
答案:
In manual testing, a tester manually verifies the functionality of the software. The tester has a comprehensive list of all the manual testing test cases they should test, along with the test data. They go through each case, one by one. They launch the software as an end-user would, enter the input, and manually verify the output.
在手动测试中,测试人员手动验证软件的功能。测试人员拥有应测试的所有手动测试用例的全面列表,以及测试数据。他们逐一检查每个用例。他们像最终用户一样启动软件,输入数据,并手动验证输出。
It may seem that manual testing is inefficient when compared to automated testing. It is slow, not repeatable in a consistent manner, and prone to human misjudgment.
与自动化测试相比,手动测试可能看起来效率较低。它速度慢,不能以一致的方式重复,并且容易受到人为误判的影响。
However, manual testing allows the tester to realistically test the software, using actual user data in a natural user environment, subject to similar external conditions. Only a human, not a computer, can evaluate the usability and accessibility of the application and how it looks and feels to the end-user. It also gives a broader perspective of the system. Finally, some test scenarios just can't be automated and need to be manually tested. Thus, it is always recommended that you test the software manually before attempting to automate it.
然而,手动测试允许测试人员在实际的用户环境中使用真实用户数据来实际测试软件,受到类似的外部条件影响。只有人类,而不是计算机,才能评估应用程序的可用性和可访问性,以及它对最终用户的外观和感受。它还提供了对系统的更广泛视角。最后,某些测试场景根本无法自动化,需要手动测试。因此,始终建议在尝试自动化之前先手动测试软件。
179. What is the importance of Localization Testing?
本地化测试的重要性是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4059 | 官方: 否 | 付费: 否
答案:
In localization testing, a software product is tested to ensure whether it offers full functionality and usability within a specific locale. Simply, it verifies the content's accuracy and suitability. In addition to linguistics, it addresses traditions, common herd behaviour, and other similar factors. Generally, it deals with the application's functionality and GUI.
在本地化测试中,测试软件产品以确保其在特定区域环境内提供完整的功能和可用性。简而言之,它验证内容的准确性和适宜性。除了语言学,它还涉及传统、常见群体行为和其他类似因素。通常,它处理应用程序的功能和GUI。
180. What do you mean by Baseline Testing and Benchmark testing?
基线测试和基准测试是什么意思?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4060 | 官方: 否 | 付费: 否
答案:
- Baseline Testing: It is a type of non-functional testing in which a set of tests are run to capture performance information. Using this gathered information, we can make required changes in the application and ultimately improve the performance and capabilities of the application. Generally, it refers to a benchmark that is used as a starting point for new works. This testing uncovers and resolves many errors.
- Benchmark Testing: It is a type of testing that involves both the developers and DBAs (Database Administrators) to determine current performance information. Using this information, one can improve the performance of the same by matching it with the benchmarks (industry standards). Its main objective is to compare the present and future software releases with their specific benchmark.
181. Describe what Fuzz Testing is and how important it is.
描述模糊测试是什么以及它有多重要。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb4069 | 官方: 否 | 付费: 否
答案:
Fuzz testing is a software testing technique that uses a lot of random data, called fuzz, as input to find or detect security loopholes and coding errors in a software application. This is more useful for larger projects, but it only detects serious faults or defects. It is simply used to check the vulnerability of software and gives more effective results when used with beta testing, black box testing, etc.
模糊测试是一种软件测试技术,它使用大量随机数据(称为模糊数据)作为输入,以查找或检测软件应用程序中的安全漏洞和编码错误。这对于大型项目更有用,但它只能检测严重故障或缺陷。它仅用于检查软件的脆弱性,并与beta测试、黑盒测试等结合使用时产生更有效的结果。
182. Explain Configuration Testing.
解释配置测试。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb406c | 官方: 否 | 付费: 否
答案:
Configuration testing is a software testing technique that is used to evaluate the configurational requirements of the software. It discovers the optimal configuration of the system under which the application performs at its best, therefore configuration testing is considered important. It also helps in identifying and resolving any compatibility issues.
配置测试是一种软件测试技术,用于评估软件的配置要求。它发现系统的最佳配置,在此配置下应用程序性能最好,因此配置测试被认为是重要的。它还有助于识别和解决任何兼容性问题。
183. Name two parameters that can be useful to check the quality of test execution.
命名两个可用于检查测试执行质量的参数。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc258d557c902bb43bc | 官方: 否 | 付费: 否
答案:
Two parameters required to check the quality of test execution include: - Defect leakage ratio: It represents the ratio of total potential rejections to the total overall production.
检查测试执行质量所需的两个参数包括:- 缺陷泄漏率:它表示总潜在拒绝与总生产量的比率。
- Defect reject ratio: It represents the ratio of total rejections to the total overall production.
184. Explain use-case testing.
解释用例测试。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc558d557c902bb440c | 官方: 否 | 付费: 否
答案:
Use-case testing is basically a technique for developers and testers to identify test cases that exercise the entire system right from the very beginning to the very end of each transaction. Generally, it is part of black-box testing, which is used to develop tests or systems that achieve acceptable performance levels.
用例测试基本上是一种供开发人员和测试人员识别测试用例的技术,这些测试用例从每笔交易的最开始到最结束都贯穿整个系统。通常,它是黑盒测试的一部分,用于开发能达到可接受性能水平的测试或系统。
185. Explain Path testing.
解释路径测试。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc558d557c902bb4436 | 官方: 否 | 付费: 否
答案:
A path test is a type of test designed specifically for designing test cases. It involves the use of a control flow chart designed specifically to identify a set of linearly independent paths of execution leading to the completion of a program. The main objective of this process is to ensure that all paths are covered and executed well. In addition, it reduces or minimizes the likelihood of redundant tests occurring.
路径测试是一种专门用于设计测试用例的测试类型。它涉及使用专门设计的控制流图,以识别一组线性独立的执行路径,从而完成程序。这个过程的主要目标是确保所有路径都被覆盖并执行良好。此外,它减少或最小化了冗余测试发生的可能性。
186. Explain Endurance Testing or Soak Testing?
解释耐久性测试或浸泡测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37bc558d557c902bb4444 | 官方: 否 | 付费: 否
答案:
Endurance testing, also known as Soak testing, is a type of performance testing usually performed to check the performance of the system that is under constant use. Its main purpose is to determine whether a system can sustain a continuous high load or not. Memory utilization is also monitored to identify potential leaks during this testing. Some of the endurance testing tools include: - WebLOAD
耐久性测试,也称为浸泡测试,是一种性能测试类型,通常用于检查系统在持续使用下的性能。其主要目的是确定系统是否能承受持续的高负载。在此测试期间,还会监控内存利用率以识别潜在的泄漏。一些耐久性测试工具包括:- WebLOAD
- LoadUI
- OpenSTA
- LoadComplete
- Apache JMeter, etc.
187. How is performance testing different from functional testing?
性能测试与功能测试有何不同?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37c1558d557c902bb71f8 | 官方: 否 | 付费: 否
答案:
| Performance Testing 性能测试 | Functional Testing 功能测试 |
|---|---|
| Helps to validate the system behaviour at different load conditions. 帮助验证系统在不同负载条件下的行为。 | Helps to verify the software accuracy with known inputs and expected output. 帮助使用已知输入和预期输出验证软件的准确性。 |
| This testing is preferred to be done in an automated way. 此测试优选以自动化方式进行。 | This testing can be done both manually and automatically. 此测试可以手动和自动完成。 |
| Several users can perform desired operations. 多个用户可以执行所需操作。 | Here, only one user performs the operations. 此处,只有一个用户执行操作。 |
| Clients, Testers, developers, DBA and Network teams are involved here. 此处涉及客户、测试人员、开发人员、DBA和网络团队。 | Customer, Tester and Development teams are involved here. 此处涉及客户、测试人员和开发团队。 |
| This requires a test environment that is close to the production environment to get the best results. 这需要接近生产环境的测试环境以获得最佳结果。 | Here, we do not require a close to the production environment for testing. 此处,我们不需要接近生产环境进行测试。 |
| Non-functional requirements are tested here. 此处测试非功能需求。 | Functional requirements and business logic is tested here. 此处测试功能需求和业务逻辑。 |
188. What do you understand by Performance Testing?
你如何理解性能测试?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb71fb | 官方: 否 | 付费: 否
答案:
Performance Testing is a category of software testing that ensures the application performs well under any workload. This type of testing is not done to identify bugs in the application. Its main intention is to eliminate performance issues and bottlenecks by measuring the performance quality attributes of the system.
性能测试是软件测试的一个类别,确保应用程序在任何工作负载下都能表现良好。这种类型的测试不是为了识别应用程序中的缺陷。其主要意图是通过衡量系统的性能质量属性来消除性能问题和瓶颈。
The following image represents the performance attributes of any system:
下图表示任何系统的性能属性:
- Speed – This determines how fast an application responds to any request.
- Scalability – This determines what is the maximum user load an application can handle.
- Stability – This determines if an application is stable under differing loads.
- Reliability - This determines if an application is consistent under different environmental conditions at a specific period.
189. Why is JMeter used for?
为什么使用JMeter?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb71fe | 官方: 否 | 付费: 否
答案:
JMeter is a Java-based tool for performing load testing. It helps in analyzing and measuring the performance of web services with the use of plugins. The latest JMeter version is 5.4.2 which requires a Java 8+ version to run.
JMeter是一种基于Java的工具,用于执行负载测试。它借助插件帮助分析和衡量Web服务的性能。最新的JMeter版本是5.4.2,需要Java 8+版本才能运行。
190. What do you know about Scalability testing?
你对可扩展性测试了解多少?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb7201 | 官方: 否 | 付费: 否
答案:
Scalability testing is a type of performance testing that analyzes how well the software is capable of handling complex operational capacity from a simple capacity. Some software takes time to adapt to complex capacities. This testing ensures that the application can scale quickly without any glitches or drawbacks.
可扩展性测试是一种性能测试类型,分析软件从简单容量处理复杂运营能力的程度。一些软件需要时间适应复杂容量。此测试确保应用程序可以快速扩展,而没有任何故障或缺点。
191. What kind of testing deals with subjecting the application to a huge amount of data?
哪种测试涉及将应用程序置于大量数据下?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb7204 | 官方: 否 | 付费: 否
答案:
This kind of testing is known as volume testing. It deals with subjecting the application to a huge amount of data to determine how much data the application can handle when there are a good load of users accessing the application concurrently. It verifies the performance of a system to test whether it can handle a stipulated volume of data by entering huge data volume to the application either incrementally or steadily.
这种测试称为容量测试。它涉及将应用程序置于大量数据下,以确定当大量用户同时访问应用程序时,应用程序能处理多少数据。它通过向应用程序增量或稳定地输入大量数据,验证系统能否处理规定数据量的性能。
192. What is load tuning?
什么是负载调优?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb7207 | 官方: 否 | 付费: 否
答案:
Load tuning is a process of performance improvement technique by conducting necessary modifications to the software configurations depending on the results of load testing.
负载调优是一种性能改进技术的过程,通过根据负载测试结果对软件配置进行必要修改来实现。
193. What do you mean by profiling in performance testing?
在性能测试中,性能剖析是什么意思?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb720a | 官方: 否 | 付费: 否
答案:
Profiling is the process of fine-tuning the performance testing process by helping to identify the system components responsible for most of the issues related to its performance.
性能剖析是通过帮助识别导致性能相关问题的主要系统组件来微调性能测试过程的过程。
194. What is the metric that determines the data quantity sent to the client by the server at a specified time? How is it useful?
决定服务器在指定时间内发送给客户端的数据量的度量指标是什么?它有什么用?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb720d | 官方: 否 | 付费: 否
答案:
Throughput is the metric that determines the data quantity sent to the client in response to its request by the server. It is calculated in terms of requests per second, hits per second, calls per day, etc. In most cases, it is calculated in bits per second. The value of throughput tells the slowness or fastness of the network and its bandwidth capabilities. The higher the throughput, the higher is the network capability.
吞吐量是决定服务器响应客户端请求而发送的数据量的度量指标。它以每秒请求数、每秒点击数、每天调用次数等来计算。在大多数情况下,它以每秒比特数计算。吞吐量的值反映了网络的快慢及其带宽能力。吞吐量越高,网络能力越强。
195. What do you understand by distributed testing?
你如何理解分布式测试?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: system-design
- 分类: fullstack
- id: 69b37c1558d557c902bb7210 | 官方: 否 | 付费: 否
答案:
Distributed testing is the process of testing applications when lots of users are gaining access to the application from different devices simultaneously. This helps to perform stress testing.
分布式测试是在大量用户同时从不同设备访问应用程序时对应用程序进行测试的过程。这有助于执行压力测试。
A brief overview of the distributed testing is represented in the image below:
分布式测试的简要概述如下图所示:
196. What are the steps involved in conducting performance testing?
进行性能测试涉及哪些步骤?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb7213 | 官方: 否 | 付费: 否
答案:
Following are the steps involved in the Performance Testing Lifecycle :
性能测试生命周期涉及以下步骤:
- Requirement Analysis: The first step is to determine all the requirements needed for testing after consulting with the clients and developers. This helps in determining the scope and objectives of testing and helps testers to plan out testing accordingly.
- Architecture Review: Once all the requirements are gathered and testing is planned, we perform an architectural review of the system under test.
Test Strategy: Once the review is done, carefully layout the strategies required for performance testing that considers the following criteria -
Response time of the application应用程序的响应时间
Application bottlenecks involving both software and hardware
涉及软件和硬件的应用程序瓶颈
Optimal configuration of the system
系统的最佳配置
System capacity and scalability
系统容量和可扩展性
Resource utilization percentage
资源利用率百分比
Volume of data and workload capability of the application
应用程序的数据量和工作负载能力- Test Design: Once the strategy is ready, the testers have to come up with automation scripts or prepare the testing environment using the tools by following all the best practices and coding standards. The testers have to come up with various test scenarios covering both positive and negative cases.
- Test Execution: The scripts prepared in the previous step would be simulated and executed.
- Results Analysis: The result of test execution will be analyzed and documented for recording purposes. These metrics will be observed and tracked for any defects.
- Reports and Recommendations: The documented results will be presented to the developers along with the recommended resolutions.
197. How is performance testing different from performance engineering?
性能测试与性能工程有何不同?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb7216 | 官方: 否 | 付费: 否
答案:
Both of these terms are closely related yet distinct. Performance testing is a subset of performance engineering that primarily deals with gauging the performance of the application under varying loads.
这两个术语紧密相关但又有区别。性能测试是性能工程的一个子集,主要涉及在不同负载下衡量应用程序的性能。
The difference between these two are as follows:
这两者之间的区别如下:
| Performance Testing 性能测试 | Performance Engineering 性能工程 |
|---|---|
| This deals with designing test cases and executing them for determining the performance of an application. 这涉及设计测试用例并执行它们以确定应用程序的性能。 | This deals with engineers taking an active part in the SDLC cycle to develop high-performance websites. 这涉及工程师积极参与SDLC周期以开发高性能网站。 |
| It helps in uncovering bugs and performance bottlenecks by providing analysis reports to the developers to resolve them. 它通过向开发人员提供分析报告来帮助发现错误和性能瓶颈并予以解决。 | This helps developers meet the business requirements and meet the industry standards for reliability, scalability and speed right from the beginning of the application development process. 这帮助开发人员从应用程序开发过程一开始就满足业务需求并达到可靠性、可扩展性和速度的行业标准。 |
| This makes use of a variety of tools that is only concerned if a website sustains with a given load. 它使用各种工具,仅关注网站是否能在给定负载下维持运行。 | Performance engineering is more of a culture that emphasizes more on using best practices for ensuring that the high-performing applications are developed. 性能工程更像是一种文化,强调使用最佳实践来确保开发出高性能应用程序。 |
| This can be performed using cloud-based tools without requiring the background of programming skills. 这可以使用基于云的工具执行,无需编程技能背景。 | To follow best coding practices to deliver high performing apps, it is very much essential to have good programming knowledge. 为了遵循最佳编码实践以交付高性能应用程序,具备良好的编程知识非常必要。 |
198. What do you understand by performance tuning?
你如何理解性能调优?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb7219 | 官方: 否 | 付费: 否
答案:
Performance Tuning is the process of identifying performance bottlenecks and taking steps to eliminate them. There are two types of tuning, they are: - Hardware tuning: This type of tuning helps in improving the system performance by either replacing, adding or optimizing the hardware (Processor, CPU, RAM etc) of a system to eliminate the bottlenecks caused due to hardware.
性能调优是识别性能瓶颈并采取措施消除它们的过程。有两种类型的调优,它们是:- 硬件调优:这种类型的调优通过替换、添加或优化系统的硬件(处理器、CPU、RAM等)来消除因硬件引起的瓶颈,从而改善系统性能。
- Software tuning: This helps identify software bottlenecks by performing code and database profiling. Here, the software code will be modified for resolving the bottlenecks.
199. What are some of the common problems that occur due to poor performance?
由于性能不佳而产生的一些常见问题是什么?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb721c | 官方: 否 | 付费: 否
答案:
Following are some of the issues caused due to poor performance: - Bottlenecking – These are obstructions that contribute to system degradation in terms of performance. They occur when there are coding errors or hardware issues that reduces the throughput of the application under certain workloads.
以下是由于性能不佳导致的一些问题:- 瓶颈化 – 这些是导致系统性能下降的阻碍因素。当存在编码错误或硬件问题,在某些工作负载下降低了应用程序的吞吐量时,就会出现这些问题。
- Poor response time – Response time refers to the time taken by the application to respond to any request. For the best user experience, the response times should be very fast. Poor performance of the application leads to slower response times. If response times are slow, then the user loses interest in our application and might turn towards the competitor’s application.
- Long Load time – Load time refers to the initial time taken by an application to start. This time should be as minimum as possible. Low performance leads to increased load time.
- Poor scalability – This impacts software from handling expected user load which makes the application unavailable to some set of users.
200. What is the need for conducting performance tests?
进行性能测试的需求是什么?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb721f | 官方: 否 | 付费: 否
答案:
Performance testing is conducted for providing information to the stakeholders about the speed, capability, reliability and scalability of the application. These help in identifying what needs to be done for improving the application before it goes to the end-users in the market. - If the application was released to the market without conducting performance testing, then the issues such as slowness in software, application inconsistencies, application crash under the influence of heavy workloads would not be detected.
性能测试是为了向利益相关者提供关于应用程序速度、能力、可靠性和可扩展性的信息。这有助于在应用程序进入市场面向最终用户之前,确定需要采取哪些措施来改进它。- 如果应用程序在未进行性能测试的情况下发布到市场,那么软件运行缓慢、应用程序不一致以及在高负载下崩溃等问题将无法被检测到。
- Performance testing helps to determine if the application meets the performance requirements under varying workloads. If an application with poor performance attributes is launched to the market, then it can lead to a bad reputation and loss in sales.
- Whenever we are dealing with mission-critical applications or life-saving systems, then it is very much necessary to conduct performance testing so that the application behaves consistently for a long period.
Just a 5-minute downtime of Google.com in the year 2013 resulted in losses of $545,000. According to LovetheSales.com, a downtime of YouTube for 37 minutes cost Google around $1.7m in losses in ad revenues in the year 2020. According to Gremlin, Amazon.com loses $13,219,128 per hour due to downtimes. We can see the revenue impact of software downtimes on the companies.
Hence, performance testing is very much crucial before any application is launched to the market.因此,任何应用程序在推向市场之前进行性能测试非常关键。
201. What are some of the common performance bottlenecks and how do they impact your application?
一些常见的性能瓶颈是什么,它们如何影响你的应用程序?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb7222 | 官方: 否 | 付费: 否
答案:
Bottlenecks are system obstructions that contribute to degradation in the system’s performance. They are caused either by hardware issues or coding errors that lead to a reduction of throughput under varying loads. Some of the common bottlenecks in performance are: - Processor bottlenecks: These occur when the processor is overloaded and cannot perform its tasks and respond to requests on time. These can be in 2 forms:
瓶颈是导致系统性能下降的阻碍因素。它们由硬件问题或编码错误引起,导致在不同负载下吞吐量减少。性能中一些常见的瓶颈是:- 处理器瓶颈:当处理器过载而无法执行任务并及时响应请求时,就会发生这些瓶颈。它们可以有两种形式:
CPU running at above 80% capacity for a prolonged period. A long queue of requests for the processor.Both of these forms occur when the system has insufficient memory and has continuous interruption from the I/O devices. They can be resolved by adding more RAM, increasing CPU power and improving algorithmic efficiency. - Memory Utilization: This bottleneck occurs when the system does not have fast RAM or does not have sufficient memory. This impacts the speed of serving information to the CPU thereby slowing down the application. Whenever the device does not have enough RAM, the storage will be offloaded to SSD or HDD. These issues can be resolved by increasing the memory capacity or increasing RAM. If the RAM is very slow, then it can be replaced. Sometimes the problem can arise due to memory leak issues wherein a program does not release memory so that the system can use it. Correcting the application program to free memory also can fix the issue.
CPU在长时间内运行在80%以上容量。处理器请求队列过长。这两种形式都发生在系统内存不足且持续受到I/O设备中断的情况下。可以通过添加更多RAM、增加CPU功率和提高算法效率来解决。- 内存利用率:当系统没有快速RAM或没有足够内存时,会出现这种瓶颈。这会影响向CPU提供信息的速度,从而减慢应用程序。每当设备没有足够RAM时,存储将被卸载到SSD或HDD。这些问题可以通过增加内存容量或增加RAM来解决。如果RAM非常慢,则可以更换它。有时问题可能源于内存泄漏,即程序未释放内存以便系统使用。修正应用程序以释放内存也可以解决这个问题。
- Network bottlenecks: These occur when two or more devices lack the necessary bandwidth to communicate with each other. Whenever there is an overburdened server or overloaded network that causes the network to lose its integrity. These issues can be resolved by upgrading servers, network hardware like hubs, routers, access points etc.
- Software bottlenecks: These bottlenecks are due to the software where programs are built for handling finite tasks so that it doesn’t utilize additional RAM or CPU. This makes the program use only a single core or processor despite the availability of resources. These can be resolved by making the software program more efficient so that it can use available resources efficiently.
Disk Usage: The slowest component in a server is long-term storage units like SSDs or HDDs that are unavoidable. The fastest long-term storage units have physical limits which makes it difficult for the programmers to troubleshoot such issues. These can be fixed by increasing RAM caching rates, reducing fragmentation issues or by addressing insufficient bandwidth by switching to faster storage units.
The key to fixing all the bottlenecks are by pinpointing the root cause of the system degradation and then by fixing the code or by adding additional hardware resources depending on the causes.修复所有瓶颈的关键是确定系统降级的根本原因,然后根据原因修复代码或增加额外硬件资源。
202. What are some of the commonly available tools for performance testing?
性能测试中常用的工具有哪些?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb7225 | 官方: 否 | 付费: 否
答案:
There are so many tools available for accomplishing performance testing, GUI testing, test management, load testing, functional testing etc. Among various tools, the following are the most commonly used tools for performance testing: - QALoad: This tool is used to perform load tests of web applications, databases and char-based management systems.
有众多工具可用于完成性能测试、GUI测试、测试管理、负载测试、功能测试等。在各种工具中,以下是最常用的性能测试工具:- QALoad:该工具用于对Web应用程序、数据库和基于字符的管理系统执行负载测试。
- LoadRunner: This tool is used to test web applications by using a wide range of platforms and environments. This is used for getting the performance metrics of every component to identify the bottlenecks.
- WebLOAD (Radview): This is another tool for running performance and load tests and also comparing the test metrics.
- Silk performer: This tool is used for predicting behaviour in terms of complexity and size of e-business before deploying the application.
- Rational performance tester (IBM): This tool was developed by IBM and is used to perform automated performance testing of the server and web-based applications.
- JMeter: JMeter is a Java-based open source performance testing tool that can be used to test both static and dynamic web applications and resources. It is used for simulating heavy server load for testing the strength and analyzing overall performance under varying load.
- Flood.io: This is another load testing tool that is used for executing globally distributed tests on performance from different tools like Selenium, JMeter etc.
203. What are the types of Performance Testing?
性能测试的类型有哪些?
- 知识点: 测试 (主题: performance-testing;标签: interviewbit, performance-testing, topic-specific)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1558d557c902bb7228 | 官方: 否 | 付费: 否
答案:
The different types of performance testing are: - Load testing – This type of testing checks the ability of an application to perform under known loads. The main goal here is to identify any performance bottlenecks before the application goes into production.
性能测试的不同类型包括:- 负载测试 – 这种测试类型检查应用程序在已知负载下执行的能力。这里的主要目标是在应用程序投入生产之前识别任何性能瓶颈。
- Stress testing – This type of testing involves testing the application’s behaviour under extreme stress or workloads for identifying the breaking point of an application.
- Endurance testing – This testing is done to ensure that the software can handle the expected load for a continuous period.
- Spike testing – This testing is done to ensure that the system works well under the sudden influence of large load spikes.
Volume testing – This testing ensures that the system behaves well under the influence of a large volume of data.
The following image represents the summary of types of performance testing:下图展示了性能测试类型的概要:
204. How do you access history of requests in Postman?
如何在Postman中访问请求历史?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb758f | 官方: 否 | 付费: 否
答案:
The request history can be accessed in the History tab provided on the Postman application. If we sign into the Postman account, then the history will be synced across the devices where you are logged in. - When you click on any of the requests present in the History tab, the view opens the request that we have saved while we were working on it earlier.
请求历史可以通过Postman应用程序中提供的History选项卡进行访问。如果我们登录Postman账户,那么历史记录将在您登录的各个设备之间同步。- 当您点击History选项卡中的任何请求时,视图会打开我们之前工作时保存的该请求。
- History also consists of the collection runs that were executed as summarized versions. They are not logged in History as single requests.
- Click on “View More option (…)” on the request, we will see options to save, document, monitor, delete or mock the request.
Multiple requests can be selected by using Command or Control button and then clicking on the request.
The following image shows the page that shows when you click on View More Option upon a request present in the History tab:下图显示了当您在History选项卡中的某个请求上点击View More Option时显示的页面:
Image Source: Postman Learning Documentation
图片来源:Postman学习文档
205. What is digest auth in Postman?
Postman中的摘要认证是什么?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb7592 | 官方: 否 | 付费: 否
答案:
Digest Authorization is one of the authorization techniques provided by Postman. In this technique, the client first sends the request to the API and get responses from the server including a number which is usable only once, a realm value and 401 unauthorized response. We will be then sent back an encrypted data array having both username and password along with the data received from the server earlier. The server uses this data to generate an encrypted data string and compares this with what was sent for authenticating the request.
摘要授权是Postman提供的授权技术之一。在这种技术中,客户端首先向API发送请求,并从服务器获得响应,包括一个仅能使用一次的数字、一个领域值和401未授权响应。然后我们会收到一个加密数据数组,包含用户名和密码,以及之前从服务器收到的数据。服务器使用这些数据生成一个加密数据字符串,并与发送的内容进行比较以验证请求。
We can do this by selecting the Authorization tab, then selecting “Digest Auth” from the drop-down list. Postman window presents the fields for both stages of the authentication request. The fields required for the second stage of the request are auto-filled based on the data received from the server. For more information, you can refer here .
我们可以通过选择Authorization选项卡,然后从下拉列表中选择“Digest Auth”来实现。Postman窗口会呈现认证请求两个阶段的字段。请求第二阶段所需的字段会根据从服务器收到的数据自动填充。更多信息,您可以在此处参考。
206. What is a collection in Postman?
Postman中的集合是什么?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb7595 | 官方: 否 | 付费: 否
答案:
A collection in Postman helps to group similar requests. It helps in systematically arranging the requests into folders.
Postman中的集合有助于对相似的请求进行分组。它有助于将请求系统化地组织到文件夹中。
207. Why do we use Postman?
为什么使用Postman?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb7598 | 官方: 否 | 付费: 否
答案:
We use Postman for the below reasons: - Firstly, Postman is free software that is useful for API testing.
我们使用Postman的原因如下:- 首先,Postman是免费的软件,可用于API测试。
- It can send HTTP requests of various types (such as GET, POST, PUT, PATCH, etc) and gives the ability to save environments for future use.
- It helps in managing the end-to-end lifecycle of the API - starting from design to mocking to testing and finally maintaining the APIs.
- It provides Runtime Service that helps in managing API collections, environments, work-spaces, and different examples.
- It can be used to easily integrate with CI/CD tools such as Jenkins.
- Has extensive support from the community and provides extensive documentation.
208. How will you log variable values in Postman?
在Postman中如何记录变量值?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb759b | 官方: 否 | 付费: 否
答案:
We can log the variable values in Postman in the console by using the command: console.log(pm.variables.get("variable_name"));
我们可以使用命令在Postman的控制台中记录变量值:console.log(pm.variables.get("variable_name"));
209. How do you access postman variables?
如何访问postman变量?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb759e | 官方: 否 | 付费: 否
答案:
It can be accessed by using the variable name as: {{variable_name}}
可以通过使用变量名来访问,格式为:{{variable_name}}
210. What are the various authorization methods provided by Postman?
Postman提供了哪些授权方法?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75a4 | 官方: 否 | 付费: 否
答案:
Postman provides the below API request Authorization Options: - API Key
Postman提供了以下API请求授权选项:- API密钥
- Bearer Token
- Basic auth
- Digest auth
- Oauth 1.0
- Oauth 2.0
- Hawk Authentication
- AWS Signature
- NTLM Authentication
211. What are the different types of API requests supported in Postman?
Postman支持哪些类型的API请求?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75ac | 官方: 否 | 付费: 否
答案:
Postman supports the following type of requests: - GET
Postman支持以下类型的请求:- GET
- POST
- PUT
- PATCH
- DELETE
- COPY
- HEAD
- OPTIONS
- LINK
- UNLINK
- PURGE
- LOCK
- UNLOCK
- PROPFIND
- VIEW
212. How are Query Params different from Path Variables?
查询参数与路径变量有何不同?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75af | 官方: 否 | 付费: 否
答案:
Path Variables are used for identifying specific resources and Query Parameters are used for sorting or filtering the resources.
路径变量用于标识特定资源,而查询参数用于排序或过滤资源。
213. What is Basic Auth in Postman?
什么是Postman中的基本认证?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75b2 | 官方: 否 | 付费: 否
答案:
Basic Auth in Postman is a type of authorization technique provided in Postman for HTTP user agents like web browsers. It provides fields to enter username and password which when entered gets associated with the request.
Postman中的基本认证是Postman为HTTP用户代理(如Web浏览器)提供的一种授权技术。它提供了输入用户名和密码的字段,输入后会与请求关联。
214. What is Postman?
什么是Postman?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75b5 | 官方: 否 | 付费: 否
答案:
Postman is a free, HTTP Client based software application primarily used to perform API testing. It supports testing of HTTP requests by utilizing GUI (Graphical User Interface) which can be executed and the responses can be validated. It also helps in collaborating among the team members for the development of API by providing a platform to design, develop, test, and document APIs.
Postman是一款免费的基于HTTP客户端的软件应用程序,主要用于执行API测试。它通过利用GUI(图形用户界面)支持HTTP请求的测试,可以执行请求并验证响应。它还通过提供设计、开发、测试和记录API的平台,帮助团队成员在API开发中进行协作。
215. What encoding is accepted by Postman in authorization credentials?
Postman在授权凭证中接受什么编码?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75b8 | 官方: 否 | 付费: 否
答案:
Postman accepts authorization credentials in Base64 encoding format only. It is provided in Postman by default. If we do not want to use an inbuilt encoding system, we can refer to third-party websites for converting the credentials in base64 format.
Postman仅接受Base64编码格式的授权凭证。这是Postman默认提供的。如果我们不想使用内置的编码系统,可以参考第三方网站将凭证转换为base64格式。
216. Can we have the same names for global variables in postman?
在Postman中,全局变量可以使用相同的名称吗?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75bb | 官方: 否 | 付费: 否
答案:
The scope of global variables is limited to the workspace and is global. Due to this, variables having global scope cannot have the same names. We can have the same names for local variables but they need to be part of different variables.
全局变量的作用域仅限于工作区,并且是全局的。因此,具有全局作用域的变量不能有相同的名称。局部变量可以有相同的名称,但它们需要属于不同的变量。
217. What do you know about postman monitor?
你对Postman监控了解多少?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75be | 官方: 否 | 付费: 否
答案:
Monitoring is a method of staying in sync with the health and performance of the APIs. Postman provides inbuilt monitoring services that help us be in sync with the API development and performance. The monitors provided by Postman are mainly based on the working of collection runners. They run every request in the collection and analyze the values mentioned in the test scripts. Monitors use the test scripts for validating and monitoring the responses. The reports generated are shared with the developers over emails or alerts in slack, hipchat, etc based on our configuration settings.
监控是一种保持与API健康状态和性能同步的方法。Postman提供了内置的监控服务,帮助我们与API开发和性能保持同步。Postman提供的监控主要基于集合运行器的工作方式。它们运行集合中的每个请求,并分析测试脚本中提到的值。监控使用测试脚本来验证和监控响应。生成的报告会根据我们的配置设置,通过电子邮件或Slack、HipChat等中的警报与开发者共享。
218. What is a binary form in POST methods?
POST方法中的二进制形式是什么?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75c1 | 官方: 否 | 付费: 否
答案:
The binary form is designed to help send data in a format that is not possible to be entered manually. These options are used while sending large files like images, CSV files, etc in the POST request. Binary representation is the easiest representation for sending complex data with the request.
二进制形式旨在帮助发送无法手动输入的数据格式。这些选项在发送大型文件(如图像、CSV文件等)的POST请求时使用。二进制表示是发送复杂数据的最简单方式。
219. What are the limitations of Postman?
Postman有哪些限制?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75c4 | 官方: 否 | 付费: 否
答案:
- Postman is not suitable for processing 1000+ API requests.
- If the project is very large, managing the collections and requests become cumbersome.
- It is not suitable if we want to manage the workspace in the form of code as there would be a lot of code duplication for dynamic API requests.
220. How can you save the responses of API to a file in Postman?
如何将API的响应保存到Postman中的文件?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75c7 | 官方: 否 | 付费: 否
答案:
We can do this in two ways:
我们可以通过两种方式实现:
Click on the Download button in the response section. 2. Click on the arrow beside send button - There will be an option to send and download. Clicking on it will prompt Postman to ask the location of saving the response post successful execution of the request.
- 点击响应部分的下载按钮。 2. 点击发送按钮旁边的箭头 - 会有一个“发送并下载”的选项。点击它后,Postman会提示在请求成功执行后选择保存响应的位置。
221. What is the significance of 301 status code?
301状态码的意义是什么?
- 知识点: 测试 (主题: postman, api-testing;标签: interviewbit, postman, topic-specific, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c1a58d557c902bb75ca | 官方: 否 | 付费: 否
答案:
301 status code represents permanent redirect from one website page to another. It tells the search engine that the old page is outdated and the engine has to index the new page URL.
301状态码表示从一个网页永久重定向到另一个网页。它告诉搜索引擎旧页面已过时,搜索引擎必须索引新页面的URL。
222. What is the lifecycle of a Quality Assurance Process?
质量保证流程的生命周期是什么?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2958d557c902bb7f6c | 官方: 否 | 付费: 否
答案:
Every process in Quality Assurance involves the PDCA ( Plan Do Check Act) cycle, often known as the Deming cycle . The following are the phases of this cycle:
质量保证中的每个流程都涉及PDCA(计划-执行-检查-行动)循环,通常称为戴明循环。以下是该循环的各个阶段:
- Plan: The organisation should plan and develop process-related objectives, as well as the methods necessary to provide a high-quality final product. Here, Quality Assurance ensures that the planning made takes into consideration the quality of the product.
- Do: This phase involves process development and testing, as well as "doing" changes to processes. Here, Quality Assurance ensures that the processes followed during development maintain the quality of the product.
- Check: In this phase, processes are monitored, modified, and checked to see if they achieve the intended goals. Here, Quality Assurance ensures that the processes are checked thoroughly so that no defects might be missed.
- Act: In this phase, a Quality Assurance tester should take the steps that are required to improve the processes.
These stages are done to guarantee that the organization's procedures are assessed and improved on a regular basis.
这些阶段是为了确保组织的流程定期进行评估和改进。
223. Differentiate between Quality Assurance and Testing.
区分质量保证和测试。
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2958d557c902bb7f9f | 官方: 否 | 付费: 否
答案:
Software Testing: Software testing is a method of investigating a system to see how it works according to product requirements and customer expectations and identify potential flaws. To test the product, find bugs, and see if they've been fixed, a variety of methods are utilised. Customers can use testing to check if the generated product satisfies their expectations in terms of design, compatibility, and functionality, among other things.
软件测试:软件测试是一种调查系统的方法,以了解其如何根据产品需求和客户期望工作,并识别潜在缺陷。为了测试产品、发现错误并查看它们是否已修复,会使用多种方法。客户可以通过测试来检查生成的产品在设计、兼容性和功能等方面是否满足其期望。
Validating the product against specifications and client requirements, as well as detecting and reporting flaws, are all part of the testing process. To detect software flaws, it uses a variety of testing methodologies such as functional, non-functional, and acceptability testing. Furthermore, before the product is released to the client, the purpose of software testing is to ensure that any found faults are entirely corrected with no side effects.
根据规范和客户需求验证产品,以及检测和报告缺陷,都是测试过程的一部分。为了检测软件缺陷,它使用多种测试方法,如功能测试、非功能测试和可接受性测试。此外,在产品交付给客户之前,软件测试的目的是确保任何发现的缺陷都被完全修复且无副作用。
The following table lists the differences between Quality Assurance and Testing:
下表列出了质量保证与测试之间的区别:
| Quality Assurance 质量保证 | Testing 测试 |
|---|---|
| It is a subset of the Software Development Lifecycle (SDLC). 它是软件开发生命周期(SDLC)的子集。 | It is a subset of Quality Control (QC). 它是质量控制(QC)的子集。 |
| It is process-oriented. 它以过程为导向。 | It is product-oriented. 它以产品为导向。 |
| It is preventive in nature (tries to prevent defects from being present in the product). 它在性质上是预防性的(试图防止缺陷存在于产品中)。 | It is corrective in nature (tries to correct defects present in the product). 它在性质上是纠正性的(试图纠正产品中存在的缺陷)。 |
| Quality Assurance is done to prevent defects in the product. 质量保证旨在防止产品中的缺陷。 | Testing is done to find and fix defects in the product. 测试旨在发现并修复产品中的缺陷。 |
| Quality Assurance ensures that the processes and procedures followed by the team are in place. 质量保证确保团队遵循的流程和程序到位。 | Testing confirms that the product conforms to the specifications required. 测试确认产品符合所需规格。 |
| In Quality Assurance, the focus is on the processes that operate on the product. 在质量保证中,重点在于作用于产品的过程。 | In Testing, the focus is on the end product itself. 在测试中,重点在于最终产品本身。 |
| It is a proactive process (a proactive strategy focuses on preventing problems from arising). 它是一个主动过程(主动策略侧重于防止问题发生)。 | It is a reactive process (a reactive approach focuses on reacting to events after they have occurred). 它是一个被动过程(被动方法侧重于事件发生后对其作出反应)。 |
| Quality Assurance needs to be implemented by the whole team. 质量保证需要整个团队实施。 | In Testing, only the testing team is concerned. 在测试中,仅涉及测试团队。 |
224. Differentiate between Test Plan and Test Strategy.
区分测试计划与测试策略。
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2958d557c902bb7fa8 | 官方: 否 | 付费: 否
答案:
- Test Plan: A test plan is a document that illustrates the test procedure, destinations, timetable, estimation, and expectations, as well as the assets needed for testing. It motivates us to determine the effort required to approve the kind of application being tested. The test plan serves as a diagram to guide software testing exercises as a well-defined method that the test manager closely monitors and controls. Test plan id, highlights to be tested, test systems, testing assignments, highlights pass or bomb criteria, test expectations, duties, and timeline, and so on are all included in the test plan.
- Test Strategy: In software testing, a test strategy is a collection of guiding principles that specifies the test design and control how the software testing process is carried out. The Test Strategy's goal is to give a systematic method to software testing so that quality, traceability, reliability, and better planning may be assured.
The following table lists the differences between Test Plan and Test Strategy :
下表列出了测试计划与测试策略之间的区别:
| Test Plan 测试计划 | Test Strategy 测试策略 |
|---|---|
| A software project test plan is a document that specifies the scope, purpose, approach, and emphasis of a software testing process. 软件项目测试计划是一份文档,规定了软件测试过程的范围、目的、方法和重点。 | A test strategy is a set of rules that describes how to develop tests and outlines how they should be carried out. 测试策略是一组规则,描述了如何开发测试并概述了如何执行这些测试。 |
| Test plan elements include the following: 测试计划要素包括以下内容: |
Test plan id Features to be tested Test procedures Testing tasks Features pass or fail criteria Test deliverables Responsibilities Schedule, among others. | Following are the components of a test strategy :
测试计划ID 待测试功能 测试程序 测试任务 功能通过或失败标准 测试交付物 职责 进度表等。 | 以下是测试策略的组成部分:
Objectives and scope Documentation formats Test methodologies Team reporting structure Client communication strategy | | The specifications of the testing process are described in the test plan. | The general approaches are described in the test strategy. | | A testing manager or lead executes a test plan that specifies how to test when to test, who will test, and what to test. | The project manager implements a test strategy. It specifies which approach to use and which module to test. | | Changes to the test plan are possible once it has been created. | It is impossible to alter the test strategy once it has been created. | | Test planning is done to identify risks by determining potential issues and dependencies. | This is a long-term approach. You can use information that isn't specific to a project to create a test strategy. | | A test plan can exist individually. | Test strategy is frequently found as an element of a test plan in smaller projects. | | It is established at the project level. | It is configured at the organisational level and can be utilised across different projects. |
目标和范围 文档格式 测试方法 团队报告结构 客户沟通策略 | | 测试过程的规格在测试计划中描述。 | 一般方法在测试策略中描述。 | | 测试经理或负责人执行一份测试计划,规定如何测试、何时测试、由谁测试以及测试什么。 | 项目经理实施测试策略。它指定使用哪种方法以及测试哪个模块。 | | 测试计划一旦创建就可以进行更改。 | 测试策略一旦创建就无法更改。 | | 测试计划旨在通过确定潜在问题和依赖关系来识别风险。 | 这是一个长期方法。你可以使用不特定于项目的信息来创建测试策略。 | | 测试计划可以独立存在。 | 在较小的项目中,测试策略通常作为测试计划的一个元素存在。 | | 它在项目级别建立。 | 它在组织级别配置,可以跨不同项目使用。 |
225. What do you mean by build and release in the context of quality assurance? Differentiate between them.
在质量保证的背景下,构建和发布是什么意思?区分它们。
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fab | 官方: 否 | 付费: 否
答案:
- Build: A build is a software or application that is ready to be tested. Developers create software, which they then hand over to testers to test. It's a broad phrase that refers to any application that will be examined. Developers can either create a complete program or add a new feature to an existing one. Then that program, together with the new functionality, is dubbed BUILD, and it is put through its tests by testers.
- Release: After development and testing, the release is the finalized application. The testing team verifies the program and releases it to the customer after testing it. It's possible that a single release will have many builds. As a result, it is the program that is supplied to the customer when the development and testing phases are completed. Furthermore, the release is based on builds, and there may be multiple builds.
The following table lists the differences between build and release:
下表列出了构建与发布之间的区别:
| Build 构建 | Release 发布 |
|---|---|
| Build refers to a version of the software or application which the development team hands over to the testing team. 构建指的是开发团队交给测试团队的软件或应用程序的一个版本。 | Release refers to the software which the testing team hands over to the end customers. 发布指的是测试团队交给最终客户的软件。 |
| The build version of the software requires testing to be done on it. Generally, sanity testing is performed on a build version. 软件的构建版本需要对其进行测试。通常,在构建版本上执行健全性测试。 | The release version of software no longer requires testing to be done on it. 软件的发布版本不再需要进行测试。 |
| The build version of the software is made more frequently than the release version. 软件的构建版本比发布版本更频繁地生成。 | Release versions of the software are made less frequently than the build version. 软件的发布版本比构建版本生成频率较低。 |
226. What do you understand about bug leakage and bug release?
你对缺陷泄漏和缺陷发布有什么理解?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fae | 官方: 否 | 付费: 否
答案:
- Bug Leakage: When a bug is discovered by an end-user, that should have been caught in earlier builds/versions of the application, a bug leakage occurs. Bug leaking refers to a fault that exists during testing but is not discovered by the tester and is subsequently discovered by the end-user.
- Bug Release: When a particular version of the software is released with a collection of known bugs/defects, it is referred to as a bug release (s). Bugs of this type are frequently of low severity and/or priority. When the company can afford the existence of a bug in the released software rather than the time/cost of repairing it in that version, this is done. In most cases, these bugs are disclosed in the Release Notes.
227. What do you understand about Traceability Matrix (TM) in the context of quality assurance?
在质量保证的背景下,你对可追溯性矩阵(TM)有什么理解?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fb1 | 官方: 否 | 付费: 否
答案:
A Traceability Matrix is a document that connects any two baseline documents that require a many-to-many link to ensure that the relationship is complete. It's used to keep track of requirements and make sure they're being met on the present project.
可追溯性矩阵是一个文档,连接任何两个需要多对多链接的基线文档,以确保关系的完整性。它用于跟踪需求,并确保在当前项目中满足这些需求。
The following are the three major components of a traceability matrix: - Forward Traceability: This matrix is used to determine whether the project is progressing in the appropriate direction and for the correct product. It ensures that each specification is applied to the product and that each specification is adequately tested. It connects test cases to requirements.
以下是可追溯性矩阵的三个主要组成部分: - 前向可追溯性:该矩阵用于确定项目是否在适当方向上为正确的产品进展。它确保每个规格都应用到产品中,并且每个规格都得到充分测试。它将测试用例连接到需求。
- Backward or reverse Traceability: It is used to verify that the present product is still on track. The goal of this form of traceability is to ensure that we are not expanding the project's scope by adding code, design features, testing, or other activities not stated in the requirements. It connects requirements to test cases.
- Bidirectional Traceability: This traceability matrix ensures that all criteria are covered by test cases in both directions (forward and backward). It examines the impact of a change in requirements caused by a work product defect, and vice versa.
228. What do you understand about defect leakage ratio in the context of quality assurance?
在质量保证的背景下,你如何理解缺陷泄漏率?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fb6 | 官方: 否 | 付费: 否
答案:
Software testers utilise defect leakage as a metric to determine the effectiveness of Quality Assurance (QA) testing. It's the ratio of the total number of flaws attributed to a stage (which are captured in subsequent stages) to the sum of the total number of defects captured in that stage and the total number of defects assigned to a stage (which are captured in subsequent stages). Defect leakage is a metric that counts the percentage of faults that leak from one testing stage to the next, as well as demonstrating the effectiveness of software testers' testing. The testing team's worth, on the other hand, is only confirmed when defect leaking is small or non-existent.
软件测试人员利用缺陷泄漏作为衡量质量保证(QA)测试有效性的指标。它是指归因于某个阶段的缺陷总数(在后续阶段捕获)与该阶段捕获的缺陷总数和归因于该阶段的缺陷总数(在后续阶段捕获)之和的比率。缺陷泄漏是一个指标,用于计算从一个测试阶段泄漏到下一阶段的缺陷百分比,同时也展示了软件测试人员测试的有效性。然而,测试团队的价值只有在缺陷泄漏很小或不存在时才得到确认。
229. Differentiate between Quality Assurance (QA) and Quality Control (QC).
区分质量保证(QA)和质量控制(QC)。
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fb9 | 官方: 否 | 付费: 否
答案:
Quality Control (QC): A systematic set of techniques used to assure the quality of software products or services is known as quality control in software testing. By testing and reviewing the software product's functional and non-functional requirements, the quality control process ensures that it fulfils the actual needs.
质量控制(QC):在软件测试中,用于确保软件产品或服务质量的一整套系统性技术被称为质量控制。通过测试和审查软件产品的功能性和非功能性需求,质量控制过程确保其满足实际需求。
The following table lists the differences between Quality Assurance (QA) and Quality Control (QC):
下表列出了质量保证(QA)和质量控制(QC)之间的差异:
| Quality Assurance 质量保证 | Quality Control 质量控制 |
|---|---|
| It is a method that focuses on assuring that the specified quality will be met. 它是一种侧重于确保达到规定质量的方法。 | It is a method that focuses on achieving the desired level of quality. 它是一种侧重于实现所需质量水平的方法。 |
| The goal of quality assurance is to avoid defects. 质量保证的目标是避免缺陷。 | The goal of quality control is to find and correct flaws. 质量控制的目标是发现并纠正缺陷。 |
| It's a way to keep track of quality. (Verification) 这是一种跟踪质量的方式。(验证) | It's a method for verifying the quality. (Validation) 这是一种验证质量的方法。(确认) |
| It does not entail running the software. 它不涉及运行软件。 | It always entails running software. 它总是涉及运行软件。 |
| It is a Proactive measure (method of prevention). 它是一种主动措施(预防方法)。 | It is a Reactive measure (a remedial technique). 它是一种反应性措施(补救技术)。 |
| It is the method for producing deliverables. 它是产生交付物的方法。 | It is the technique for ensuring that deliverables are correct. 它是确保交付物正确的技术。 |
| QA is involved in the entire software development process. QA参与整个软件开发过程。 | QC is involved in the entire software testing process. QC参与整个软件测试过程。 |
| Quality Assurance establishes standards and processes in order to achieve client expectations. 质量保证建立标准和流程,以满足客户期望。 | While working on the product, Quality Control ensures that the standards are followed. 在处理产品时,质量控制确保遵循标准。 |
| It is carried out prior to Quality Control. 它在质量控制之前进行。 | It is only carried only once the QA activity has been completed. 它仅在QA活动完成后进行。 |
| It's a low-level activity that can detect errors and inaccuracies that quality control can't. 它是一种低级活动,可以检测质量控制无法发现的错误和不准确之处。 | It's a High-Level Activity because it can detect errors that Quality Assurance can't. 它是一种高级活动,因为可以检测质量保证无法发现的错误。 |
| Quality Assurance guarantees that everything is done correctly, which is why it is classified as a verification activity. 质量保证保证所有事情都正确完成,因此被归类为验证活动。 | Quality Control ensures that everything we do is in accordance with the requirements, which is why it is classified as a validation activity. 质量控制确保我们所做的一切符合要求,因此被归类为确认活动。 |
| SPC, or Statistical Process Control, is a statistical technique used in quality assurance (SPC) 统计过程控制(SPC)是质量保证中使用的一种统计技术。 | SQC, or Statistical Quality Control, is a statistical technique used in quality control. 统计质量控制(SQC)是质量控制中使用的一种统计技术。 |
230. What do you mean by monkey testing in the context of quality assurance?
在质量保证的背景下,猴子测试是什么意思?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fbc | 官方: 否 | 付费: 否
答案:
Monkey testing is a software testing technique in which the tester inserts any random inputs into the software application without using predefined test cases and observes the software program's behaviour to see if it crashes. The goal of monkey testing is to use experimental ways to uncover faults and problems in software applications. Monkey testing is a sort of black-box testing that involves supplying random inputs to a system in order to check its behaviour, such as whether it is crashing or not. Monkey testing does not necessitate the creation of test cases. It can also be automated, in the sense that we can develop programs or scripts to produce random inputs in order to test the system's behaviour. When undertaking stress or load testing, this technique comes in handy.
猴子测试是一种软件测试技术,测试人员在没有预定义测试用例的情况下,向软件应用程序输入任意随机数据,并观察软件程序的行为,看其是否崩溃。猴子测试的目标是通过实验性方式发现软件应用程序中的故障和问题。猴子测试是一种黑盒测试,它通过向系统提供随机输入来检查其行为,例如是否崩溃。猴子测试不需要创建测试用例。它也可以自动化,即我们可以开发程序或脚本生成随机输入来测试系统的行为。在进行压力或负载测试时,这种技术非常有用。
Monkeys are divided into two categories: - Smart Monkeys: The smart monkeys are those who have a basic understanding of the application. They know which of an application's pages will redirect to which page. They also know whether the inputs they're giving are valid or not. If they discover an error, they are wise enough to report it as a bug. They are also aware of the menus and buttons.
猴子分为两类:- 聪明猴子:聪明猴子是对应用程序有基本了解的猴子。它们知道应用程序的哪个页面会重定向到哪个页面。它们也知道自己提供的输入是否有效。如果发现错误,它们足够聪明,会将其报告为缺陷。它们还熟悉菜单和按钮。
- Dumb Monkeys: Dumb Monkeys are individuals who are completely unaware of the application. They have no idea where an application's pages will reroute. They give random inputs and are unaware of the application's beginning and finish points. Despite the fact that they have no knowledge of the application, they discover bugs such as environmental failure or hardware failure. They also have limited knowledge of an application's functioning and user interface.
231. What do you mean by gorilla testing in the context of quality assurance?
在质量保证的背景下,大猩猩测试是什么意思?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fbf | 官方: 否 | 付费: 否
答案:
Gorilla Testing:
大猩猩测试:
Gorilla testing is a method of software testing in which a module is frequently tested based on some random inputs, ensuring that the module's operations are checked and that there are no problems in the module. So it's also known as Torture Testing, Fault Tolerance Testing, or Frustrating Testing because of the Gorilla Testing pattern. It's a manual test that's done over and over again. In Gorilla Testing, testers and developers work together to regularly evaluate a module's functionality.
大猩猩测试是一种软件测试方法,其中经常基于一些随机输入对模块进行测试,确保检查模块的操作,并且模块中没有问题。因此,由于大猩猩测试的模式,它也被称为折磨测试、容错测试或沮丧测试。这是一种反复进行的手动测试。在大猩猩测试中,测试人员和开发人员一起定期评估模块的功能。
232. Differentiate between gorilla testing and monkey testing.
区分大猩猩测试和猴子测试。
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fc2 | 官方: 否 | 付费: 否
答案:
The following table lists the differences between gorilla testing and monkey testing:
下表列出了大猩猩测试和猴子测试之间的差异:
| Gorilla Testing 大猩猩测试 | Monkey Testing 猴子测试 |
|---|---|
| Gorilla testing is a method of software testing in which a module is frequently tested based on some random inputs, ensuring that the module's operations are checked and that there are no problems in the module. 大猩猩测试是一种软件测试方法,其中经常基于一些随机输入对模块进行测试,确保检查模块的操作,并且模块中没有问题。 | Monkey testing is a method of software testing that evaluates the behaviour of the system and validates whether it crashes or not based on some random inputs and no test cases. 猴子测试是一种软件测试方法,它评估系统的行为,并根据随机输入且无测试用例来验证系统是否崩溃。 |
| The primary goal of Gorilla testing is to determine whether or not a module is functioning properly. 大猩猩测试的主要目标是确定模块是否正常运行。 | The primary goal of monkey testing is to determine whether or not a system will crash. 猴子测试的主要目标是确定系统是否会崩溃。 |
| Gorilla testing is a type of manual testing that is done repeatedly. 大猩猩测试是一种重复进行的手动测试。 | Monkey testing is a sort of random testing that does not involve test cases. 猴子测试是一种不涉及测试用例的随机测试。 |
| Only a few select modules of the system are subjected to this testing. 只对系统的少数选定模块进行此测试。 | This testing is carried out over the entire system. 此测试在整个系统上进行。 |
| Unit testing primarily employs the Gorilla Testing method. 单元测试主要采用大猩猩测试方法。 | In System Testing, the Monkey Testing approach is primarily employed. 在系统测试中,主要采用猴子测试方法。 |
| Torture Testing, Fault Tolerance Testing, and Frustrating Testing are all terms used to describe gorilla testing. 大猩猩测试也被称为折磨测试、容错测试和沮丧测试。 | Random testing, Fuzz testing, and Stochastic testing are all terms used to describe monkey testing. 猴子测试也被称为随机测试、模糊测试和随机性测试。 |
233. Explain what is a testware in the context of quality assurance.
在质量保证的背景下,解释什么是测试件。
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fc5 | 官方: 否 | 付费: 否
答案:
Testware is a collection of software created for the specific purpose of software testing, particularly software testing automation.
测试件是为软件测试特定目的而创建的软件集合,尤其是软件测试自动化。
For example, automation testware is created to run on automation frameworks. All utilities and application software that work together to test a software package but do not necessarily contribute to operational purposes are referred to as testware. As a result, testware is only a working environment for application software or portions thereof, rather than a static configuration. It contains artifacts created during the testing process that is needed to plan, develop, and execute tests, such as documentation, scripts, inputs, expected outcomes, set-up and clear-up processes, files, databases, environment, and any other software or tools used during testing. Both verification and validation testing methodologies are used to create testware. Testware, like software, consists of codes and binaries, as well as test cases, test plans, and test reports. Testware should be preserved and faithfully maintained under the direction of a configuration management system.
例如,自动化测试件是为在自动化框架上运行而创建的。所有协同工作以测试软件包但未必用于操作目的的工具和应用程序软件统称为测试件。因此,测试件仅是应用软件或其部分的运行环境,而非静态配置。它包含测试过程中产生的工件,用于计划、开发和执行测试,如文档、脚本、输入、预期结果、设置和清理过程、文件、数据库、环境以及测试期间使用的任何其他软件或工具。验证和确认测试方法论都用于创建测试件。测试件与软件一样,由代码和二进制文件以及测试用例、测试计划和测试报告组成。测试件应在配置管理系统的指导下进行保存和忠实维护。
234. What do you understand about data driven testing?
你对数据驱动测试有何理解?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fc8 | 官方: 否 | 付费: 否
答案:
Data-Driven Testing is a software testing technique that stores test data in a table or spreadsheet format. Testers can use data-driven testing to enter a single test script that can run tests for all test data from a table and expect the test results to be returned in the same table. It's also known as parameterized testing or table-driven testing.
数据驱动测试是一种软件测试技术,将测试数据存储在表格或电子表格格式中。测试人员可以使用数据驱动测试输入单个测试脚本,该脚本可对表格中的所有测试数据运行测试,并预期测试结果以相同表格形式返回。它也被称为参数化测试或表驱动测试。
Because testers usually have several data sets for a single test, Data-Driven Testing is critical. Creating different tests for each data set can be time-consuming. Data-driven testing allows data to be kept separate from test scripts, and the same test scripts can be run for multiple combinations of input test data, resulting in more efficient test results.
由于测试人员通常对单个测试有多组数据集,数据驱动测试至关重要。为每个数据集创建不同的测试可能耗时。数据驱动测试允许数据与测试脚本分离,并且相同测试脚本可针对输入测试数据的多种组合运行,从而产生更高效的测试结果。
The above image depicts the process of data-driven testing. Test data is taken from a data file and tested on the application and then the produced output is compared with the actual output.
上图描述了数据驱动测试的过程。测试数据从数据文件中提取并在应用上测试,然后将产生的输出与实际输出进行比较。
235. How would you ensure that your testing is thorough and comprehensive?
你如何确保测试是彻底和全面的?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fcb | 官方: 否 | 付费: 否
答案:
The Requirement Traceability Matrix and Test Coverage Matrix will assist us in determining whether or not our test cases are adequately covered. The requirement traceability matrix will assist us in determining whether the test conditions are sufficient to fulfil all of the requirements. Coverage matrices will assist us in determining whether the test cases are sufficient to satisfy all of the Requirement Traceability Matrix test conditions.
需求追溯矩阵和测试覆盖矩阵将帮助我们确定测试用例是否充分覆盖。需求追溯矩阵将帮助我们确定测试条件是否足以满足所有需求。覆盖矩阵将帮助我们确定测试用例是否足以满足所有需求追溯矩阵的测试条件。
The below image shows a sample Requirement Traceability Matrix:
下图显示了一个需求追溯矩阵示例:
The below image shows a sample Test Coverage Matrix:
下图显示了一个测试覆盖矩阵示例:
236. What are the various artifacts to which you refer when writing test cases?
编写测试用例时你提到的各种工件有哪些?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fce | 官方: 否 | 付费: 否
答案:
Following are the various artifacts that we can refer to while writing test cases : - Specification of functional requirements.
编写测试用例时可以引用的各种工件如下:- 功能需求规范。
- Document that explains what the requirements are.
- Wireframes.
- Use Cases.
- User Stories.
- Acceptance criteria.
- User Acceptance Testing Test cases.
237. What do you mean by a test case? What are some good practices for writing test cases?
什么是测试用例?编写测试用例有哪些良好实践?
- 知识点: 测试 (主题: qa, testing;标签: interviewbit, qa, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7fd1 | 官方: 否 | 付费: 否
答案:
A test case is a collection of actions performed to ensure that a specific feature or operation of your software program is working properly. A Test Case is a set of test procedures, data, preconditions, and postconditions created for a specific test scenario in order to verify any requirement. The test case contains specified variables or conditions that a testing engineer might use to compare expected and actual outcomes in order to assess whether a software product meets the customer's needs.
测试用例是为确保软件程序的特定功能或操作正常运行而执行的一组操作。测试用例是为特定测试场景创建的一组测试过程、数据、前置条件和后置条件,以验证任何需求。测试用例包含测试工程师可能使用的指定变量或条件,用于比较预期和实际结果,以评估软件产品是否满足客户需求。
Following are some good practices for writing test cases : - Simple and transparent test cases are required: Make your test cases as simple as possible. They must be clear and straightforward because the test case author may not be able to perform them. Use declarative language such as "go to the main page," "input data," "click here," and so on. This makes it easier to understand the test stages and speeds up the testing process.
以下是编写测试用例的一些良好实践:- 需要简单透明的测试用例:尽量使测试用例尽可能简单。它们必须清晰直接,因为测试用例作者可能无法执行它们。使用声明式语言,如“转到主页面”、“输入数据”、“点击此处”等。这使测试阶段更易于理解并加速测试过程。
- Create a test case that considers the end-user: Any software project's ultimate goal is to produce test cases that fulfil client requirements and are simple to use and run. A tester must write test cases from the standpoint of the end-user.
- Repetition of test cases should be avoided: Test instances should not be repeated. If a test case is required for the execution of another test case, use the test case id in the preconditioned column to refer to it.
- Make certain you have complete coverage: Make sure you write test cases to ensure you've covered all of the software requirements in the specification document. To verify that no functions or conditions are left untested, use the Traceability Matrix.
- Don't Make Assumptions: When creating a test case, don't make assumptions about the functioning and features of your software application. Follow the specifications in the specification documents.
- Self-cleaning: The test case you write must restore the Test Environment to its previous condition and should not render it unusable. This is particularly true when it comes to configuration testing.
238. Explain the advantages and disadvantages of Software Quality Control.
解释软件质量控制的优点和缺点。
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7ff2 | 官方: 否 | 付费: 否
答案:
Software Quality Control has the following advantages and disadvantages:
软件质量控制具有以下优点和缺点:
Advantages: - Software applications are validated according to the needs and exceptions of the client.
优点:- 软件应用程序根据客户的需求和例外情况进行验证。
- It is used to identify software defects and prevent the sale of faulty products and services.
- The team's productivity is improved.
- Software development is made easier and the quality of the final product is enhanced.
- Enhanced trust in project management and continued development.
- In addition, it reduces re-development and re-work costs, as it is imposed from scratch or at the beginning level of the development phase.
It improves customer satisfaction and software efficiency.
Disadvantages: - Process testing is more time-consuming. Consequently, software deployment can be delayed.缺点:- 流程测试更为耗时。因此,软件部署可能会延迟。
- Software validation requires more resources.
- Inspecting products and services costs money, such as the wages paid to inspectors, tests performed in laboratories. An organization faces a major budgeting issue if the software application is rejected.
- No one takes responsibility for the quality of their own work.
239. Explain the role of a quality control specialist.
解释质量控制专员的作用。
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7ff5 | 官方: 否 | 付费: 否
答案:
The following are some of the roles a quality control engineer or specialist must perform: - Develop, implement, and improve quality control processes and procedures.
以下是质量控制工程师或专员必须执行的一些角色:- 开发、实施和改进质量控制流程和程序。
- Ensure that quality control processes are aligned with commercial objectives in collaboration with senior managers.
- Prepare comprehensive, well-structured, and detailed test plans and cases.
- Analyze operations from a QC perspective.
- Perform quality control inspections.
- Perform statistical analysis from a QC perspective to identify issues, trends, and defects.
- Foster a culture where employees are empowered to report quality control issues or defects without fear of retribution or blame.
- Consult with managers and team members about inspection results.
- Make sure there is a procedure for removing failed products.
- Keep up with new testing strategies and tools, etc.
240. What are the qualities or skills needed to be successful in quality control?
在质量控制中取得成功需要哪些素质或技能?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7ff8 | 官方: 否 | 付费: 否
答案:
Maintaining the quality of the products during production is the responsibility of the quality control specialist. Software products or services are evaluated by quality control specialists using internal specifications and procedures. This profession requires a keen eye for detail, excellent communication skills, planning abilities, and problem-solving skills. Also, they must possess logical thinking skills, effective management skills, and interpersonal skills.
在生产过程中维护产品质量是质量控制专员的责任。质量控制专员使用内部规范和流程评估软件产品或服务。该职业要求敏锐的细节观察力、出色的沟通能力、规划能力和问题解决能力。此外,他们必须具备逻辑思维能力、有效的管理技能和人际交往技能。
241. In Software Quality Control, what types of quality control parameters are available?
在软件质量控制中,有哪些可用的质量控制参数类型?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7ffb | 官方: 否 | 付费: 否
答案:
In Software Quality Control, there are different types of Quality Control Parameters as follows: - Products: Essentially, the Products represent the actual requirements of the client and should be delivered defect-free.
在软件质量控制中,有以下不同类型的质量控制参数:- 产品:基本上,产品代表客户的实际需求,并且应以无缺陷的方式交付。
- Processes: Processes are rules that must be followed while testing a Software System or Product in order to ensure the best results (product deliverables) are obtained. A set of processes will allow a testing procedure to be performed efficiently so that the full product is tested as per the customer's specifications without any functional or non-functional inabilities being missed.
- Resources: It is very important to make efficient use of all resources, including team members, tools, and technologies. Depending on the budget of the project, the testing process can either be automated or manually executed. For manual processes, there ought to be adequate resources within the team to prevent defects or manual errors. On the other hand, automated testing also demands the presence of a technical professional.
242. What are the stages or phases of a standard quality control procedure?
标准质量控制程序的阶段或步骤有哪些?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb7ffe | 官方: 否 | 付费: 否
答案:
Software quality control involves two phases, namely the reviewing and testing phase. - Reviewing Phase: The review phase is a type of static testing or verification process aimed at preventing software defects. This is a process-oriented approach for enhancing the development process performed without executing programs. There are several review activities within the software development life cycle process, such as requirements, design, coding, test plan, test cases, and deployment. It is basically a process-level verification to prevent software defects.
软件质量控制包括两个阶段,即审查阶段和测试阶段。- 审查阶段:审查阶段是一种静态测试或验证过程,旨在预防软件缺陷。这是一种面向流程的方法,用于改进开发过程,在执行程序时不运行程序。在软件开发生命周期过程中有几种审查活动,如需求、设计、编码、测试计划、测试用例和部署。它基本上是过程级验证,以防止软件缺陷。
- Testing Phase: Testing is a dynamic or validation process that identifies defects in a software application. This is a product-oriented approach to improving software product quality performed with program execution. There are several testing activities within the software development life cycle process, such as unit, integration, system, user acceptance, non-functional, release and maintenance testing. Furthermore, as part of this activity, we perform additional functional and non-functional testing, such as smoke testing, retesting, regression testing, sanity testing, as well as performance testing, load testing, volume testing, stress testing, endurance testing to improve the priority (importance of fixing the defect) and severity (impact of the defect) of the developed software product quality.
- Data Science
- All Events
- My Events
243. Which types of testing are performed during the Quality Control process?
在质量控制过程中执行哪些类型的测试?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb8001 | 官方: 否 | 付费: 否
答案:
Unit testing, functional testing, and integration testing are types of testing performed as part of Quality Control processes. Furthermore, there are several other types of testing that can contribute to quality control, such as System Integration Testing, User Acceptance Testing, Non-Functional Testing, Beta Testing, Regression Testing, Performance Testing, Volume Testing, Installation Testing, Recovery Testing, Load Testing, Stress Testing, and Usability Testing.
单元测试、功能测试和集成测试是作为质量控制过程一部分执行的多种测试类型。此外,还有其他几种有助于质量控制的测试类型,如系统集成测试、用户验收测试、非功能测试、Beta测试、回归测试、性能测试、容量测试、安装测试、恢复测试、负载测试、压力测试和可用性测试。
244. What are the artifacts you include when writing test cases?
编写测试用例时,您包含哪些工件?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb8004 | 官方: 否 | 付费: 否
答案:
When writing test cases, there are seven main artifacts that can be considered such as requirement understanding documents, functional requirement specification, user stories, use cases, acceptance criteria, wireframes, and UAT test cases. You should strive to include all relevant artifacts whenever they are applicable to the product we are testing.
编写测试用例时,可以考虑七个主要工件,例如需求理解文档、功能需求规范、用户故事、用例、验收标准、线框图和UAT测试用例。只要适用于我们正在测试的产品,您应尽力包含所有相关工件。
245. What is a good test case?
什么是一个好的测试用例?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb8007 | 官方: 否 | 付费: 否
答案:
Generally, a test case consists of a set of conditions, variables, and/or actions being performed on a system under test to ensure it meets its requirements and functions properly. Good test cases include: - Clear Objective: Specify the intent and scope of the test.
通常,测试用例由一组条件、变量和/或对被测系统执行的操作组成,以确保其满足要求并正常运行。好的测试用例包括:- 明确目标:指定测试的意图和范围。
- Meaningful pass/fail verifications: Specifying what constitutes success and failure and how to determine both.'
- Clear and concise documentation: Prepare standardized formats for your test cases, including unique ID number, descriptions, preconditions, related datasets, and expected outcomes.
- Traceability to requirements: Test cases should be traceable to requirements for a system under test. We need to ensure we test all requirements and changes, and not waste time testing irrelevant components.
- Reusability: Develop test cases that are modular and easy to maintain. It is likely that test cases will change as the system under test evolves over time, but we definitely want to write test cases that are reusable as long as possible.
- Testing of one test case independently of others: Execution of a single test case should not be dependent on other test cases. To create a larger end-to-end test, your independent, modular test cases should be able to be combined into sequential or parallel execution test suites.
246. Explain bug leakage and bug release.
解释缺陷泄漏和缺陷发布。
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb800a | 官方: 否 | 付费: 否
答案:
- Bug Leakage: When an application encounters a bug that should have been detected in earlier versions or builds, this is called bug leakage. The tester is unaware of the defect during testing, which is eventually discovered by the tester/end-user.
- Bug Release: A bug release is when an application or software package is handed over to the testing team with the knowledge that a defect exists. The severity and priority of bugs is low during this period, as bugs can be removed before the final handover.
247. What do you mean by branch testing?
你所说的分支测试是什么意思?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb800d | 官方: 否 | 付费: 否
答案:
The testing of all the branches of a code, which is done at once, is called branch testing. This technique enables every possible branch from every decision point to be executed at least once, ensuring that all reachable code is executed. As part of branch testing, each outcome from a code module is tested as a binary outcome, so you must test both True and False outcomes. Branch Testing provides some features that are generally useful for a software project as given below: - You are able to validate all the branches in the code.
一次完成对代码所有分支的测试称为分支测试。该技术使每个决策点的每个可能分支至少执行一次,确保所有可达代码都被执行。作为分支测试的一部分,代码模块的每个结果都作为二元结果进行测试,因此必须同时测试真和假两种结果。分支测试提供了一些对软件项目通常有用的功能,如下所示:- 您能够验证代码中的所有分支。
- This is a non-functional type of testing.
- Using this method, all branches are checked to ensure that they do not cause abnormal behaviour.
- This is a quantitative measure of a program's code coverage, etc.
248. Can you explain boundary testing?
你能解释一下边界测试吗?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb8010 | 官方: 否 | 付费: 否
答案:
The Boundary value analysis, also known as boundary testing, is a software testing technique, in which tests are conducted based on boundary values or between two opposite ends. In this sense, the extreme ends such as start to end, lower to upper, or maximum to a minimum are called boundary values, and testing such values is called boundary testing.
边界值分析,也称为边界测试,是一种软件测试技术,其中测试基于边界值或两个相反端点之间进行。从这个意义上说,极端端点(如开始到结束、下限到上限或最大值到最小值)被称为边界值,测试这些值被称为边界测试。
249. How can you minimize software bugs?
如何最小化软件缺陷?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb8013 | 官方: 否 | 付费: 否
答案:
The following are some ways to reduce the number of errors and losses in your software product.
以下是一些减少软件产品中错误和损失的方法。
- Monitor the progress of the software products regularly.
- Make your code concise and readable, clear, and simple to unit test. Simple code leads to fewer bugs and takes less time to fix.
- Having your code broken up into independent modules will make it easier for you to test each piece separately. The modularity of your code will make testing easier and less complicated.
- Code comments should be as clear and concise as possible, and you shouldn't rely on them to make code more readable.
- You shouldn't ignore compiler warnings. Compiler warnings indicate code issues that may cause bugs.
- Test, test, and test again! Testing at different stages of the development process can help you catch bugs earlier and fix them more easily than if found later on.
- Having a rushed release and cutting corners could result in more problems for the company and the program. Don't skimp on your work instead put best practices into place now and you will avoid costly and time-consuming mistakes later, etc.
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万+职业规划
250. What do you consider to be the most important quality measures?
你认为最重要的质量度量是什么?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb8016 | 官方: 否 | 付费: 否
答案:
Every organization will have its own measure of quality that matters most, from safety to speed, compliance to cost. Safety is the most important of all quality measures because, without it, all of the others are meaningless. For consumers to trust us and buy from us, our products must be safe. If the products are not safe, consumers will stop buying from us, which can lead to expensive litigation.
每个组织都有自己对最紧要的质量度量,从安全性到速度,从合规性到成本。安全性是所有质量度量中最重要的,因为没有它,其他一切都毫无意义。为了让消费者信任我们并从我们这里购买,我们的产品必须是安全的。如果产品不安全,消费者将停止从我们这里购买,这可能导致昂贵的诉讼。
251. State differences between product quality and process quality.
说明产品质量和过程质量之间的差异。
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2a58d557c902bb8019 | 官方: 否 | 付费: 否
答案:
Product quality is directly impacted by the quality of production processes. Consequently, a quality control manager's duties include inspecting both a company's products and its processes. - Product quality: The purpose of product quality inspections is to detect defects and assess how closely a product conforms to requirements specifications.
产品质量受生产过程质量的直接影响。因此,质量控制经理的职责包括检查公司的产品和过程。- 产品质量:产品质量检查的目的是检测缺陷并评估产品与需求规格的符合程度。
- Process quality: The purpose of a process quality inspection is to identify inefficiencies in the production process that waste organization time, slow down the process, or lead to lower-quality products.
252. What is the importance of standards in quality control?
标准在质量控制中的重要性是什么?
- 知识点: 测试 (主题: quality-control, testing;标签: interviewbit, qc, topic-specific, quality-control, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c2b58d557c902bb801c | 官方: 否 | 付费: 否
答案:
The concept of quality isn't just about profits and losses or beating out your competitors. This is about delivering on a promise, meeting the basic expectations of customers and ensuring product safety. However, companies that meet quality standards often reap greater profits and reduce losses. Quality standards are a set of good management practices, methods, systems, requirements, or specifications formulated by industry advisory groups to help developers achieve and demonstrate consistent product quality.
质量的概念不仅仅是关于利润和损失或击败竞争对手。这关乎兑现承诺、满足客户的基本期望并确保产品安全。然而,符合质量标准的公司通常能获得更大的利润并减少损失。质量标准是由行业咨询小组制定的一套良好管理实践、方法、系统、要求或规范,帮助开发者实现并展示一致的产品质量。
Having quality standards in place is important for an organization since it helps the team members stay organized and on task. By eliminating redundancy, unnecessary processes would no longer be carried out, resulting in costs being reduced. Additionally, establishing standards will help all members of the team to be guided in the right direction.
对于组织来说,建立质量标准很重要,因为它有助于团队成员保持组织性和按任务推进。通过消除冗余,不再执行不必要的流程,从而降低成本。此外,建立标准将有助于团队所有成员被引导到正确的方向上。
253. What are the features of the robot framework?
机器人框架有哪些特点?
- 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c3758d557c902bc6654 | 官方: 否 | 付费: 否
答案:
Following are the features of the robot framework: - Tabular structure is used for test cases: The test cases in the Robot framework are defined in a simple tabular manner using keywords. A new developer may easily comprehend and write test cases.
以下是机器人框架的特点:- 测试用例使用表格结构:机器人框架中的测试用例以简单的表格方式使用关键字定义。新开发人员可以轻松理解和编写测试用例。
- Keywords: Built-in keywords are accessible with Robot Framework, as well as keywords from libraries such as the Selenium Library (open browser, close browser, maximize browser, etc.). We can also make user-defined keywords out of a mix of other user-defined keywords, built-in keywords, and library keywords. We can even pass parameters to such keywords, turning user-defined keywords into reusable functions.
- Variables: Variables such as scalar, list, and dict are supported by the Robot framework. Variables in the robot framework are simple to utilize and come in handy when constructing complicated test cases.
- Libraries: External libraries such as SeleniumLibrary, DatabaseLibrary, FTPLibrary, and httpLibrary are all supported by the Robot framework. SeleniumLibrary is widely used because it allows users to interact with browsers and aids in web application and user interface testing. The Robot framework provides its own built-in libraries for strings, dates, and integers, among other things.
- Resources: Externally imported robot files with keywords can now be utilized with test cases thanks to the Robot Framework. The resources are simple to utilize and come in handy when we need to use keywords that have previously been written for other test projects.
- Test cases based on data: The Robot framework supports both keyword-driven and data-driven test scenarios. Data-driven testing uses a high-level keyword as a template for the test suite, and test cases are used to communicate data with the template's high-level keyword. It simplifies the process of testing user interfaces with various inputs.
- Logs and Reports: In the form of reports and logs, the Robot framework offers all of the data of the test suite and test case execution. The log file contains all of the test case's execution details.
254. What are the benefits of using the Robot Framework?
使用机器人框架有哪些好处?
- 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c3758d557c902bc6657 | 官方: 否 | 付费: 否
答案:
The Benefits of the Robot Framework are listed below: - The Robot Framework is a free and open-source framework.
机器人框架的好处如下:- 机器人框架是一个免费的开源框架。
- It's easy to set up and use, and it allows you to create and run test cases. Any beginner may get started with the robot framework because it is simple to grasp and does not require much testing knowledge.
- It allows you to write keyword-driven, behaviour-driven, or data-driven test cases.
- It's a fantastic method to support third-party libraries. The most popular is the Selenium Library, which is easy to install and use in robot frameworks.
- Minimal threshold: Because the Robot framework is a keyword-driven framework, it just requires a basic understanding of programming. In other words, practically every member of a quality assurance company's project team can use it. Variables, functions, and return values can all be used as options.
- Complete web/ mobile support: This product works well on the web and on mobile devices (both in the form of end-to-end and atomic tests).
- Usage of tags: Instead of tests, users can assign tags. Any data that can be used to identify a test, such as a test ID, a list of components utilized in the test, and so on, can be included in such tags. This solution enables the creation of a link between tests and software requirements, as well as the selection of the appropriate configuration test vector.
You shouldn't need much input to write common test result documents. Without the need to submit any further commands, all reports are generated automatically. Combining the outcomes of multiple test runs is possible. The following file types are produced as a result of these findings:
Report.html – high-level results with no detail; Output.xml – test results in XML format; Log.html – test results in the form of HTML structure; - With the use of the Robot framework and robot at the same time, parallel running is allowed. A basic root command is a common planned application situation. Without a doubt, all of the exams should be created with this in mind and should not interfere with one another.Report.html – 高层次结果,无详细信息;Output.xml – 以XML格式表示的测试结果;Log.html – 以HTML结构形式表示的测试结果;- 同时使用机器人框架和机器人,允许并行运行。基本的根命令是常见的计划应用场景。毫无疑问,所有测试都应基于此创建,并且不应相互干扰。
255. What are the names of all the file formats that the Robot framework supports?
机器人框架支持的所有文件格式的名称是什么?
- 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c3758d557c902bc665a | 官方: 否 | 付费: 否
答案:
We commonly use files written in simple text format (usually in the .robot form, or in the format of .txt) in Robot Framework, but we can also use files written in Tab separated format or TSV. The plain text data can then be embedded in reStructured text format files.
我们通常在机器人框架中使用以简单文本格式编写的文件(通常以.robot形式或.txt格式),但也可以使用制表符分隔格式或TSV格式的文件。然后,纯文本数据可以嵌入到reStructured文本格式的文件中。
The space-separated format, in which bits of data, such as keywords and their arguments, are separated from each other with two or more spaces, is the most frequent way to construct Robot Framework data. The pipe separated format, in which the separator is the pipe character surrounded by spaces (|), is another option.
空格分隔格式是构建机器人框架数据最常见的方式,其中数据位(如关键字及其参数)以两个或更多空格分隔。管道分隔格式是另一种选项,其中分隔符是周围有空格(|)的管道字符。
The --extension option can be used to change the default extension of executed files, which is .robot. Although resource files can utilize the .robot extension, it is advised that they use the dedicated .resource extension. The UTF-8 encoding must be used to save files that contain non-ASCII characters.
可以使用--extension选项更改执行文件的默认扩展名(默认为.robot)。虽然资源文件可以使用.robot扩展名,但建议使用专用的.resource扩展名。包含非ASCII字符的文件必须使用UTF-8编码保存。
reStructuredText files are also supported by Robot Framework, allowing standard Robot Framework data to be inserted within code blocks. With reStructuredText files, either the .rst or .rest extension can be used, but the --extension option must be used to enable parsing when executing a directory.
机器人框架还支持reStructuredText文件,允许在代码块中插入标准的机器人框架数据。对于reStructuredText文件,可以使用.rst或.rest扩展名,但执行目录时必须使用--extension选项来启用解析。
256. What do you understand by RIDE in the context of the robot framework?
在机器人框架的上下文中,你如何理解RIDE?
- 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c3758d557c902bc665d | 官方: 否 | 付费: 否
答案:
The Ride is the Robot Framework's Integrated Development Environment. An Integrated Development Environment (IDE) is a software application that gives computer programmers a set of tools for authoring and debugging code. there are two ways to go to Ride, as mentioned below:
Ride是机器人框架的集成开发环境。集成开发环境(IDE)是一种软件应用程序,为计算机程序员提供一组用于编写和调试代码的工具。有两种方式进入Ride,如下所述:
Type 'Ride.py' at the command prompt.
在命令提示符下输入“Ride.py”。
OR - Create a desktop shortcut for Ride for quick access. Follow the instructions below:
或者- 为Ride创建桌面快捷方式以便快速访问。请按照以下说明操作:
- Open Windows Explorer.
- Go to the Ride installation folder ("C\python27\scripts" in our case).
- Select 'Send To' Desktop (Create shortcut)' from the context menu.
- Ride can be launched by clicking a shortcut on the desktop.
257. What are the disadvantages of using the robot framework?
使用机器人框架有哪些缺点?
- 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c3758d557c902bc6660 | 官方: 否 | 付费: 否
答案:
Following are the disadvantages of using the robot framework: - Debugging capability is not included: In other words, the product lacks options for the standard breakpoint configuration. As a result, a user must employ time slips or display something different in the log.
以下是使用机器人框架的缺点:- 不含调试能力:换句话说,产品缺少标准断点配置的选项。因此,用户必须使用时间延迟或日志中显示不同内容的方法。
- Many difficulties in the Ride IDE: When using the "text editor" mode as well as the tabular mode, the programme will occasionally crash. It's also worth noting that some third-party plugins aren't compatible with specific libraries because autocomplete isn't available (for example, SeleniumLibrary).
- Support for third-party extensions and libraries is unstable: This framework does not support libraries that have previously been developed. Of course, you can make your own, but this is pointless because such extensions cannot be used many times.
- Data Science
- All Events
- My Events
258. Explain the hierarchical structure for arranging test cases in the context of the robot framework.
解释在机器人框架上下文中安排测试用例的层次结构。
- 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c3758d557c902bc6663 | 官方: 否 | 付费: 否
答案:
The following is the hierarchical framework for arranging test cases: - In test case files, test cases are constructed.
以下是用于安排测试用例的层次结构框架:- 在测试用例文件中,构建测试用例。
- A test suite containing the test cases in a test case file is created automatically.
- A higher-level test suite is a directory containing test case files. As its child test suites, such a test suite directory has suites produced from test case files.
- A test suite directory can contain other test suite directories, and the hierarchy can go as deep as needed.
A specific initialization file can be found in test suite directories that configures the newly established test suite.
In addition, there are the following: - Test libraries that contain the most basic keywords.此外,还有以下内容:- 包含最基本关键字的测试库。
- Variables and higher-level user keywords are stored in resource files.
- Variable files are more flexible than resource files when it comes to creating variables.
259. What are the different types of variables in the context of the robot framework?
在机器人框架的背景下,有哪些不同类型的变量?
- 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c3758d557c902bc6666 | 官方: 否 | 付费: 否
答案:
Variables are a key component of Robot Framework, and they can be utilized in almost every test data scenario. They're most typically used as arguments for keywords in the Test Case and Keyword sections, although they're also allowed in all settings. A variable cannot be used to specify a standard keyword name, but the BuiltIn keyword Run Keyword can be used to achieve the same result.
变量是机器人框架的关键组成部分,它们可以在几乎所有的测试数据场景中使用。它们最典型的用法是作为测试用例和关键字部分中关键字的参数,尽管它们也允许用于所有设置中。变量不能用于指定标准关键字名称,但内置关键字 Run Keyword 可以用来实现相同的结果。
Following are the different types of variables: - Scalar Variables:
以下是不同类型的变量:- 标量变量:
The scalar variable syntax like ${var} is the most popular way to use variables in Robot Framework test data. The variable name is substituted with its value as-is when this syntax is used. Variable values are often strings, but variables can also hold any object, such as numbers, lists, dictionaries, or even bespoke objects.
像 ${var} 这样的标量变量语法是在机器人框架测试数据中使用变量的最流行方式。当使用此语法时,变量名称会按原样替换为其值。变量值通常是字符串,但变量也可以包含任何对象,例如数字、列表、字典,甚至自定义对象。
Example:
示例:
Test Cases
测试用例
Constants
常量
Log Hello
日志 你好
Log Hello, world!!
日志 你好,世界!!
Variables
变量
Log ${GREET}
日志 ${GREET}
Log ${GREET}, ${NAME}!!
日志 ${GREET}, ${NAME}!!
The use of scalar variables is demonstrated in the example above. Both the above test cases are similar if the variables ${GREET} and ${NAME} are available and assigned to the strings Hello and world, respectively. When a scalar variable is used without any text or other variables around it, like in ${GREET} above, the variable is substituted with its value, which can be any object. If the variable isn't used alone, as in ${GREER}, ${NAME}!!, its value is transformed to a string before being concatenated with the other data. - List Variables:
上述示例中演示了标量变量的使用。如果变量 ${GREET} 和 ${NAME} 分别可用并分配给字符串 Hello 和 world,那么上述两个测试用例是相似的。当标量变量单独使用且周围没有任何文本或其他变量时,如上面的 ${GREET},变量会被替换为其值,该值可以是任何对象。如果变量不是单独使用的,如 ${GREET}, ${NAME}!!,其值会在与其他数据拼接之前被转换为字符串。- 列表变量:
When a variable, such as ${EXAMPLE}, is used as a scalar, its value is utilized exactly as it is. If a variable's value is a list or looks like a list, it can also be used as a list variable, such as @{EXAMPLE}. The list is enlarged in this scenario, and each item is sent in as a distinct argument.
当变量(如 ${EXAMPLE})作为标量使用时,其值会被完全按原样使用。如果变量的值是列表或看起来像列表,它也可以用作列表变量,例如 @{EXAMPLE}。在这种情况下,列表会被展开,每个项目作为单独的参数发送。
Test Cases
测试用例
Constants
常量
Login user password
登录 用户 密码
List Variable
列表变量
Login @{CREDENTIALS}
登录 @{CREDENTIALS}
In the above example, the variable @{CREDENTIALS} has values [‘user’, ‘password’]. Robot Framework keeps all of its variables in one internal storage location and allows them to be used as scalars, lists, or dictionaries. If you want to use a variable as a list, its value must be a Python list or a list-like object. Strings are not allowed to be used as lists in Robot Framework, although other iterable objects like tuples and dictionaries are. - Dictionary Variables:
在上述示例中,变量 @{CREDENTIALS} 的值为 ['user', 'password']。Robot Framework 将所有变量存储在一个内部存储位置中,并允许它们作为标量、列表或字典使用。如果您想将变量用作列表,其值必须是 Python 列表或类似列表的对象。在 Robot Framework 中,字符串不允许用作列表,尽管元组和字典等其他可迭代对象是允许的。- 字典变量:
A dictionary variable is a variable containing a Python dictionary or a dictionary-like object. The syntax for a dictionary variable is &{EXAMPLE}. In practice, this means the dictionary is enlarged, and individual items are supplied to the keyword as named arguments. For example,
字典变量是包含 Python 字典或类似字典对象的变量。字典变量的语法是 &{EXAMPLE}。实际上,这意味着字典被扩展,各个项作为命名参数提供给关键字。例如,
Test Cases
测试用例
Constants
常量
Login user=user1 password=password1
登录 user=user1 password=password1
Dict Variable
字典变量
Login &{CREDENTIALS}
登录 &{CREDENTIALS}
In the above example, assuming that the variable &{CREDENTIALS} has value {‘user’: ‘user1’, ‘password’: ‘password1’}, the two test cases are equivalent. - Environment Variables:
在上述示例中,假设变量 &{CREDENTIALS} 的值为 {'user': 'user1', 'password': 'password1'},这两个测试用例是等价的。- 环境变量:
The %{ENV_VAR_NAME} syntax in Robot Framework allows you to use environment variables in your test data. They're only allowed to use string values. By separating the variable name and the default value with an equal sign, such as %{ENV_VAR_NAME = default_value}, you can give a default value that will be used if the environment variable does not exist.
Robot Framework 中的 %{ENV_VAR_NAME} 语法允许您在测试数据中使用环境变量。它们只允许使用字符串值。通过用等号分隔变量名和默认值,例如 %{ENV_VAR_NAME = default_value},您可以提供一个默认值,如果环境变量不存在,则将使用该默认值。
Environment variables set in the operating system before the test execution are available during it, and the keywords Set Environment Variable and Delete Environment Variable, both available in the OperatingSystem library, can be used to create new ones or delete existing ones. Because environment variables are global, environment variables defined in one test case can be reused in subsequent test cases. Changes to environment variables, on the other hand, are ineffective after the test has been completed.
在测试执行前由操作系统设置的环境变量在测试期间可用,并且关键字 Set Environment Variable 和 Delete Environment Variable(两者在 OperatingSystem 库中均可用)可用于创建新的环境变量或删除现有的环境变量。由于环境变量是全局的,在一个测试用例中定义的环境变量可以在后续测试用例中重用。另一方面,环境变量的更改在测试完成后无效。
260. What is the name of the dependency that you must need in order to install and use the RIDE editor in the context of the robot framework?
在 robot framework 的上下文中,要安装和使用 RIDE 编辑器,您必须需要的依赖项名称是什么?
- 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c3758d557c902bc6669 | 官方: 否 | 付费: 否
答案:
wxPython and pywin32 are the names of the dependency and package that you must use to install and use RIDE editor.
wxPython 和 pywin32 是您必须用于安装和使用 RIDE 编辑器的依赖项和包的名称。
261. Is it possible to use the Selenium library to speed up or slow down the execution of test cases?
是否可以使用 Selenium 库来加速或减慢测试用例的执行速度?
- 知识点: 测试 (主题: robot-framework, testing;标签: interviewbit, robot-framework, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c3758d557c902bc666c | 官方: 否 | 付费: 否
答案:
Yes, we can use the Set Selenium Speed keyword to modify the execution speed.
可以,我们可以使用 Set Selenium Speed 关键字来修改执行速度。
262. Differentiate between Software Development Engineer in Test (SDET) and Manual Tester.
区分软件测试开发工程师(SDET)和手动测试人员。
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4458d557c902bc6ebd | 官方: 否 | 付费: 否
答案:
Tester: A tester is someone who performs software testing in order to find flaws. The tester additionally examines several features of the software. The tester is unaware of the software development process. A tester examines the software to see whether it contains any faults or flaws.
测试人员:测试人员是执行软件测试以发现缺陷的人。测试人员还会检查软件的多个功能。测试人员不了解软件开发过程。测试人员检查软件以查看其是否包含任何错误或缺陷。
The following table lists the differences between an SDET and a Manual Tester:
下表列出了 SDET 和手动测试人员之间的差异:
| Software Development Engineer in Test (SDET) 软件测试开发工程师(SDET) | Manual Tester 手动测试人员 |
|---|---|
| SDET refers to a tester who is also a coder. SDET 指同时具备编码能力的测试人员。 | A tester tests software or systems after they have been developed. 测试人员在软件或系统开发完成后对其进行测试。 |
| SDET is well-versed in the areas of design, implementation, and testing. SDET 精通设计、实现和测试领域。 | A tester is unaware of the software's design and implementation. 测试人员不了解软件的设计和实现。 |
| SDET also examines the software's performance. SDET 还会检查软件的性能。 | The tester is only responsible for testing duties. 测试人员只负责测试职责。 |
| SDET is well-versed in software requirements and other related topics. SDET 精通软件需求及其他相关主题。 | A tester has a limited understanding of software requirements. 测试人员对软件需求的理解有限。 |
| SDET is involved at every stage of the software development life cycle. SDET 参与软件开发生命周期的每个阶段。 | In the software development life cycle, testers play a less role and have fewer obligations. 在软件开发生命周期中,测试人员的角色较少,职责也较少。 |
| SDET needs to be well versed in coding since they can be required to do both automated and manual testing. SDET 需要精通编码,因为他们可能需要同时执行自动化和手动测试。 | Testers need not be well versed in coding since they are only required to do manual testing. 测试人员不需要精通编码,因为他们只需执行手动测试。 |
263. What do you understand about beta testing? What are the different types of beta testing?
你对 beta 测试有何理解?beta 测试有哪些不同类型?
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4458d557c902bc6ec0 | 官方: 否 | 付费: 否
答案:
Genuine users of the software application undertake beta testing in a real environment. One type of User Acceptance Testing is beta testing. A small number of end-users of the product are given a beta version of the program in order to receive input on the product quality. Beta testing reduces the chances of a product failing and improves the product's quality by allowing customers to validate it.
软件应用的真实用户在真实环境中进行 beta 测试。beta 测试是用户验收测试的一种类型。产品的少量最终用户会获得程序的 beta 版本,以收集关于产品质量的反馈。beta 测试通过让客户验证产品,降低了产品失败的风险并提高了产品质量。
Following are the different types of beta testing : - Traditional Beta testing: Traditional Beta testing is distributing the product to the target market and collecting all relevant data. This information can be used to improve the product.
以下是 beta 测试的不同类型: - 传统 Beta 测试:传统 Beta 测试是将产品分发给目标市场并收集所有相关数据。这些信息可用于改进产品。
- Public Beta Testing: The product is made available to the general public via web channels, and data can be gathered from anyone. Product improvements can be made based on customer input. Microsoft, for example, undertook the largest of all Beta Tests for its operating system Windows 8 prior to its official release.
- Technical Beta Testing: A product is delivered to a group of employees of a company and feedback/data is collected from the employees.
- Focused Beta Testing: A software product is distributed to the public for the purpose of gathering input on specific program features. For instance, the software's most important features.
- Post-release Beta Testing: After a software product is launched to the market, data is collected in order to improve the product for future releases.
264. What do you understand about alpha testing? What are its objectives?
你对 alpha 测试有何理解?其目标是什么?
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6ec3 | 官方: 否 | 付费: 否
答案:
Alpha testing is a type of software testing that is used to find issues before a product is released to real users or the general public. One type of user acceptability testing is alpha testing. It is referred to as alpha testing since it is done early in the software development process, near the ending. Homestead software developers or quality assurance staff frequently undertake alpha testing. It's the final level of testing before the software is released into the real world.
Alpha 测试是一种软件测试类型,用于在产品发布给真实用户或公众之前发现问题。Alpha 测试是用户可接受性测试的一种类型。之所以称为 alpha 测试,是因为它在软件开发过程的早期(接近结束时)进行。Homestead 软件开发人员或质量保证人员通常进行 alpha 测试。这是软件发布到现实世界之前的最后测试阶段。
Following are the objectives of alpha testing : - The goal of alpha testing is to improve the software product by identifying flaws that were missed in prior tests.
以下是 alpha 测试的目标: - Alpha 测试的目标是通过识别先前测试中遗漏的缺陷来改进软件产品。
- The goal of alpha testing is to improve the software product by identifying and addressing flaws that were missed during prior tests.
- The goal of alpha testing is to bring customers into the development process as early as possible.
- Alpha testing is used to gain a better understanding of the software's reliability during the early phases of development.
265. What do you understand about severity and priority in the context of software testing? Differentiate between them.
在软件测试的背景下,你对严重性和优先级有何理解?请区分它们。
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6ec7 | 官方: 否 | 付费: 否
答案:
- Severity - Severity in testing refers to how much of an impact it has on the computer program under test. A higher severity rating indicates that the bug/defect has a greater impact on system functionality. The severity level of a bug or defect is usually determined by a Quality Assurance engineer.
- Priority - The order in which a fault should be repaired is referred to as a priority. The higher the priority, the faster the problem should be fixed. Flaws that render the software system unworkable are prioritized over defects that affect only a tiny portion of the software's functionality.
The following table lists the differences between priority and severity -
下表列出了优先级和严重性之间的差异 -
| Priority
优先级 | Severity
严重性 |
| The sequence in which a developer should fix a bug is determined by priority. 开发者修复 bug 的顺序由优先级决定。 | The severity of a defect is defined as the impact it has on the product's operation. 缺陷的严重性定义为其对产品操作的影响程度。 |
| Priority is divided into three categories : 优先级分为三类: |
Low Medium High
低 中 高
The bugs are usually assigned priority labels like P0, P1, P2 and so on, where P0 denotes the bug with the highest priority. | There are five types of severity :
缺陷通常被分配优先级标签,如P0、P1、P2等,其中P0表示优先级最高的缺陷。| 严重性有五种类型:
Critical Major Moderate Minor Cosmetic | | Priority is linked to the scheduling of bugs in order to resolve them. | Severity is linked to the functionality or standards of the application. | | Priority denotes how urgently the fault should be corrected. | Severity denotes the severity of the defect's impact on the product's functionality. | | In consultation with the manager/client, the priority of defects is determined. | The defect's severity level is determined by the QA engineer. | | Its worth is subjective and might fluctuate over time based on the project's circumstances. | Its worth is objective and unlikely to fluctuate. | | When a problem has a high priority and low severity, it means it needs to be corrected right away but isn't affecting the application. | When a fault has a high severity and a low priority, it means it needs to be corrected, but not right now. | | The priority status is determined by the needs of the consumer. | The product's technical aspect determines the severity level. | | During UAT (User Acceptance Testing), the development team prioritizes defects and fixes them. | During SIT (System Integration Testing), the development team will prioritize and resolve bugs based on their severity. |
严重 主要 中等 轻微 外观 | | 优先级与缺陷的解决调度相关联。| 严重性与应用程序的功能或标准相关联。| | 优先级表示缺陷应被纠正的紧迫程度。| 严重性表示缺陷对产品功能影响的严重程度。| | 在咨询经理或客户后,缺陷的优先级被确定。| 缺陷的严重性等级由QA工程师确定。| | 其价值是主观的,并可能根据项目情况随时间波动。| 其价值是客观的,且不太可能波动。| | 当问题优先级高且严重性低时,意味着需要立即纠正但不影响应用程序。| 当缺陷严重性高且优先级低时,意味着需要纠正但现在不需要。| | 优先级状态由消费者需求决定。| 产品的技术方面决定严重性等级。| | 在UAT(用户验收测试)期间,开发团队确定缺陷的优先级并修复它们。| 在SIT(系统集成测试)期间,开发团队将根据严重性确定缺陷的优先级并解决它们。
266. What are the roles and responsibilities of a Software Development Engineer in Test (SDET)?
测试开发工程师(SDET)的角色和职责是什么?
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6eca | 官方: 否 | 付费: 否
答案:
Following are the roles and responsibilities of a Software Development Engineer in Test (SDET) : - SDETs should be able to automate tests and set up frameworks on a variety of platforms, including web, mobile, and desktop.
以下是测试开发工程师(SDET)的角色和职责:- SDET应能在多种平台上实现测试自动化并搭建框架,包括Web、移动和桌面。
- Investigate customer issues that have been referred to you by the technical support staff.
- Create and manage bug reports, as well as interact with the rest of the team.
- Ability to create various test scenarios and acceptability tests.
- SDET is responsible for handling technical discussions with Partners in order to gain a better understanding of the client's systems or APIs.
- SDET also works with deployment teams to resolve any system-level difficulties.
- SDETs should also be able to create, maintain, and run test automation frameworks.
267. What are the do’s and don'ts for a good bug report?
一份好的缺陷报告的注意事项有哪些?
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6ecd | 官方: 否 | 付费: 否
答案:
Following are the do’s for a good bug report : - When you're finished, read your report. Make sure it's clear, concise, and simple to understand.
以下是好缺陷报告应做的事项:- 完成后阅读你的报告。确保内容清晰、简洁且易于理解。
- Don't allow any opportunity for ambiguity by being as clear as possible.
- Do test the problem a few times to see if there are any superfluous procedures.
- Include any workarounds or additional procedures you've discovered that cause the problem to behave differently in your report.
- Check to see if the bug has previously been reported. If it has, please leave a comment on the bug with your information.
Do reply to requests for further information from developers.
Following are the don’ts for a good bug report : - DO NOT submit a report that contains more than one bug. When there are numerous bugs in the report, keeping track of their progress and dependencies becomes difficult.以下是好缺陷报告不应做的事情:- 不要提交包含多个缺陷的报告。当报告中有多个缺陷时,跟踪其进度和依赖关系变得困难。
- DO NOT be judgmental or accusatory. Bugs are unavoidable, yet they aren't always simple to fix.
- DO NOT try to figure out what's causing the bug. Stick to the facts to avoid sending the developer on a wild goose hunt.
- Anything that isn't a bug should be posted. Developers appreciate hearing from you, but sending information to the wrong channel will just block their workflow and cause delays.
268. What are the elements of a bug report?
缺陷报告的要素有哪些?
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6ed0 | 官方: 否 | 付费: 否
答案:
Following are the elements of a bug report : - TITLE - A good title is simple, concise, and provides a description of the bug to the developer. It should include the bug's categorization, the app component where the bug happened (e.g. Cart, UI, etc. ), and the activity or conditions in which the bug occurred. A clear title makes it easier for the developer to find the report and distinguishes duplicate reports, making problem triaging much easier.
以下是缺陷报告的要素:- 标题 - 好的标题简单、简洁,并向开发者提供缺陷的描述。它应包括缺陷的分类、发生缺陷的应用程序组件(例如,购物车、UI等),以及缺陷发生的活动或条件。清晰的标题使开发者更容易找到报告,并区分重复报告,使问题分类更容易。
SEVERITY AND PRIORITY - The severity of an issue is determined by its severity. The severity levels and definitions vary amongst programme developers, and even more so between developers, testers, and end-users who are unaware of these distinctions. The standard categorization is as follows:
Critical/Blocker: This category is reserved for faults that render the application useless or result in significant data loss.严重/阻止:此类别保留给导致应用程序无法使用或导致显著数据丢失的故障。
High: When a bug affects a major feature and there is no workaround or the remedy that is provided is extremely complicated.
高:当缺陷影响主要功能且没有解决方法或提供的解决方法极其复杂时。
Medium: The bug affects a minor or significant feature, but there is a simple enough fix to avoid major discomfort.
中等:缺陷影响次要或主要功能,但有足够简单的修复方法以避免重大不适。
Low: This is for defects that have a modest impact on the user experience, such as minor visual bugs. - DESCRIPTION -This is a concise summary of the bug, including how and when it occurred. This section should contain additional information than the title, such as the frequency with which the bug happens if it is an intermittent error and the situations that appear to trigger it. It contains information about how the bug is impacting the application.
低:此类别用于对用户体验影响较小的缺陷,例如轻微视觉缺陷。- 描述 -这是缺陷的简明摘要,包括发生方式和时间。此部分应包含比标题更多的信息,例如缺陷发生的频率(如果是间歇性错误)以及似乎触发它的条件。它包含缺陷如何影响应用程序的信息。
- ENVIRONMENT - Apps can behave in a variety of ways depending on their surroundings. This section should contain all of the information about the app's environment setup and settings.
- REPRO STEPS - This should include the bare essentials for reproducing the bug. The steps should ideally be short, easy, and accessible to anybody. The goal is for the developer to be able to reproduce the error on their end in order to figure out what's wrong. A bug report without repro steps is useless and wastes time and effort that could be better spent resolving more complete reports; make sure to convey this to your testers and in a way that your end-users understand.
- ACTUAL RESULT - This is what the tester or user saw as a result or output.
- EXPECTED RESULT - This is the anticipated or planned consequence or output.
- ATTACHMENTS - Attachments can assist the developer find the problem faster; a screenshot of the problem can explain a lot, especially when the problem is visual. Logs and other incredibly useful attachments can at the very least put the developer in the proper direction.
- CONTACT DETAILS - If any additional information regarding the issue is required, an e-mail address where you may contact the user who submitted the bug should be provided. Getting the user to react to emails might be difficult, so you should consider giving alternative communication routes that are less of a hassle for the user to enhance efficiency.
269. What is a bug report in the context of software testing?
在软件测试背景下,什么是缺陷报告?
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6ed3 | 官方: 否 | 付费: 否
答案:
A bug report is a detailed report which explains what is incorrect and needs to be fixed in software or on a website. The report includes a request and/or details for how to address each issue, as well as a list of causes or noticed faults to point out exactly what is perceived as wrong. Bug reports are a technique to inform developers about parts of their code that aren't behaving as expected or designed, allowing them to see which parts of their software need to be improved. This can be a difficult effort for the developer, and without enough information, it is nearly impossible. Fortunately, testers may make this process considerably easier by producing high-quality bug reports that include all of the information a developer might need to locate the problem.
缺陷报告是一份详细的报告,说明软件或网站上哪些内容不正确且需要修复。报告包括针对每个问题如何处理的方法和/或细节,以及原因或注意到的故障列表,以准确指出被认为是错误的地方。缺陷报告是一种向开发者传达其代码中不符合预期或设计部分的技术手段,使他们能够看到软件中需要改进的部分。这对开发者来说可能是一项困难的工作,没有足够的信息几乎不可能完成。幸运的是,测试人员可以通过生成包含开发人员可能需要的所有信息的高质量缺陷报告,使这一过程变得容易得多。
270. What do you understand about code inspection in the context of software testing? What are its advantages?
在软件测试背景下,你如何理解代码审查?它有哪些优势?
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6ed7 | 官方: 否 | 付费: 否
答案:
Code inspection is a sort of static testing that involves inspecting software code and looking for flaws. It simplifies the initial error detection procedure, lowering the defect multiplication ratio and avoiding subsequent stage error detection. This code inspection is actually part of the application evaluation procedure.
代码检查是一种静态测试,涉及检查软件代码并寻找缺陷。它简化了初始错误检测过程,降低了缺陷倍增率,并避免了后续阶段的错误检测。此代码检查实际上是应用程序评估过程的一部分。
Following are the key steps involved in code inspection : - An Inspection team's primary members are the Moderator, Reader, Recorder, and Author.
以下是代码检查涉及的主要步骤: - 检查团队的主要成员是主持人、读者、记录员和作者。
- The inspection team receives related documents, prepares the inspection meeting, and coordinates with the inspection team members.
- If the inspection team is unfamiliar with the project, the author gives them an overview of the project and its code.
- Following that, each inspection team conducts a code inspection using inspection checklists.
Conduct a meeting with all team members after the code inspection is completed to discuss the code that was inspected.
Following are the advantages of Code Inspection : - Code Inspection enhances the overall quality of the product.以下是代码检查的优点: - 代码检查提高了产品的整体质量。
- It finds bugs and flaws in software code.
- In any event, it marks any process improvement.
- It finds and removes functional defects in a timely and effective manner.
- It aids in the correction of prior flaws.
271. What do you understand about ad-hoc testing?
你对临时测试有什么理解?
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6ee9 | 官方: 否 | 付费: 否
答案:
Ad hoc testing is a type of unstructured or informal software testing that seeks to interrupt the testing process in order to uncover potential defects or errors as soon as feasible. Ad hoc testing is a type of testing that is done at random and is usually an unplanned activity that does not use any documentation or test design methodologies to construct test cases.
临时测试是一种非结构化或非正式的软件测试类型,旨在中断测试过程,以便尽快发现潜在缺陷或错误。临时测试是一种随机进行的测试,通常是非计划活动,不使用任何文档或测试设计方法来构建测试用例。
Ad-hoc testing is done on any portion of the application at random and does not follow any standardized testing procedures. The primary goal of this testing is to detect problems through random inspection. Error Guessing, a software testing approach, can be used to perform ad hoc testing. People with adequate familiarity with the system can "predict" the most likely source of errors, which is known as error guessing. This testing does not necessitate any paperwork, planning, or procedure. Because this testing seeks to detect faults through a random technique, defects will not be mapped to test cases if there is no documentation. This means that reproducing errors can be difficult at times because there are no test processes or requirements associated with them.
临时测试在应用程序的任何部分随机执行,不遵循任何标准化测试程序。此测试的主要目标是通过随机检查检测问题。错误猜测(一种软件测试方法)可用于执行临时测试。对系统有足够了解的人员可以“预测”最可能的错误来源,这被称为错误猜测。此测试不需要任何文档、规划或程序。由于此测试通过随机技术检测缺陷,如果没有文档,缺陷将不会映射到测试用例。这意味着由于没有相关的测试流程或要求,重现错误有时可能很困难。
272. What is Selenium?
什么是 Selenium?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc6ff6 | 官方: 否 | 付费: 否
答案:
Selenium is an open-source (free) automated testing framework for validating web applications across multiple browsers and platforms. Selenium Test Scripts can be written in a variety of programming languages, including Java, C#, Python, and others. Selenium Testing is the term for testing done using the Selenium testing tool.
Selenium 是一个开源(免费)自动化测试框架,用于跨多个浏览器和平台验证 Web 应用程序。Selenium 测试脚本可以用多种编程语言编写,包括 Java、C#、Python 等。使用 Selenium 测试工具进行的测试称为 Selenium 测试。
Selenium Software is a collection of tools, each of which caters to a specific organization's Selenium QA testing requirements. The following is a list of tools incorporated within Selenium: - Selenium Integrated Development Environment (IDE).
Selenium 软件是一组工具,每个工具满足特定组织的 Selenium QA 测试需求。以下是 Selenium 中包含的工具列表: - Selenium 集成开发环境(IDE)。
- Selenium Remote Control (RC).
- Selenium WebDriver.
Selenium Grid.
Learn Selenium with this Complete Roadmap.通过此完整路线图学习 Selenium。
273. What are the Selenium suite components?
Selenium 套件的组件有哪些?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc6ff9 | 官方: 否 | 付费: 否
答案:
Selenium is a package of several testing tools. It is therefore often referred to as a Selenium Suite with each of these tools designed to cater to a different testing requirement.
Selenium 是多个测试工具的集合。因此,它通常被称为 Selenium 套件,其中每个工具都旨在满足不同的测试需求。
The following are the different components of Selenium Suite :
以下是 Selenium 套件的不同组件:
- Selenium Integrated Development Environment (IDE): It is a Firefox/Chrome plug-in that is developed to speed up the creation of automation scripts by recording the user actions on the web browser and exporting them as a reusable script.
- Selenium Remote Control (RC): It is a server that enables users to generate test scripts in their preferred programming language. It accepts commands from the test scripts and sends them to the browser as Selenium core JavaScript commands, for the browser to behave accordingly.
- Selenium WebDriver: It is a programming interface that helps create and run test cases by directly communicating with the web browser and using its native compatibility to automate. Unlike RC, it doesn’t require an additional server to create and run test cases.
- Selenium Grid: It allows parallel execution of tests on different browsers and operating systems by distributing commands to other machines simultaneously.
274. What are the advantages of using Selenium as an automation tool?
使用 Selenium 作为自动化工具的优点是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc6ffc | 官方: 否 | 付费: 否
答案:
The following are the advantages of using Selenium for automated testing : - Open-Source: Selenium's greatest strength, as previously said, is that it is a freeware and portable tool. There are no out-of-pocket expenses. The utility can be downloaded for free, and community-based help is also accessible.
以下是使用 Selenium 进行自动化测试的优点: - 开源:如前所述,Selenium 最大的优势在于它是一个免费且便携的工具。没有自付费用。该工具可以免费下载,并且还提供基于社区的支持。
- Language assistance: Java, Perl, Python, C#, Ruby, Groovy, JavaScript, and other languages are supported by Selenium. It has its own script, yet it is not constrained by it. It can work with a variety of languages, depending on the developers' and testers' preferences.
- Compatible with a variety of operating systems: Selenium may run on a variety of operating systems, including Windows, Mac OS X, Linux, and UNIX. A customized testing suite can be constructed on any platform and then executed on another using the Selenium suite of products. For example, you may write test cases in Windows and run them on a Linux system with ease.
- Browser compatibility: Selenium is compatible with a variety of web browsers, including Internet Explorer, Chrome, Firefox, Opera, and Safari. When running tests and testing them across multiple browsers at the same time, this becomes really useful.
- Programming languages and framework support: Selenium works with a variety of programming languages and frameworks. For source code compilation, it can, for example, integrate with ANT or Maven frameworks. It may also be used to test apps and generate reports using the TestNG framework. Continuous Integration (CI), can integrate with Jenkins or Hudson, and it can also integrate with other open-source tools to offer other functionalities.
- Tests on a variety of devices: On Android, iPhone, and Blackberry, Selenium Test Automation can be used to automate mobile web application testing. This can aid in the generation of necessary results and the ongoing resolution of bugs present in the application.
- Regular updates: Selenium support is based on a community, which allows for frequent updates and upgrades. These upgrades are simple to install and don't require any special training. Selenium is thus both resourceful and cost-effective.
- Selenium suites with a lot of content: Selenium is more than just a single tool or utility; it's a full set of numerous testing tools that's why it's called a Suite. Each tool is tailored to specific testing needs and test environment constraints. Selenium also includes features such as Selenium IDE, Selenium Grid, and Selenium Remote Control (RC).
- Ease with which it can be implemented: Selenium has a user-friendly interface that makes it simple to develop and perform tests. Its open-source capabilities allow users to script their own extensions, making them simple to create, alter actions, and manipulate at a high level. Selenium's reporting features are also one of the reasons for its popularity, as it allows testers to extract results and take action based on them.
275. What are the disadvantages of using Selenium as a testing tool?
使用 Selenium 作为测试工具的缺点是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc6fff | 官方: 否 | 付费: 否
答案:
The following are the disadvantages of using Selenium as a testing tool: - Tests web applications only: Selenium supports the testing of only web-based applications. Mobile applications, Captcha, and Barcode readers cannot be tested using Selenium unless integrated with third-party tools like Appium and TestNG.
以下是使用 Selenium 作为测试工具的缺点:- 仅测试 Web 应用程序:Selenium 只支持测试基于 Web 的应用程序。移动应用程序、验证码和条形码阅读器无法使用 Selenium 进行测试,除非与 Appium 和 TestNG 等第三方工具集成。
- No built-in reporting and test management facility: Selenium can generate reports only using third-party tools like TestNG or JUnit.
- Unavailability of reliable tech support: Since Selenium is an open-source tool, no dedicated support for user issues is available.
- May require the knowledge of programming languages: Some prior programming knowledge is required to use Selenium.
276. What is automation testing, and what are its advantages?
什么是自动化测试,它有哪些优势?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7002 | 官方: 否 | 付费: 否
答案:
Automation Testing or Test Automation is a process of automating the manual testing process of an application or a system by using testing tools that allow you to create scripts that can be executed repeatedly, generating detailed test reports of the application or system under test.
自动化测试或测试自动化是使用测试工具来自动化应用程序或系统的手动测试过程,这些工具允许您创建可重复执行的脚本,并生成被测应用程序或系统的详细测试报告。
The advantages of Automated Testing are: - It supports both the performance and functional testing of an application or system.
自动化测试的优势包括:- 它支持应用程序或系统的性能和功能测试。
- It facilitates the execution of repeated test cases.
- It allows the parallel execution of the test cases.
- It improves the accuracy and efficiency of the system by reducing the manual intervention of humans to generate test cases.
- It helps in testing a large-scale test matrix.
- It saves valuable time and money for the testing team involved in the project.
- Data Science
- All Events
- My Events
277. Why should Selenium be selected as a testing tool for web applications or systems?
为什么选择 Selenium 作为 Web 应用程序或系统的测试工具?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7005 | 官方: 否 | 付费: 否
答案:
Selenium provides the following advantages, which make it an excellent automated testing framework: - It is free and open-source software with a large user base and supports providing community.
Selenium 提供以下优势,使其成为优秀的自动化测试框架:- 它是免费且开源的软件,拥有庞大的用户群,并支持社区支持。
- It has cross-browser compatibility and supports multiple browsers like Google Chrome, Mozilla Firefox, Internet Explorer, Edge, Opera, Safari, etc.
- It supports multiple operating systems such as Windows, Linux, macOS, etc.
- It facilitates the usage of multiple programming languages including Scala, Ruby, Python, PHP, Perl, Java, Groovy, C#, etc.
- It provides support for distributed testing as well.
278. What is Selenese? Explain different types of Selenium commands.
什么是 Selenese?解释不同类型的 Selenium 命令。
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7008 | 官方: 否 | 付费: 否
答案:
The language used for writing test scripts in Selenium IDE is called Selenese. It is a set of commands used to test your web application or system. Selenium commands could be divided into 3 major categories: - Actions: These are the commands interacting directly with web applications.
用于在 Selenium IDE 中编写测试脚本的语言称为 Selenese。它是一组用于测试您的 Web 应用程序或系统的命令。Selenium 命令可分为三大类:- 动作:这些命令直接与 Web 应用程序交互。
- Accessors: These are the commands which allow users to store values in a user-defined variable.
- Assertions: They enable a comparison of the current state of the application with its expected state.
279. What is meant by a locator and name a few different types of locators present in Selenium.
什么是定位器,并列举 Selenium 中存在的几种不同类型的定位器?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc700b | 官方: 否 | 付费: 否
答案:
A locator is an address for uniquely identifying web elements within a web page. There are different types of locators present in Selenium to identify web elements uniquely and accurately like: - ID
定位器是用于在网页中唯一定位 Web 元素的地址。Selenium 中存在不同类型的定位器,可以唯一且准确地识别 Web 元素,例如:- ID
- ClassName
- Name
- TagName
- LinkText
- PartialLinkText
- Xpath
- CSS Selector
- DOM.
280. What is exception test in Selenium?
Selenium 中的异常测试是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc700e | 官方: 否 | 付费: 否
答案:
An exception test is a test that expects an exception to be thrown inside a test class. It expects a @Test annotation followed by the expected exception name in the brackets.
异常测试是一种预期在测试类中抛出异常的测试。它需要一个 @Test 注解,后跟括号中的预期异常名称。
Eg: @Test(expectedException = NoSuchElementException.class) is an exception test for missing elements in Selenium.
例如:@Test(expectedException = NoSuchElementException.class) 是 Selenium 中针对缺失元素的异常测试。
281. What is XPath in Selenium? Explain XPath Absolute and XPath Relative.
Selenium 中的 XPath 是什么?解释 XPath 绝对路径和 XPath 相对路径。
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7011 | 官方: 否 | 付费: 否
答案:
XPath, also defined as XML-Path (Extensible Markup Language Path), is a language used to query XML documents and provide functionalities like locating elements in Selenium by iterating through each element in a webpage. In XPath, data is stored in a key-value pair format similar to an HTML tag. It uses a single slash, i.e. ‘ / ’ for creating an absolute path, and a double slash, i.e. ‘ // ’ for creating a relative path for an element to be located on a webpage.
XPath,也称为 XML 路径(可扩展标记语言路径),是一种用于查询 XML 文档的语言,并提供诸如在 Selenium 中通过遍历网页中的每个元素来定位元素的功能。在 XPath 中,数据以键值对格式存储,类似于 HTML 标签。它使用单斜杠,即 “ / ” 来创建绝对路径,使用双斜杠,即 “ // ” 来创建网页上要定位元素的相对路径。
282. In Xpath, what is the difference between "/" and "//"?
在 XPath 中,“ / ” 和 “ // ” 有什么区别?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7014 | 官方: 否 | 付费: 否
答案:
- Single Slash "/" - A single slash is used to create an Xpath with an absolute path, i.e., the XPath will begin with the document node/start node. For example,
Absolute XPath: /html/body/div/div/form/input
绝对 XPath:/html/body/div/div/form/input
Here, /html is the root html node. - Double Slash "//" - The double slash is used to construct an Xpath with a relative path, which means the XPath can start selection from anywhere on the page. For example,
这里,/html 是根 html 节点。- 双斜杠 "//" - 双斜杠用于构造具有相对路径的 XPath,这意味着 XPath 可以从页面上的任何位置开始选择。例如,
Relative XPath: //input[@id = 'email']
相对 XPath://input[@id = 'email']
Here, we can locate an input having id = ‘email’ present anywhere in the document object model (DOM).
这里,我们可以定位文档对象模型(DOM)中任意位置存在的具有 id = ‘email’ 的输入框。
283. What is the difference between the commands "type" and "typeAndWait" in the context of Selenium?
在 Selenium 的上下文中,命令 "type" 和 "typeAndWait" 有什么区别?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7017 | 官方: 否 | 付费: 否
答案:
The "type" command is used to enter keyboard key values into a software web application's text box. It can also be used to choose values from a combo box, whereas the "typeAndWait" command is used when you finish typing and the software web page begins to reload. This command will wait for the page of the software program to reload before proceeding. You must use a basic "type" command if there is no page reload event when typing.
"type" 命令用于向软件 Web 应用程序的文本框输入键盘键值。它也可以用于从组合框中选择值,而 "typeAndWait" 命令在您完成输入且软件网页开始重新加载时使用。该命令将等待软件程序的页面重新加载后才继续。如果在输入时没有页面重新加载事件,则必须使用基本的 "type" 命令。
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万+职业规划
284. Differentiate between findElement() and findElements() in the context of Selenium with proper examples.
在 Selenium 的上下文中,通过适当的示例区分 findElement() 和 findElements()。
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc701a | 官方: 否 | 付费: 否
答案:
Following table lists the differences between findElement() and findElements() in Selenium:
下表列出了 Selenium 中 findElement() 和 findElements() 之间的区别:
| findElement() | findElements() |
|---|---|
| The first web element that matches the locator is returned. 返回匹配定位器的第一个 Web 元素。 | It gives you a list of all the web items that match the locator. 返回匹配定位器的所有 Web 元素的列表。 |
| If there are no matching web elements, a NoSuchElementException is produced. 如果没有匹配的 Web 元素,则产生 NoSuchElementException。 | If there are no matching elements, an empty list is returned. 如果没有匹配的元素,则返回一个空列表。 |
| Syntax − WebElement button = webdriver.findElement(By.name(">")); 语法 − WebElement button = webdriver.findElement(By.name(">")); | Syntax − List buttons = webdriver.findElements(By.name(">")); 语法 − List buttons = webdriver.findElements(By.name(">")); |
| - Using findElements():- - 使用 findElements():- |
// JAVA
// JAVA
import org.openqa.selenium.By;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.Keys;
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 java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeUnit;
public class findElements {
public class findElements {
public static void main(String[] args) {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\Users\vaibhav\Desktop\Java\chromedriver.exe");
System.setProperty("webdriver.chrome.driver", "C:\Users\vaibhav\Desktop\Java\chromedriver.exe");
WebDriver driver = new ChromeDriver();
WebDriver driver = new ChromeDriver();
String url = "https://www.exampleurl.com/example.htm";
String url = "https://www.exampleurl.com/example.htm";
driver.get(url);
driver.get(url);
driver.manage().window().maximize();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
List
Listrows = driver.findElements(By.xpath("//table/tbody/tr[2]/td")); // 使用带有索引的XPath通过findElements()获取表格第二行的值,该方法返回一个列表
System.out.println("The number of values in row 2 is "+ rows.size());
System.out.println("第二行的值数量为 " + rows.size());
driver.close();
driver.close();
}
}
Explanation - In the above code, first of all, we import all the necessary headers and then set up the driver for the chrome browser. We use the findElements() method to find all the values present in the 2nd row of a table in the given URL web page using the XPath of the element. - Using findElement() :-
解释 - 在上述代码中,首先我们导入所有必要的头文件,然后为Chrome浏览器设置驱动程序。我们使用findElements()方法,通过元素的XPath来查找给定URL网页中表格第二行的所有值。- 使用findElement() :-
import org.openqa.selenium.By;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.Keys;
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 java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeUnit;
public class findTagname {
公共类 findTagname {
public static void main(String[] args) {
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\Users\vaibhav\Desktop\Java\chromedriver.exe");
System.setProperty("webdriver.chrome.driver", "C:\Users\vaibhav\Desktop\Java\chromedriver.exe");
WebDriver driver = new ChromeDriver();
WebDriver driver = new ChromeDriver();
String url = "https://www.exampleurl.com/example.htm";
String url = "https://www.exampleurl.com/example.htm";
driver.get(url);
driver.get(url);
driver.manage().timeouts().implicitlyWait(12, TimeUnit.SECONDS);
驱动程序.manage().timeouts().implicitlyWait(12, TimeUnit.SECONDS);
driver.findElement(By.cssSelector("input[id='search']")).sendKeys("Selenium"); //Using id tagname attribute combination for css expression and get the element from findElement()
驱动程序.findElement(By.cssSelector("input[id='search']")).sendKeys("Selenium"); //使用id标记名称组合的css表达式,并通过findElement()获取元素
driver.close();
driver.close();
}
}
Explanation - In the above code, first of all, we import all the necessary headers and then set up the driver for the chrome browser. We use the findElement() method to find an input element having an id attribute set as search.
解释 - 在上述代码中,首先,我们导入所有必要的头文件,然后为Chrome浏览器设置驱动程序。我们使用findElement()方法查找一个id属性设置为search的输入元素。
285. In Selenium, how will you wait until a web page has been loaded completely?
在Selenium中,如何等待网页完全加载完成?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc701d | 官方: 否 | 付费: 否
答案:
There are two methods of making sure that the web page has been loaded completely in Selenium.
在Selenium中,有两种方法可以确保网页完全加载完成。
They are as follows:
它们如下:
- Immediately after creating the webdriver instance, set an implicit wait:
temp = driver.Manage().Timeouts().ImplicitWait;
temp = driver.Manage().Timeouts().ImplicitWait;
On every page navigation or reload, this will try to wait until the page is fully loaded.
在每次页面导航或重新加载时,这将尝试等待直到页面完全加载。
- Call JavaScript return document.readyState till "complete" is returned after page navigation. As a JavaScript executor, the web driver instance can be used.
Code example:
代码示例:
new WebDriverWait(firefoxDriver, pageLoadTimeout).until(
new WebDriverWait(firefoxDriver, pageLoadTimeout).until(
webDriver -> ((JavascriptExecutor) webDriver).executeScript("return document.readyState").equals("complete"));
webDriver -> ((JavascriptExecutor) webDriver).executeScript("return document.readyState").equals("complete"));
286. What is Selenium WebDriver?
什么是 Selenium WebDriver?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7020 | 官方: 否 | 付费: 否
答案:
Selenium WebDriver, also known as Selenium 2, is a browser automation framework that accepts and sends commands to a browser to implement it. It has direct control over the browser because it communicates with it directly. Java, C#, PHP, Python, Perl, and Ruby are all supported by Selenium WebDriver.
Selenium WebDriver,也称为 Selenium 2,是一个浏览器自动化框架,它接受并向浏览器发送命令以实现自动化。由于它与浏览器直接通信,因此能够直接控制浏览器。Selenium WebDriver 支持 Java、C#、PHP、Python、Perl 和 Ruby。
287. Is Selenium WebDriver a library?
Selenium WebDriver 是一个库吗?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7023 | 官方: 否 | 付费: 否
答案:
Selenium WebDriver is a prominent free open-source library for automating browsers and testing web applications.
Selenium WebDriver 是一个著名的免费开源库,用于自动化浏览器和测试 Web 应用程序。
288. Is Selenium WebDriver an interface or a class?
Selenium WebDriver 是接口还是类?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7028 | 官方: 否 | 付费: 否
答案:
Selenium WebDriver is usually a set of methods defined by an interface. The browser-specific classes, on the other hand, provide an implementation of it by extending a class. AndroidDriver, ChromeDriver, FirefoxDriver, InternetExplorerDriver, SafariDriver, and others are some of the implementation classes.
Selenium WebDriver 通常是一个由接口定义的方法集合。另一方面,浏览器特定的类通过扩展类来提供其实现。一些实现类包括 AndroidDriver、ChromeDriver、FirefoxDriver、InternetExplorerDriver、SafariDriver 等。
289. What are the different types of WebDriver Application Programming Interfaces in Selenium?
Selenium 中有哪些不同类型的 WebDriver 应用程序编程接口?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37c4658d557c902bc702b | 官方: 否 | 付费: 否
答案:
The Various Types of WebDriver APIs in Selenium are as follows: - Opera Driver
Selenium 中各种类型的 WebDriver API 如下:- Opera 驱动程序
- InternetExplorer Driver
- Chrome Driver
- Safari Driver
- Android Driver
- Firefox Driver
- Gecko Driver
- iPhone Driver
- EventFiringWebDriver
- HTMLUnit Driver.
290. What programming languages does Selenium WebDiver support?
Selenium WebDriver 支持哪些编程语言?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37c4658d557c902bc702e | 官方: 否 | 付费: 否
答案:
The various programming languages that Selenium WebDriver supports are as follows: - Java
Selenium WebDriver 支持的各种编程语言如下:- Java
- C#
- Python
- Ruby
- Perl
- PHP
291. What open-source frameworks does Selenium WebDriver support?
Selenium WebDriver 支持哪些开源框架?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7031 | 官方: 否 | 付费: 否
答案:
The following are the open-source frameworks supported by the Selenium WebDriver: - TestNG:
Selenium WebDriver 支持的开放源码框架如下:- TestNG:
Cédric Beust designed TestNG, a testing framework for the Java programming language that was influenced by JUnit and NUnit. TestNG was created with the purpose of covering a wider range of test categories, including unit, functional, end-to-end, integration, and so on, with more robust and user-friendly functions. - JUnit:It is used for Unit Testing of various types of applications.
Cédric Beust 设计了 TestNG,这是一个受 JUnit 和 NUnit 影响的 Java 编程语言测试框架。TestNG 旨在覆盖更广泛的测试类别,包括单元测试、功能测试、端到端测试、集成测试等,并提供更强大且用户友好的功能。- JUnit:它用于各种类型应用程序的单元测试。
292. What is WebDriver's super interface?
WebDriver 的超级接口是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7034 | 官方: 否 | 付费: 否
答案:
SearchContext is the Super Interface of the WebDriver.
SearchContext 是 WebDriver 的超级接口。
293. Explain the following line of code.
解释下面这行代码。
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7037 | 官方: 否 | 付费: 否
答案:
Webdriver driver = new FirefoxDriver();
Webdriver driver = new FirefoxDriver();
'WebDriver' is an interface, and we are generating a WebDriver object by instantiating a FirefoxDriver object (This object uses Firefox Driver to link the test cases with the Firefox browser).
'WebDriver' 是一个接口,我们通过实例化一个 FirefoxDriver 对象来生成一个 WebDriver 对象(该对象使用 Firefox 驱动器将测试用例与 Firefox 浏览器连接起来)。
294. Is it necessary to use Selenium Server to run Selenium WebDriver scripts?
运行 Selenium WebDriver 脚本时,是否必须使用 Selenium Server?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc703a | 官方: 否 | 付费: 否
答案:
Selenium Server is required when distributing Selenium WebDriver scripts for execution with Selenium Grid. Selenium Grid is a Selenium functionality that allows you to execute test cases on multiple machines on various platforms. You wish to execute your test cases on a remote machine because your local machine is running numerous applications. You will need to set up the remote server so that the test cases can run on it.
当使用 Selenium Grid 分发 Selenium WebDriver 脚本执行时,需要 Selenium Server。Selenium Grid 是 Selenium 的一项功能,允许你在不同平台的多台机器上执行测试用例。你希望在远程机器上执行测试用例,因为你的本地机器正在运行许多应用程序。你需要设置远程服务器,以便测试用例可以在其上运行。
295. What will happen if I execute this command? driver.get(“www.interviewbit.com”) ;
如果我执行这条命令会发生什么?driver.get(“www.interviewbit.com”) ;
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc703d | 官方: 否 | 付费: 否
答案:
An exception is triggered if the URL does not begin with http or https. As a result, the HTTP protocol must be sent to the driver.get() method.
如果 URL 不以 http 或 https 开头,则会触发异常。因此,必须将 HTTP 协议传递给 driver.get() 方法。
296. What is an alternative option to driver.get() method to open an URL in Selenium Web Driver?
在 Selenium WebDriver 中,driver.get() 方法打开 URL 的替代选项是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7040 | 官方: 否 | 付费: 否
答案:
driver.navigate() can be used instead. It is used for navigating forwards and backwards in a browser.
可以使用 driver.navigate() 代替。它用于在浏览器中向前和向后导航。
297. What is the difference between driver.get() and driver.navigate.to(“url”)?
driver.get() 和 driver.navigate.to(“url”) 之间的区别是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7043 | 官方: 否 | 付费: 否
答案:
The difference between the two is as follows: - driver.get(): To open a URL and have it wait for the entire page to load.
两者之间的区别如下:- driver.get():用于打开 URL,并等待整个页面加载完成。
- driver.navigate.to(): To navigate to a URL without having to wait for the entire page to load.
298. What are the differences between the methods driver.close() and driver.quit()?
方法 driver.close() 和 driver.quit() 之间的区别是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7046 | 官方: 否 | 付费: 否
答案:
The functions of these two methods ( driver.close and driver.quit ) are nearly identical. Although both allow us to close a browser, there is a distinction. - To close the current WebDriver instance, use driver.close().
这两种方法(driver.close 和 driver.quit)的功能几乎相同。尽管两者都允许我们关闭浏览器,但有区别。- 使用 driver.close() 关闭当前 WebDriver 实例。
- To close all open WebDriver instances, use driver.quit().
299. What are some cases that Selenium WebDriver cannot automate?
Selenium WebDriver 无法自动化的案例有哪些?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc7049 | 官方: 否 | 付费: 否
答案:
Some of the scenarios which we cannot automate are as follows: - Selenium WebDriver does not support bitmap comparison.
我们无法自动化的场景如下:- Selenium WebDriver 不支持位图比较。
- Using Selenium WebDriver to automate Captcha is not possible.
- Using Selenium WebDriver, we are unable to read bar codes.
- Video streaming scenarios: Selenium will almost never be able to recognise video controllers. To some extent, JavaScript Executor and flex UI selenium will work, although they are not completely dependable.
- Performance testing can be automated, however, it's preferable to avoid using Selenium for performance testing.
300. In Selenium WebDriver, what is an Object Repository?
在 Selenium WebDriver 中,什么是对象仓库?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c4658d557c902bc704c | 官方: 否 | 付费: 否
答案:
Instead of hard-coding element locator data in the scripts, the Object Repository is used to store the element locator data in a centralized location. To store all of the element locators, we create a property file (.properties), which acts as an object repository in Selenium WebDriver.
在脚本中不硬编码元素定位器数据,而是使用对象仓库将元素定位器数据集中存储。为了存储所有元素定位器,我们创建一个属性文件(.properties),它在Selenium WebDriver中充当对象仓库。
301. What do you understand about web services? State some of the communication channels which are available for a web service.
你对Web服务有什么理解?请说明一些可用于Web服务的通信渠道。
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc771c | 官方: 否 | 付费: 否
答案:
Web services are web components that allow clients and servers to exchange data. The client submits a web request to the server, which is subsequently responded to by the server. The response and the request are linked, and different requests elicit different responses. A web component or software program that can be accessed through the Internet is known as a web service. Through XML communications ideas, it is mostly used to communicate with web-based applications. For example, if we wish to utilize Google Maps to find a specific location, we can use the relevant web service's URL. To do so, we must provide the necessary inputs.
Web服务是允许客户端和服务器交换数据的Web组件。客户端向服务器提交Web请求,随后由服务器响应。响应和请求是关联的,不同的请求会产生不同的响应。可以通过互联网访问的Web组件或软件程序被称为Web服务。通过XML通信理念,它主要用于与基于Web的应用程序进行通信。例如,如果我们想使用Google Maps查找特定位置,我们可以使用相关Web服务的URL。为此,我们必须提供必要的输入。
In general, web services are used in conjunction with the protocols listed below: - HTTP / POST: The HTTP / POST protocol is used to securely send data between clients.
一般来说,Web服务与以下列出的协议结合使用:- HTTP / POST:HTTP / POST协议用于在客户端之间安全地发送数据。
- HTTP / GET: Clients can display sent data partially in the browser's address bar using the HTTP / GET protocol.
SOAP: SOAP is a protocol for securely transmitting private data.
These channels will be utilised to communicate with customers when exposing web services.在暴露Web服务时,这些渠道将用于与客户进行通信。
302. What do you understand about WSDL?
你对WSDL有什么理解?
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc771f | 官方: 否 | 付费: 否
答案:
WSDL: WSDL is an acronym for Web Services Description Language . It is connected to SOAP. It defines how the Web service works so that you may refer to it when you make a reference to it. The Web Services Description Language (WSDL) is an XML-based interface description language for specifying a web service's capabilities. Any specific WSDL description of a web service (also referred to as a WSDL file) that offers a machine-readable explanation of how the service can be called, what parameters it expects, and what data structures it returns is also referred to by the acronym. As a result, it serves a similar purpose to a type signature in a programming language.
WSDL:WSDL是Web服务描述语言的缩写。它与SOAP相关联。它定义了Web服务的工作方式,以便在引用时可以查阅。Web服务描述语言(WSDL)是一种基于XML的接口描述语言,用于指定Web服务的功能。任何特定Web服务的WSDL描述(也称为WSDL文件)提供了服务如何调用、期望哪些参数以及返回哪些数据结构的机器可读解释,该缩略词也指代此描述。因此,它类似于编程语言中的类型签名。
Services are described in the WSDL as groups of network endpoints or ports. For this reason, the WSDL definition specifies an XML format for documents. The abstract definitions of ports and messages are abstracted from their real application or instance, allowing them to be reused. A service is defined by associating a network address with a reusable binding, and a group of ports is formed by associating a network address with a reusable binding. Port types are abstract collections of supported operations, while messages are abstract descriptions of the data being exchanged. The concrete protocol and data format specifications for a specific port type comprise a reusable binding, which binds operations and messages to a specific network protocol and message format. WSDL describes the public interface to the Web service in this way.
在WSDL中,服务被描述为网络端点或端口的组。因此,WSDL定义指定了文档的XML格式。端口和消息的抽象定义与其实际应用或实例分离,从而允许重用。通过将网络地址与可重用绑定关联来定义服务,并通过将网络地址与可重用绑定关联来形成端口组。端口类型是受支持操作的抽象集合,而消息是正在交换的数据的抽象描述。特定端口类型的具体协议和数据格式规范构成了可重用绑定,该绑定将操作和消息绑定到特定的网络协议和消息格式。WSDL以此方式描述了Web服务的公共接口。
303. State the steps to add assertions in SoapUI.
说出在SoapUI中添加断言的步骤。
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc7722 | 官方: 否 | 付费: 否
答案:
On receiving a response to a request, do the following steps: - Create a project and include the WSDL.
在收到请求的响应时,执行以下步骤:- 创建一个项目并包含WSDL。
- Include a test suite, a test case, and a set of test steps.
Execute the request
Now to add assertions, perform the following steps: - Go to the top of the log tabs and click Add Assertions.现在要添加断言,请执行以下步骤:- 转到日志选项卡顶部并单击添加断言。
- Configure the assertions according to the data and type needed.
304. What do you understand about XPath Assertion in SoapUI? Also, state your understanding of Data Driven Testing.
你对SoapUI中的XPath断言有什么理解?同时,请说明你对数据驱动测试的理解。
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc7725 | 官方: 否 | 付费: 否
答案:
The XPath assertion is used in SoapUI to assert the value of a web service response by specifying the absolute path. The test case or test suite will be marked as PASS if the absolute path matches the response value; otherwise, it will be marked as FAILED. The assertion results can be seen at the bottom of the screen in the Assertion tab. XPath assertion selects the target node and its values using an XPath expression. It compares an XPath expression's result to an expected value. XPath is an XML query language that allows you to pick nodes from an XML document. Given below are the steps which can be taken in order to add an XPath Assertion in SoapUI: - Select Assertion Category – Property Content after clicking Add Assertion.
XPath断言在SoapUI中用于通过指定绝对路径来断言Web服务响应的值。如果绝对路径与响应值匹配,则测试用例或测试套件将被标记为PASS;否则,将被标记为FAILED。断言结果可以在屏幕底部的断言选项卡中查看。XPath断言使用XPath表达式选择目标节点及其值。它将XPath表达式的结果与期望值进行比较。XPath是一种XML查询语言,允许您从XML文档中选择节点。下面列出了在SoapUI中添加XPath断言的步骤:- 在单击添加断言后,选择断言类别 – 属性内容。
- Then click Add and pick Assertion Type – XPath Match. The wizard for XPath Match Configuration appears. The NameSpace must be declared before an XPath may be added. An XML namespace is a set of names that are used as element and attribute names in XML documents and are identifiable by a URI reference. SoapUI XPath Assertion does the same thing.
- Click the 'Declare' button to automatically declare an XML Namespace; otherwise, manually declare a namespace.
- Refer to the XPath using the newly established namespace after declaring the namespace. When you click the 'Declare' button, two namespaces with two URIs will appear. The schema URL is one of them, while the real web service URL is the other. When accessing XPath, we must use the real namespace where the web service is situated, not the schema namespace.
- Input the XPath of the XML node which needs to be checked. //ns1:ConversionRateResult gives the value of the node enclosed between and and ns1 stand for the declared namespace pointing to 'www.webserviceX.NET'.
- After inputting the XPath, click the 'Select from current' button to take up the value from the current answer for future comparison. The user has the ability to change the value.
- Save the file.
As demonstrated in the accompanying screenshot, the added assertion will be presented.
如随附的截图所示,添加的断言将被展示。
Data Driven testing entails storing our test data, which includes both input and expected output, in an external data source such as Excel, Database, or XML file. The data source must then be iterated using the appropriate component. For data-driven testing in SoapUI, the Datasource and Datasource Loop test steps are employed.
数据驱动测试要求将我们的测试数据(包括输入和预期输出)存储在外部数据源中,如Excel、数据库或XML文件。然后必须使用适当的组件迭代数据源。对于SoapUI中的数据驱动测试,使用Datasource和Datasource Loop测试步骤。
- Data Science
- All Events
- My Events
305. What are the steps to parameterize endpoints in SOAP UI?
在SOAP UI中参数化端点的步骤是什么?
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc7728 | 官方: 否 | 付费: 否
答案:
It is critical to parameterize the endpoints in SOAP UI because it is the initial step in Automation Testing. Manually updating endpoints is more time demanding. In order to accomplish this, we can do the following steps: - Create a project property that stores the endpoint.
在SOAP UI中对端点进行参数化至关重要,因为这是自动化测试的第一步。手动更新端点非常耗时。为了实现这一点,我们可以执行以下步骤:创建一个存储端点的项目属性。
- Using property expansion, change the endpoint to use this property.
- Ascertain that your requests use the configured endpoint.
- The property will invariably be with its current value when a request is run. Simply configure the endpoint in the User Interface (UI) to use a different value, or use the P option from the command line.
306. State a few important functionalities of SOAP UI.
简要说明SOAP UI的几个重要功能。
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37c5458d557c902bc772b | 官方: 否 | 付费: 否
答案:
A few important functionalities of SOAP UI are as follows:
SOAP UI的几个重要功能如下:
- It builds a new project-based just on the web service WSDL link; it retrieves all method information and imports it automatically.
- It generates test cases from the web method request itself.
- It evaluates web techniques individually or in combination. It includes a very important feature that allows you to transmit data and arguments from one method to another. It allows you to preserve data in variables so that it may be accessed by other methods.
- It allows you to use assertions to validate web method results; assertions may be written in either Xpath or Xquery.
- It aids in the creation of various validations such as schema compliance, SOAP fault, response speed, and so on.
- It allows you to organise your test cases into test suites.
- It allows you to execute all of the test cases in a test suite and get fail/pass results for each one.
- It allows parameterization of test case request fields, allowing a test case to access various values from a table or database.
- It is possible to create complicated validation scripts using Groovy.
- It has some load testing features for web services.
- It has various features to help with testing coverage and requirements management.
307. State and explain the default properties in SOAPUI.
说明并解释SOAPUI中的默认属性。
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc772e | 官方: 否 | 付费: 否
答案:
SOAPUI provides three layers of properties by default: - Project level default or custom properties: The user can add any number of properties at the project level, and it can be opened from any test step in any test case under any test suite.
SOAPUI默认提供三层属性:- 项目级默认或自定义属性:用户可以在项目级别添加任意数量的属性,并且可以在任何测试套件下的任何测试用例中的任何测试步骤中访问这些属性。
- Test Suite level default or custom properties: Any number of characteristics can be appended at the test suite level, and they can be utilised from any test step in any test case under this test suite.
- Test Step level default or custom properties: Users can add any number of properties to a test case at the test case level, and these properties can be utilised in any test step from this test case.
308. What are assertions in SoapUI? State some of the important assertions present in SoapUI.
SoapUI中的断言是什么?列举SoapUI中存在的一些重要断言。
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc7731 | 官方: 否 | 付费: 否
答案:
In SoapUI, assertions are used to validate the message that a Test Step receives during execution, usually by comparing sections of the message (or the full message) to an expected value. A sample Test Step can include any number of assertions, each validating a particular element or content of the answer. The parts/all of the answer responses are compared to the expected outcome in assertions.
在SoapUI中,断言用于验证测试步骤在执行期间接收到的消息,通常通过将消息的某些部分(或整个消息)与预期值进行比较。一个测试步骤可以包含任意数量的断言,每个断言验证响应的特定元素或内容。在断言中,响应的部分或全部内容会与预期结果进行比较。
Some of the important assertions present in SoapUI are as follows: - WS security status: SoapUI manages WS Security configurations at the project level, allowing them to be utilised in several locations within a project:
SoapUI中存在的一些重要断言如下:- WS安全状态:SoapUI在项目级别管理WS安全配置,使其可以在项目内的多个位置使用:
For incoming and outgoing requests, as well as responses. Incoming MockServices requests and their MockResponses. In the SOAP Monitor, for monitored requests and their monitored answers.
用于传入和传出的请求以及响应。传入的MockServices请求及其MockResponses。在SOAP监视器中,用于被监视的请求及其被监视的响应。
On the project level, there are four sub-tabs under the WS Security Configurations tab:
在项目级别,WS安全配置选项卡下有四个子选项卡:
Outgoing WS-Security Configurations: configurations for outgoing messages, such as requests and MockResponses. Encryption, signing and adding SAML, timestamp, and username headers are all done with this configuration type. 2. WS Security Configurations for Incoming Messages: configurations that should be applied to incoming messages, such as responses, MockRequests, or monitored requests and responses. This configuration type is used to decode and validate incoming messages' signatures. 3. Keystores: Encryption, decryption, and signature keys are stored in keystores. 4. Truststores: Truststores used for signature verification. - XPath Match: The XPath assertion applies a defined XPath expression to the incoming message and compares the nodes to a predetermined value. The assertion succeeds if the values match; else, it fails. Let us take a look at a login response message that we would like to verify:
- 传出WS-Security配置:用于传出消息(如请求和MockResponses)的配置。加密、签名以及添加SAML、时间戳和用户名头都通过此配置类型完成。2. 传入消息的WS Security配置:应应用于传入消息(如响应、MockRequests或被监视的请求和响应)的配置。此配置类型用于解码和验证传入消息的签名。3. 密钥库:加密、解密和签名密钥存储在密钥库中。4. 信任库:用于签名验证的信任库。- XPath匹配:XPath断言将定义的XPath表达式应用于传入消息,并将节点与预定值进行比较。如果值匹配,则断言成功;否则,断言失败。让我们看一个我们想要验证的登录响应消息:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.example.org/sample/">
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.example.org/sample/">
<soapenv:Header/>
<soapenv:Header/>
<soapenv:Body>
<soapenv:Body>
<sam:loginResponse>
<sam:loginResponse>12406604040526722 12406604040526722
</sam:loginResponse>
</sam:loginResponse>
</soapenv:Body>
</soapenv:Body>
</soapenv:Envelope>
</soapenv:Envelope>
- 传出WS-Security配置:用于传出消息(如请求和MockResponses)的配置。加密、签名以及添加SAML、时间戳和用户名头都通过此配置类型完成。2. 传入消息的WS Security配置:应应用于传入消息(如响应、MockRequests或被监视的请求和响应)的配置。此配置类型用于解码和验证传入消息的签名。3. 密钥库:加密、解密和签名密钥存储在密钥库中。4. 信任库:用于签名验证的信任库。- XPath匹配:XPath断言将定义的XPath表达式应用于传入消息,并将节点与预定值进行比较。如果值匹配,则断言成功;否则,断言失败。让我们看一个我们想要验证的登录响应消息:
Essentially, we want to look for the loginResponse and sessionid components in the SOAP Body, but ignore the sessionid's actual value because it will change between requests. - XQuery Match: To pick information from the target property, XQuery employs an XQuery expression. It compares an XQuery expression's result to an expected value and it is applicable to any property containing XML.
本质上,我们希望在SOAP Body中查找loginResponse和sessionid组件,但忽略sessionid的实际值,因为它在不同请求之间会变化。- XQuery匹配:为了从目标属性中提取信息,XQuery使用一个XQuery表达式。它将XQuery表达式的结果与预期值进行比较,适用于任何包含XML的属性。
- Script Assertion: The Script Assertion enables arbitrary message validation, such as message content, HTTP headers, and so on. Validation scripts are written in the project scripting language (Groovy or JavaScript) and run when the assertion status of the containing sampler Test Step changes.
- Simple Contains: It searches for the existence of a string in the property value and supports regular expressions. It is applicable to any property.
- Soap Faults: Soap Faults check whether the response is a SOAP Fault (used for negative testing).
- Not Soap Faults: Not Soap Faults check whether the response is not a SOAP Fault.
- Response SLA: Response SLA checks the response time against a particular value which is given.
- WS Addressing Response: WS Addressing Response validates the availability of WS Addressing Headers in the response
- Schema Compliance: Schema compliance validates the response message against the WSDL (Web Service Description Language) definition and the XML Schema it contains.
- Simple not Contain: It searches for the non-existence of a string in the property value and supports regular expressions. It is applicable to any property.
- SOAP Response: Verifies that the response is a genuine SOAP message; used to ensure that we are receiving a response (if no assertions are added a connection error will not cause a failure).
- JMS Timeout: When utilising a JMS endpoint with a response channel provided, this assertion verifies that the response is received within the specified time.
- JMS Status: This assertion verifies that no JMS related issues occurred when using a JMS endpoint.
309. How can we use SoapUI to test a WCF rest service?
我们如何使用SoapUI测试WCF REST服务?
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc7734 | 官方: 否 | 付费: 否
答案:
For a constantly accessible service on an IIS (Internet Information Services) web server or just a service in an application, WCF gives the ability to send asynchronous messages between service endpoints. WCF (Windows Communication Foundation) is a core framework that allows you to create services with a web endpoint and deliver data using XML or JSON without using a SOAP wrapper. The steps to use SoapUI to test a WCF rest service are as follows: - Clicking on File -> New SoapUI Project will start a new project. Fill in the blanks in the dialogue box, and do not forget to include the Initial WSDL parameter by adding the WCF URI.
对于IIS(互联网信息服务)Web服务器上持续可访问的服务,或应用程序中的服务,WCF提供了在服务端点之间发送异步消息的能力。WCF(Windows Communication Foundation)是一个核心框架,允许你创建具有Web端点的服务,并使用XML或JSON传递数据,而无需SOAP包装。使用SoapUI测试WCF REST服务的步骤如下:- 点击File -> New SoapUI Project将启动一个新项目。在对话框中填写空白,不要忘记通过添加WCF URI来包含Initial WSDL参数。
- A new SoapUI project is created after clicking Ok.
- Then, much like the WCF Test Client, make the identical request.
310. In SoapUI, how do you test an SAP Web Service?
在SoapUI中,如何测试SAP Web服务?
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc7737 | 官方: 否 | 付费: 否
答案:
A web service is a modular and self-describing function or service that is supplied over HTTP. For service description and availability, web services use XML and other standards, as well as other internet or HTTP protocols. The WSDL files are essential for testing SOAP-based services. Test assertions, test requests, and mock services can all be described using WSDL files. Steps to test an SAP Web Service using SoapUI, which requires a WSDL file are as follows: - In SoapUI, select Create SOAP Project or File > New SOAP Project to start a new one.
Web服务是一种通过HTTP提供的模块化、自描述的函数或服务。对于服务描述和可用性,Web服务使用XML和其他标准,以及其他互联网或HTTP协议。WSDL文件对于测试基于SOAP的服务至关重要。测试断言、测试请求和模拟服务都可以使用WSDL文件来描述。使用SoapUI测试SAP Web服务(需要WSDL文件)的步骤如下:- 在SoapUI中,选择Create SOAP Project或File > New SOAP Project来启动一个新项目。
- In the dialogue box that displays, type the SAP URI in the Initial WSDL area.
- Click OK to accept the default settings.
311. In SoapUI, how do you test an ASMX web service?
在SoapUI中,如何测试ASMX Web服务?
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc773a | 官方: 否 | 付费: 否
答案:
ASMX provides online services with a messaging feature based on the Simple Object Access Protocol, or SOAP. The basic files required for testing SOAP-based web services are WSDL files. As a result, SoapUI uses WSDL files to generate test requests, mock services, and assertions. The following are the steps to test an ASMX web service in soapui that requires WSDL.
ASMX基于简单对象访问协议(SOAP)为在线服务提供消息传递功能。测试基于SOAP的Web服务所需的基本文件是WSDL文件。因此,SoapUI使用WSDL文件来生成测试请求、模拟服务和断言。以下是在soapui中测试需要WSDL的ASMX Web服务的步骤。
- In SoapUI, select Create SOAP Project or File > New SOAP Project to start a new one.
- In the dialogue box that displays, type the ASMX URI in the Initial WSDL area.
- Click OK to accept the default settings.
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万+职业规划
312. In SoapUI, what is the most basic approach for automating web services?
在SoapUI中,自动化Web服务最基本的的方法是什么?
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc773d | 官方: 否 | 付费: 否
答案:
The most basic approach for automating web services in SoapUI is as follows: - Make a project and include the WSDL (Web Service Description Language) file in it.
在SoapUI中自动化Web服务最基本的方法如下:- 创建一个项目并将WSDL(Web服务描述语言)文件包含在其中。
- Include custom programming/validation utilising Groovy steps by adding test suites, test cases, and test cases in that order.
- If you are using external data sources, add assertions if necessary, and then RUN.
313. What are the advantages of using SoapUI? How does SoapUI structure functional tests?
使用SoapUI有哪些优势?SoapUI如何组织功能测试?
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37c5458d557c902bc7740 | 官方: 否 | 付费: 否
答案:
The advantages of using SoapUI are as follows: - SoapUI can run load tests (Load testing is a type of non-functional software testing in which a software application's performance is evaluated under a certain load which determines how the software application operates when numerous people access it at the same time. Load testing is used to identify performance bottlenecks and ensure the stability and smooth operation of software applications prior to deployment), scenario-based tests (Scenario-based testing is one way to document the project's software specs and needs. Scenario-based testing is a method of designing tests for individual user scenarios in order to ensure that their job is correct. Scenarios focus on the most important goals and requirements. The scenario passes if it runs from beginning to end. Scenario-based software testing may be described as an inspection-based collection of tests that are run to ensure that the user can execute the specified actions from start to finish. There are alternative ways to depict scenarios, such as a table with the first column describing the user's actions and the second describing the system's response), and data-driven tests (Data-driven testing (DDT), also known as table-driven testing or parameterized testing, is a software testing methodology that describes testing that uses a table of conditions directly as test inputs and verifiable outputs, as well as the process of not hard-coding test environment settings and control. In its most basic version, the tester provides inputs from a table row and anticipates outputs from the same row. Values that correspond to border or partition input spaces are often found in the table. The test configuration is "read" from a database in the control approach) automatically.
使用SoapUI的优势如下:- SoapUI可以自动运行负载测试(负载测试是一种非功能性软件测试,在特定负载下评估软件应用程序的性能,这决定了当许多人同时访问时软件应用程序如何运行。负载测试用于识别性能瓶颈,确保软件应用程序在部署前的稳定性和流畅运行)、基于场景的测试(基于场景的测试是记录项目软件规格和需求的一种方式。基于场景的测试是一种为单个用户场景设计测试的方法,以确保其工作正确。场景关注最重要的目标和需求。如果场景从头到尾运行,则通过。基于场景的软件测试可以描述为基于检查的测试集合,用于确保用户能从开始到结束执行指定操作。还有其他方式描述场景,例如使用一个表格,第一列描述用户操作,第二列描述系统响应)和数据驱动测试(数据驱动测试(DDT),也称为表驱动测试或参数化测试,是一种软件测试方法,描述使用一个条件表直接作为测试输入和可验证输出,以及不硬编码测试环境设置和控制的过程。在其最基本的版本中,测试者从表行提供输入,并预期从同一行获取输出。对应边界或分区输入空间的值通常出现在表中。在控制方法中,测试配置从数据库“读取”)自动执行。
- It has the capabilities to generate reports for the tests performed using it.
SoapUI provides the unique ability to impersonate Web services and perform functional and load tests against them prior to their execution.
Functional tests are organised using three layers in SOAP UI: - Test Suite: A Test Suite is a collection of test cases that are used to group functional tests into logical units.在SOAP UI中,功能测试使用三层组织:- 测试套件:测试套件是测试用例的集合,用于将功能测试分组为逻辑单元。
- Test Case: A Test Case is a collection of test procedures used to evaluate a single feature of your services. Any number of Test Cases can be added to test suites.
- Test Steps: In SOAPUI, Test Steps are the "building blocks" of functional tests. They work together to create Test Cases, which determines the service's execution flow.
314. How can we use SoapUI for the testing of Restful Web Services?
我们如何使用SoapUI进行RESTful Web服务的测试?
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc7743 | 官方: 否 | 付费: 否
答案:
In order to use SoapUI to test restful web services we can do the following: Using SoapUI to test restful web services requires first developing test cases, after which the following actions can be followed. - 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
为了使用SoapUI测试RESTful Web服务,我们可以执行以下操作:使用SoapUI测试RESTful Web服务需要首先开发测试用例,之后可以遵循以下步骤。- 下一步是创建REST请求。通过使用“添加到测试用例”按钮(位于消息编辑器左上角)或请求弹出窗口中的“添加到测试用例”操作
- Menu, TestStep can be added to a new or existing TestCase.
- After that, we must include Assertions in order to validate the response message.
315. State your understanding of SoapUI automation.
陈述你对SoapUI自动化的理解。
- 知识点: 测试 (主题: soapui, api-testing;标签: interviewbit, soap-ui, topic-specific, soapui, api-testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5458d557c902bc7746 | 官方: 否 | 付费: 否
答案:
SOAP or Simple Object Access Protocol is a protocol that uses XML to interact with web applications. With the help of XML based content, it can make communication happen between two client machines across any network. SoapUI is a cross-platform functional testing solution that is free and open source. It allows us to develop and run automated regression, compliance, functional, and load tests quickly and easily. SoapUI is currently being used to test Web Services. SOAP UI automation refers to the use of SOAP UI software for automation testing and implementation.
SOAP或简单对象访问协议是一种使用XML与Web应用程序交互的协议。借助基于XML的内容,它可以在任何网络上的两台客户端机器之间进行通信。SoapUI是一个跨平台的功能测试解决方案,免费且开源。它使我们能够快速轻松地开发和运行自动化回归、合规性、功能性和负载测试。SoapUI目前用于测试Web服务。SOAP UI自动化指的是使用SOAP UI软件进行自动化测试和实施。
316. What is Software testing?
什么是软件测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc77d1 | 官方: 否 | 付费: 否
答案:
Software testing involves evaluating and verifying a software product's functionality. Basically, it checks whether the software product matches anticipated requirements and makes sure it is defect-free. It can be said that testing enhances the quality of the product by preventing bugs, reducing development costs, and reducing performance issues.
软件测试涉及评估和验证软件产品的功能。基本上,它检查软件产品是否符合预期要求,并确保其无缺陷。可以说,测试通过防止错误、降低开发成本和减少性能问题来提高产品质量。
317. What are the different types of testing?
测试有哪些不同类型?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc77d4 | 官方: 否 | 付费: 否
答案:
You can test the software in many different ways. Some types of testing are conducted by software developers and some by specialized quality assurance staff. Here are a few different kinds of software testing, along with a brief description of each.
你可以通过多种不同方式测试软件。有些类型的测试由软件开发人员执行,有些由专业质量保证人员执行。以下是几种不同类型的软件测试,以及每种类型的简要描述。
| Type 类型 | Description 描述 |
|---|---|
| Unit Testing 单元测试 | A programmatic test that tests the internal working of a unit of code, such as a method or a function. 一种程序化测试,测试代码单元(如方法或函数)的内部工作。 |
| Integration Testing 集成测试 | Ensures that multiple components of systems work as expected when they are combined to produce a result. 确保系统的多个组件在组合产生结果时按预期工作。 |
| Regression Testing 回归测试 | Ensures that existing features/functionality that used to work are not broken due to new code changes. 确保过去能用的现有功能因新代码更改而未被破坏。 |
| System Testing 系统测试 | Complete end-to-end testing is done on the complete software to make sure the whole system works as expected. 对整个软件进行完整的端到端测试,以确保整个系统按预期工作。 |
| Smoke Testing 冒烟测试 | A quick test performed to ensure that the software works at the most basic level and doesn’t crash when it’s started. Its name originates from the hardware testing where you just plug the device and see if smoke comes out. 一种快速测试,确保软件在基本级别工作,并且在启动时不会崩溃。其名称源自硬件测试,即只需插入设备,看看是否有烟冒出。 |
| Performance Testing 性能测试 | Ensures that the software performs according to the user’s expectations by checking the response time and throughput under specific load and environment. 通过在特定负载和环境条件下检查响应时间和吞吐量,确保软件按用户期望的性能运行。 |
| User-Acceptance Testing 用户验收测试 | Ensures the software meets the requirements of the clients or users. This is typically the last step before the software is live, i.e. it goes to production. 确保软件满足客户或用户的要求。这通常是软件上线前(即投入生产)的最后一步。 |
| Stress Testing 压力测试 | Ensures that the performance of the software doesn’t degrade when the load increases. In stress testing, the tester subjects the software under heavy loads, such as a high number of requests or stringent memory conditions to verify if it works well. 确保软件性能在负载增加时不会下降。在压力测试中,测试人员使软件承受重负载,例如大量请求或严格的内存条件,以验证其是否正常工作。 |
| Usability Testing 可用性测试 | Measures how usable the software is. This is typically performed with a sample set of end-users, who use the software and provide feedback on how easy or complicated it is to use the software. 衡量软件的易用性。这通常由一组最终用户样本执行,他们使用软件并提供关于软件使用难易程度的反馈。 |
| Security Testing 安全测试 | Now more important than ever. Security testing tries to break a software’s security checks, to gain access to confidential data. Security testing is crucial for web-based applications or any applications that involve money. 现在比以往任何时候都重要。安全测试试图破坏软件的安全检查,以访问机密数据。安全测试对于基于Web的应用程序或任何涉及金钱的应用程序至关重要。 |
318. What are the principles of software testing?
软件测试的原则是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc77d7 | 官方: 否 | 付费: 否
答案:
Software testing is governed by seven principles: - Absence of errors fallacy: Even if the software is 99% bug-free, it is unusable if it does not conform to the user's requirements. Software needs to be bug-free 99% of the time, and it must also meet all customer requirements.
软件测试受七条原则支配: - 无错误谬误:即使软件99%无缺陷,如果不符合用户需求,它也是不可用的。软件需要在99%的时间里无缺陷,并且还必须满足所有客户要求。
- Testing shows the presence of errors: Testing can verify the presence of defects in software, but it cannot guarantee that the software is defect-free. Testing can minimize the number of defects, but it can't remove them all.
- Exhaustive testing is not possible: The software cannot be tested exhaustively, which means all possible test cases cannot be covered. Testing can only be done with a select few test cases, and it's assumed that the software will produce the right output in all cases. Taking the software through every test case will cost more, take more effort, etc., which makes it impractical.
- Defect clustering: The majority of defects are typically found in a small number of modules in a project. According to the Pareto Principle, 80% of software defects arise from 20% of modules.
- Pesticide Paradox: It is impossible to find new bugs by re-running the same test cases over and over again. Thus, updating or adding new test cases is necessary in order to find new bugs.
- Early testing: Early testing is crucial to finding the defect in the software. In the early stages of SDLC, defects will be detected more easily and at a lower cost. Software testing should start at the initial phase of software development, which is the requirement analysis phase.
- Testing is context-dependent: The testing approach varies depending on the software development context. Software needs to be tested differently depending on its type. For instance, an ed-tech site is tested differently than an Android app.
319. What is regression testing in software testing?
软件测试中的回归测试是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc77db | 官方: 否 | 付费: 否
答案:
The dictionary definition of regression is the act of going back to a previous place or state. In software, regression implies that a feature that used to work suddenly stopped working after a developer added a new code or functionality to the software.
字典中回归的定义是回到先前位置或状态的行为。在软件中,回归意味着一个曾经正常工作的功能在开发人员添加新代码或功能后突然停止工作。
Regression problems are pervasive in the software industry, as new features are getting added all the time. Developers don't build these features in isolation, separate from the existing code. Instead, the new code interacts with the legacy code and modifies it in various ways, introducing side effects, whether intended or not.
回归问题在软件行业中普遍存在,因为新功能一直在被添加。开发人员并非孤立地构建这些功能,与现有代码分离。相反,新代码与遗留代码交互,并以各种方式修改它,引入有意或无意的副作用。
As a result, there is always a chance that introducing new changes may negatively impact a working feature. It's important to keep in mind that even a small change has the potential to cause regression.
因此,总是存在引入新更改可能对工作功能产生负面影响的机会。重要的是要记住,即使很小的更改也可能导致回归。
Regression testing helps ensure that the new code or modifications to the existing code don't break the present behaviour. It allows the tester to verify that the new code plays well with the legacy code.
回归测试有助于确保新代码或对现有代码的修改不会破坏当前行为。它允许测试人员验证新代码与遗留代码能良好协作。
320. What is exploratory testing?
什么是探索性测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc77e1 | 官方: 否 | 付费: 否
答案:
Imagine a tourist in a foreign city. There are two ways in which they can explore the city. - Follow a map, itinerary, or a list of places they should visit
想象一位身处陌生城市的游客。他们探索这座城市有两种方式。- 按照地图、行程或应游览地点的清单行动
Explore randomly, following the streets as they lead them to new places
With the first approach, the tourist follows a predetermined plan and executes it. Though they may visit famous spots, they might miss out on hidden, more exciting places in the city. With the second approach, the tourist wanders around the city and might encounter strange and exotic places that the itinerary would have missed.采用第一种方式,游客遵循预定计划并执行。虽然他们可能参观著名景点,但可能会错过城市中隐藏的、更令人兴奋的地方。采用第二种方式,游客漫步于城市中,可能会遇到行程计划遗漏的奇异和异国风情之地。
Both approaches have their pros and cons.
这两种方式各有优缺点。
A tester is similar to a tourist when they are testing software. They can follow a strict set of test cases and test the software according to them, with the provided inputs and outputs, or they can explore the software.
测试人员在测试软件时,如同这位游客。他们可以遵循一套严格的测试用例,并根据这些用例及提供的输入和输出来测试软件,或者他们可以探索软件。
When a tester doesn't use the test scripts or a predefined test plan and randomly tests the software, it is called exploratory testing. As the name suggests, the tester is exploring the software as an end-user would. It's a form of black-box testing.
当测试人员不使用测试脚本或预定义测试计划,而是随机测试软件时,这被称为探索性测试。顾名思义,测试人员像最终用户一样探索软件。这是黑盒测试的一种形式。
In exploratory testing, the tester interacts with the software in whatever manner they want and follows the software's instructions to navigate various paths and functionality. They don't have a strict plan at hand.
在探索性测试中,测试人员以任意方式与软件交互,并遵循软件的指令来浏览各种路径和功能。他们手头并没有严格的计划。
Exploratory testing primarily focuses on behavioural testing. It is effective for getting familiar with new software features. It also provides a high-level overview of the system that helps evaluate and quickly learn the software.
探索性测试主要侧重于行为测试。它对于熟悉新软件特性非常有效。它还提供了系统的高层概述,有助于评估并快速学习软件。
Though it seems random, exploratory testing can be powerful in an experienced and skilled tester's hands. As it's performed without any preconceived notions of what software should and shouldn't do, it allows greater flexibility for the tester to discover hidden paths and problems along those paths.
尽管看似随机,但探索性测试在经验丰富且技能娴熟的测试人员手中可能非常强大。由于它是在没有软件应当或不应当做什么的预先设想下进行的,它为测试人员提供了更大的灵活性,以发现隐藏路径及路径上的问题。
- Data Science
- All Events
- My Events
321. What is end-to-end testing?
什么是端到端测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc77e8 | 官方: 否 | 付费: 否
答案:
End to End testing is the process of testing a software system from start to finish. The tester tests the software just like an end-user would. For example, to test a desktop software, the tester would install the software as the user would, open it, use the application as intended, and verify the behavior. Same for a web application.
端到端测试是从头到尾测试软件系统的过程。测试人员就像最终用户一样测试软件。例如,要测试桌面软件,测试人员会像用户一样安装软件、打开它、按预期使用应用程序,并验证其行为。对于Web应用程序也是如此。
There is an important difference between end-to-end testing vs. other forms of testing that are more isolated, such as unit testing. In end-to-end testing, the software is tested along with all its dependencies and integrations, such as databases, networks, file systems, and other external services.
端到端测试与其他更孤立的测试形式(如单元测试)之间存在一个重要区别。在端到端测试中,软件会与其所有依赖项和集成(如数据库、网络、文件系统和其他外部服务)一起进行测试。
322. What is an API?
什么是API?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc77f3 | 官方: 否 | 付费: 否
答案:
API stands for Application Programming Interface. It is a means of communication between two software components. An API abstracts the internal workings and complexity of a software program and allows the user of that API to solely focus on the inputs and outputs required to use it.
API代表应用程序编程接口。它是两个软件组件之间通信的一种方式。API抽象了软件程序的内部工作方式和复杂性,允许API的用户只关注使用它所需的输入和输出。
When building software, developers rarely write software from scratch and make use of other third-party libraries. An API allows two software components to talk to each other by providing an interface that they can understand.
在构建软件时,开发人员很少从头开始编写软件,而是利用其他第三方库。API通过提供两者可理解的接口,使两个软件组件能够相互通信。
Another use of an API is to provide data required by an application. Let's say you are building a weather application that displays the temperature. Instead of building the technology to collect the temperature yourself, you'd access the API provided by the meteorological institute.
API的另一个用途是提供应用程序所需的数据。假设您正在构建一个显示温度的天气应用程序。与其自己构建收集温度的技术,您可以访问气象研究所提供的API。
323. Explain how does a test coverage tool work?
解释测试覆盖率工具如何工作?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc77fd | 官方: 否 | 付费: 否
答案:
When software is being tested, the code coverage measures how much of the program's source code is covered by the test plan. Code coverage testing runs in parallel with actual product testing. Using the code coverage tool, you can monitor the execution of statements in your source code. A complete report of the pending statements, along with the coverage percentage, is provided at the end of the final testing.
当软件被测试时,代码覆盖率衡量测试计划覆盖了多少程序源代码。代码覆盖率测试与实际产品测试并行运行。使用代码覆盖率工具,您可以监控源代码中语句的执行情况。在最终测试结束时,会提供待处理语句的完整报告以及覆盖率百分比。
324. Can you describe the different types of test coverage techniques?
您能描述不同类型的测试覆盖技术吗?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7800 | 官方: 否 | 付费: 否
答案:
Among the different types of test coverage techniques are: - Statement/Block Coverage: Measures how many statements in the source code have been successfully executed and tested.
不同类型的测试覆盖技术包括:- 语句/块覆盖:衡量源代码中有多少语句已被成功执行和测试。
- Decision/Branch Coverage: This metric measures how many decision control structures were successfully executed and tested.
- Path Coverage: This ensures that the tests are conducted on every possible route through a section of the code.
- Function coverage: It measures how many functions in the source code have been executed and tested at least once.
325. Explain black-box testing, white-box testing, and grey-box testing.
解释黑盒测试、白盒测试和灰盒测试。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7803 | 官方: 否 | 付费: 否
答案:
- Black-box testing in software testing: In black-box testing, the system is tested only in terms of its external behaviour; it does not consider how the software functions on the inside. This is the only limitation of the black-box test. It is used in Acceptance Testing and System Testing.
- White-box testing in software testing: A white-box test is a method of testing a program that takes into account its internal workings as part of its review. It is used in integration testing and unit testing.
- Grey-box testing in software testing: A Gray Box Testing technique can be characterized as a combination of a black box as well as a white box testing technique used in the software testing process. Using this technique, you can test a software product or application with a partial understanding of its internal structure.
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万+职业规划
326. Is Automation testing in agile methodology useful?
敏捷方法论中的自动化测试有用吗?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7806 | 官方: 否 | 付费: 否
答案:
It is extremely beneficial to use automation testing when using the agile model in software testing. It helps in achieving maximum test coverage in a lesser time of the sprint.
在软件测试中采用敏捷模型时,使用自动化测试非常有益。它有助于在较短的冲刺时间内实现最大的测试覆盖率。
327. Explain test scenarios, test scripts, and test cases in software testing.
解释软件测试中的测试场景、测试脚本和测试用例。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7809 | 官方: 否 | 付费: 否
答案:
- Test Case: Test Cases are a series of actions executed during software development to verify a particular feature or function. A test case consists of test steps, test data, preconditions, and postconditions designed to verify a specific requirement.
- Test Scenario: Usually, a test scenario consists of a set of test cases covering the end-to-end functionality of a software application. A test scenario provides a high-level overview of what needs to be tested.
- Test Scripts: When it comes to software testing, a test script refers to the set of instructions that will be followed in order to verify that the system under test performs as expected. The document outlines each step to be taken and the expected results.
328. What is a bug in software testing?
软件测试中的缺陷是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc780c | 官方: 否 | 付费: 否
答案:
A software bug is an error in the software that produces wrong results. A software tester tests the software to find bugs in it.
软件缺陷是软件中产生错误结果的错误。软件测试人员对软件进行测试以发现其中的缺陷。
There are many causes for the bugs—for example, poor design, sloppy programming, lack of version control, or miscommunication. Throughout development, developers introduce hundreds or thousands of bugs in the system. The goal of the tester is to uncover those bugs.
缺陷有许多原因——例如,设计不佳、编程草率、缺乏版本控制或沟通不畅。在整个开发过程中,开发人员会在系统中引入成百上千个缺陷。测试人员的目标是发现这些缺陷。
You can find a bug in many different ways, regardless of your role. When building the software, the software developer might notice the bug in another module, written by another developer or by themselves. The tester actively tries to find the bugs as part of a routine testing process. Finally, the users could see the bugs when the software is in production.
无论你的角色如何,你都可以通过多种不同方式发现缺陷。在构建软件时,软件开发人员可能会注意到另一个模块中的缺陷,该模块由其他开发人员或他们自己编写。测试人员作为常规测试过程的一部分,积极尝试发现缺陷。最后,当软件投入生产时,用户可能会看到缺陷。
All bugs, no matter how they are found, are recorded into a bug-tracking system. A triage team triages the bugs and assigns a priority to the bug, and assigns the bug to a software developer to fix it. Once the developer resolves the problem, they check in the code and mark that bug as ready for testing. Once a bug is ready for testing, it goes to the tester, who tests the software to verify if it’s indeed fixed. If it is, then it’s closed. If not, they assign it to the same developer with a description of the exact steps to reproduce the bug. Some examples of popular bug-tracking systems include BugZilla, FogBugz, etc.
所有缺陷,无论它们是如何被发现的,都会被记录到缺陷跟踪系统中。分诊团队对缺陷进行分类并分配优先级,然后将缺陷分配给软件开发人员进行修复。一旦开发人员解决了问题,他们会提交代码并将该缺陷标记为待测试。缺陷一旦准备好测试,就会交给测试人员,测试人员对软件进行测试以验证其是否确实已修复。如果是,则关闭该缺陷。如果不是,则会将其分配给同一开发人员,并附上缺陷重现的确切步骤描述。一些流行的缺陷跟踪系统示例包括BugZilla、FogBugz等。
Trivia:
小知识:
The first software bug was discovered by Admiral Grace Hopper, on September 9, 1947. After they opened a malfunctioning piece of hardware, they found an insect stuck in the relay. Image Source: Link
第一个软件缺陷是由海军上将格蕾丝·霍珀于1947年9月9日发现的。在打开一个故障硬件后,他们发现一只昆虫卡在继电器中。图片来源:链接
First Software Bug
第一个软件缺陷
329. State the difference between bugs and errors
说明缺陷和错误之间的区别
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc780f | 官方: 否 | 付费: 否
答案:
Bugs and errors differ in the following ways:
错误(Bugs)与误差(Errors)在以下方面有所不同:
| Bugs 错误(Bugs) | Errors 误差(Errors) |
|---|---|
| Software bugs are defects, which occur when the software or an application does not work as intended. A bug occurs when there is a coding error, which causes the program to malfunction. 软件错误是缺陷,当软件或应用程序未按预期工作时发生。错误发生在存在编码错误导致程序故障时。 | Errors in code are caused by problems with the code, which means that the developer could have misunderstood the requirement or the requirement was not defined correctly, leading to a mistake. 代码中的误差由代码问题引起,这意味着开发者可能误解了需求或需求未正确定义,导致失误。 |
| The bug is submitted by the testers. 错误由测试人员提交。 | Errors are raised by test engineers and developers. 误差由测试工程师和开发人员提出。 |
| Logic bugs, resource bugs, and algorithmic bugs are types of bugs. 逻辑错误、资源错误和算法错误是错误类型。 | Syntactic error, error handling error, error handling error, user interface error, flow control error, calculation error, and testing error are types of errors. 语法误差、错误处理误差、错误处理误差、用户界面误差、流程控制误差、计算误差和测试误差是误差类型。 |
| The software is detected before it is deployed in production. 软件在部署到生产环境前被检测到。 | The error occurs when the code is unable to be compiled. 误差在代码无法编译时发生。 |
330. What is a Test Plan? What does it include?
什么是测试计划?它包含哪些内容?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7812 | 官方: 否 | 付费: 否
答案:
A test plan is basically a dynamic document monitored and controlled by the testing manager. The success of a testing project totally depends upon a well-written test plan document that describes software testing scope and activities. It basically serves as a blueprint that outlines the what, when, how, and more of the entire test process.
测试计划基本上是由测试经理监控和控制的动态文档。测试项目的成功完全依赖于一份编写良好的测试计划文档,该文档描述了软件测试的范围和活动。它基本上充当蓝图,概述了整个测试过程中的内容、时间、方式等。
A test plan must include the following details: - Test Strategy
测试计划必须包含以下详细信息: - 测试策略
- Test Objective
- Test Scope
- Reason for Testing
- Exit/Suspension Criteria
- Resource Planning
- Test Deliverables.
331. What is a Test Report? What does it include?
什么是测试报告?它包含哪些内容?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7815 | 官方: 否 | 付费: 否
答案:
Test report is basically a document that includes a total summary of testing objectives, activities, and results. It is very much required to reflect testing results and gives an opportunity to estimate testing results quickly. It helps us to decide whether the product is ready for release or not. It also helps us determine the current status of the project and the quality of the product. A test report must include the following details: - Test Objective
测试报告基本上是一份包含测试目标、活动和结果的总摘要的文档。它非常需要反映测试结果,并提供快速评估测试结果的机会。它帮助我们决定产品是否准备发布。它还帮助我们确定项目的当前状态和产品质量。测试报告必须包含以下详细信息: - 测试目标
- Project Information
- Defect
- Test Summary
332. What do you mean by Test Deliverables?
测试交付物是什么意思?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7818 | 官方: 否 | 付费: 否
答案:
Test deliverables, also known as test artifacts, are basically a list of all of the documents, tools, and other components that are given to the stakeholders of a software project during the SDLC. Test deliverables are maintained and developed in support of the test. At every phase of SDLC, there are different deliverables as given below:
测试交付物,也称为测试产物,基本上是软件开发生命周期(SDLC)期间提供给软件项目利益相关者的所有文档、工具和其他组件的列表。测试交付物是为了支持测试而维护和开发的。在SDLC的每个阶段,都有不同的交付物,如下所示:
Before Testing Phase - Test plans document.
测试之前阶段 - 测试计划文档。
- Test cases documents
Test Design specifications.
During Testing Phase - Test Scripts测试期间阶段 - 测试脚本
- Simulators.
- Test Data
- Test Traceability Matrix
Error logs and execution logs
After testing Phase - Test Results/reports测试之后阶段 - 测试结果/报告
- Defect Report
- Installation/ Test procedures guidelines
- Release notes
333. What are different categories of debugging?
调试的不同类别有哪些?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc781b | 官方: 否 | 付费: 否
答案:
Different categories of debugging include: - Brute force debugging
调试的不同类别包括: - 暴力调试
- Backtracking
- Cause elimination
- Program slicing
- Fault tree analysis
334. Write some common mistakes that lead to major issues.
写出一些导致重大问题常见错误。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc781e | 官方: 否 | 付费: 否
答案:
Some common mistakes include: - Poor Scheduling
一些常见错误包括: - 调度不佳
- Underestimating
- Ignoring small issues
- Not following the exact process
- Improper resource allocation
335. What is a user story?
什么是用户故事?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7821 | 官方: 否 | 付费: 否
答案:
All software has a target user. A user story describes the user's motivations and what they are trying to accomplish by using the software. Finally, it shows how the user uses the application. It ignores the design and implementation details.
所有软件都有目标用户。用户故事描述了用户的动机以及他们通过使用软件试图达成的目标。最后,它展示了用户如何使用应用程序。它忽略设计和实现细节。
A user story aims to focus on the value provided to the end-user instead of the exact inputs they might enter and the expected output.
用户故事旨在关注为最终用户提供的价值,而不是他们可能输入的确切内容以及预期输出。
In a user story, the tester creates user personas with real names and characteristics and tries to simulate a real-life interaction with the software. A user story often helps fish out hidden problems that are often not revealed by more formal testing processes.
在用户故事中,测试者创建具有真实姓名和特征的用户角色,并尝试模拟与软件的真实交互。用户故事通常有助于发现那些更正式的测试过程往往无法揭示的隐藏问题。
336. List some of the popular software testing tools/frameworks, providing a brief description of each.
列出一些流行的软件测试工具/框架,并简要描述每个工具。
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7824 | 官方: 否 | 付费: 否
答案:
- Selenium: a web browser automation tool that automates the test suites you need to run on a web browser.
Protractor: An end-to-end test framework for Angular and AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would.
- Protractor:一个针对 Angular 和 AngularJS 应用程序的端到端测试框架。Protractor 在真实浏览器中运行针对你的应用程序的测试,并像用户一样与之交互。
Cypress: A modern front-end testing tool built for the modern web. Though it’s similar to Selenium and Protractor, it’s architecturally different from them.
- Cypress:一个为现代网络构建的现代前端测试工具。虽然它与 Selenium 和 Protractor 类似,但在架构上有所不同。
Jasmine: This is an open-source JavaScript testing framework that allows you to write behaviour-driven tests.
- Jasmine:这是一个开源 JavaScript 测试框架,允许你编写行为驱动测试。
JUnit and NUnit: These are unit testing frameworks for Java and C# programming languages, respectively.
- JUnit 和 NUnit:这些分别是针对 Java 和 C# 编程语言的单元测试框架。
337. What is A/B testing?
什么是 A/B 测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7828 | 官方: 否 | 付费: 否
答案:
A/B testing is the process of testing two or more different versions of your software with users to assess which performs better. It is a low-risk way of testing variations of a new or existing functionality.
A/B 测试是使用用户测试你的软件的两个或多个不同版本,以评估哪个版本表现更好的过程。这是一种测试新功能或现有功能变体的低风险方式。
You can choose a part of your users to use feature A. The other group uses feature B. Then user feedback and response are evaluated using statistical testing to decide the final version of the feature.
你可以选择部分用户使用功能 A,另一组用户使用功能 B。然后,使用统计测试评估用户反馈和响应,以决定功能的最终版本。
Typically, A/B testing is used to test the user experience of different interfaces. This allows the team to quickly gather feedback and test their initial hypothesis.
通常,A/B 测试用于测试不同界面的用户体验。这使团队能够快速收集反馈并测试他们的初始假设。
338. What is defects in software testing?
软件测试中的缺陷是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc782b | 官方: 否 | 付费: 否
答案:
The term defect refers to a system error that prevents the intended action from being accomplished. Testing is most important when it comes to finding defects. Testing needs to begin early in the development process since defects can be found throughout. As shown in the following figure, defects are divided into three main categories: - Wrong: It implies incorrect implementation of requirements. There is a variance between the specifications and what was expected, resulting in this defect.
术语“缺陷”指的是阻止预期操作完成的一个系统错误。当涉及发现缺陷时,测试最为重要。由于缺陷可能出现在整个开发过程中,测试需要在开发过程早期开始。如下图所示,缺陷分为三大类:- 错误:意味着需求的错误实现。规格和预期之间存在差异,导致此缺陷。
- Missing: This indicates that a specification has not been implemented, or a requirement of the customer has not been properly noted.
- Extra: In this case, the defect is caused by a requirement incorporated into the product that was not provided by the end-user.
339. What is spice in software testing?
软件测试中的 spice 是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc782e | 官方: 否 | 付费: 否
答案:
SPICE stands for Software Process Improvement and Capability Determination. In the field of software development processes, SPICE is a standard framework for assessing the efficiency and effectiveness of the development process. IEC (International Electrotechnical Commission) and ISO (International Organization for Standardization) jointly developed SPICE.
SPICE代表软件过程改进与能力确定。在软件开发过程领域,SPICE是一个用于评估开发过程效率和有效性的标准框架。IEC(国际电工委员会)和ISO(国际标准化组织)共同制定了SPICE。
340. What do you mean by latent defect and masked defect?
你说的潜在缺陷和掩盖缺陷是什么意思?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7831 | 官方: 否 | 付费: 否
答案:
- Latent Defect: Latent defects are defects that exist but have not yet been invoked because the conditions required to invoke them have not been met. As a systematic flaw, it encompasses the entire production process of the software, including all pre-production testing and extended testing. When users perform a particular task in an unusual or rare situation or without the presence of usual scenarios, latent defects are revealed.
- Masked Defect: These are the defects that have not yet resulted in a failure since another defect hides that portion of the code from being executed. It can only be discovered when the defect hiding it is exposed by the user through a specific operation. There are defects that are hidden or marked by another defect and remain hidden until the other defect is detected.
341. Can you explain sanity testing in software testing?
你能解释一下软件测试中的健全性测试吗?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7834 | 官方: 否 | 付费: 否
答案:
The term 'sanity testing' refers to a subset of regression testing. The sanity testing ensures that the changes made to the code do not adversely affect the system's performance. After the software build is received, a sanity test is conducted to ensure that the changes made to the code are working correctly. As a checkpoint, this testing is used to determine whether the build can proceed with further testing. Sanity testing focuses on validating the functionality of the application rather than detailed testing.
术语“健全性测试”指的是回归测试的一个子集。健全性测试确保对代码所做的更改不会对系统性能产生不利影响。在收到软件构建后,进行健全性测试以确保对代码所做的更改正常工作。作为检查点,该测试用于确定构建是否可以继续进行进一步测试。健全性测试侧重于验证应用程序的功能,而不是进行详细测试。
Features - It focuses on a smaller section of the application and is a subset of regression testing.
特点 - 它侧重于应用程序的较小部分,并且是回归测试的子集。
- The process is undocumented.
- Sanity testing is often unscripted.
- In this approach, limited functionalities are deeply tested.
- A tester is usually responsible for performing this task.
342. What is the purpose of TestNG?
TestNG的目的是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7837 | 官方: 否 | 付费: 否
答案:
The TestNG framework for Java is an open-source advanced test automation framework that is designed to benefit both testers and developers. The purpose of TestNG is to provide an easy-to-use, readable, structured, maintainable, and user-friendly environment for automated tests. NG stands for 'Next Generation' in TestNG. The high-end annotations, such as data providers, make cross-browser testing easier since you can test across multiple devices and browsers. Furthermore, the framework has an inbuilt mechanism for handling exceptions that prevent the program from terminating unexpectedly.
用于Java的TestNG框架是一个开源的高级测试自动化框架,旨在使测试人员开发人员都能受益。TestNG的目的是为自动化测试提供一个易于使用、可读性强、结构化、可维护且用户友好的环境。NG在TestNG中代表“下一代”。高级注解,如数据提供者,使跨浏览器测试更容易,因为您可以在多个设备和浏览器上进行测试。此外,该框架内置了异常处理机制,可防止程序意外终止。
343. Is it possible to skip a method or a code block in TestNG?
在TestNG中是否可以跳过某个方法或代码块?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc783a | 官方: 否 | 付费: 否
答案:
Yes, you can skip a particular test method or code by setting the 'enabled' parameter to ‘false’ in test annotations.
是的,您可以通过在测试注解中将“enabled”参数设置为‘false’来跳过特定的测试方法或代码。
@Test(enabled = false).
@Test(enabled = false)。
344. What is the best way to set priority for test cases in TestNG?
在TestNG中为测试用例设置优先级的最佳方式是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc783d | 官方: 否 | 付费: 否
答案:
Prioritizing the order of your test methods can be accomplished by defining a priority order. Consequently, the test will execute in accordance with the priority set.
可以通过定义优先级顺序来对测试方法的顺序进行优先级排序。因此,测试将根据设置的优先级执行。
Syntax: @Test(priority=2)
语法:@Test(priority=2)
Example: The following code demonstrates how to set the priority of a test case in TestNG.
示例:以下代码演示了如何在TestNG中设置测试用例的优先级。
package TestNG;
package TestNG;
import org.testng.annotations.*;
import org.testng.annotations.*;
public class SettingPriority {
public class SettingPriority {
@Test(priority=0)
@Test(priority=0)
public void scalermethod1() {
public void scalermethod1() {
}
@Test(priority=1)
@Test(priority=1)
public void scalermethod2() {
public void scalermethod2() {
}
@Test(priority=2)
@Test(priority=2)
public void scalermethod3() {
public void scalermethod3() {
}
}
Test Execution Sequence:
测试执行顺序:
ScalerMethod1
ScalerMethod1
ScalerMethod2
ScalerMethod2
ScalerMethod3
ScalerMethod3
345. What is Object Repository?
什么是对象仓库?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7840 | 官方: 否 | 付费: 否
答案:
Object Repository is a collection of web elements and their locators that belong to the Application Under Test (AUT). The QAs maintain all element locators in a separate file known as the property file (. properties) in Selenium. During execution, it serves as a means of identifying objects between the test script and the application.
对象仓库是归属于被测应用程序(AUT)的Web元素及其定位器的集合。在Selenium中,质量保证人员将所有元素定位器维护在一个单独的文件中,即属性文件(.properties)。在执行期间,它用作识别测试脚本与应用程序之间对象的工具。
346. What are the valuable steps to resolve issues while testing?
解决测试过程中问题的关键步骤有哪些?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7843 | 官方: 否 | 付费: 否
答案:
The following steps can assist in resolving issues during testing: - Record: Keep track of any problems that arise and resolve them.
以下步骤有助于解决测试过程中的问题: - 记录:跟踪出现的任何问题并加以解决。
- Report: Inform higher-level managers of the issues.
- Control: Establish a process for managing issues.
347. What qualities a software tester should have?
软件测试人员应具备哪些素质?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c5558d557c902bc7846 | 官方: 否 | 付费: 否
答案:
Any software tester's goal is to find out as many bugs and problems in the system so that the customers don't have to. Hence, a good software tester should have a keen eye for detail. They should know the ins and outs of the software they are testing and push every aspect of the software to its limits, to identify bugs that are hard to find with the software's regular use.
任何软件测试人员的目标都是尽可能多地发现系统中的错误和问题,这样客户就不必面对这些。因此,优秀的软件测试人员应具备敏锐的细节观察力。他们应该对自己测试的软件了如指掌,并将软件的每个方面推向极限,以识别那些在常规使用中难以发现的缺陷。
Having the domain knowledge of the application is essential. If a tester doesn't understand the specific problems the software is trying to solve, they won't be able to test it thoroughly.
具备应用领域的专业知识至关重要。如果测试人员不理解软件试图解决的具体问题,他们就无法对其进行全面测试。
A good tester should keep the end-user in mind when they are testing. Having empathy with the end-user helps the tester ensure that the software is accessible and usable. Simultaneously, the tester should possess basic programming skills to think from a developer's perspective, which allows them to notice common programming errors such as null-references, out-of-memory errors, etc.
优秀的测试人员在测试时应始终牢记最终用户。对最终用户抱有同理心有助于测试人员确保软件的可访问性和可用性。同时,测试人员应具备基本的编程技能,以便从开发者的角度思考,从而能够注意到常见的编程错误,如空引用、内存不足错误等。
Communication, both written and verbal, is an essential skill for a tester. A tester will frequently have to interact with both the developers and the management. They should be able to explain the bugs and problems found during testing to the developers. For each bug found, a good tester should provide a detailed bug report consisting of all the information a developer would need to fix that problem. They should be able to make a good case to the management if they are uncomfortable releasing the software if it contains unresolved issues.
书面和口头沟通是测试人员的基本技能。测试人员经常需要与开发人员和管理层互动。他们应能够向开发人员解释测试中发现的问题和错误。对于发现的每个缺陷,优秀的测试人员应提供详细的缺陷报告,包含开发人员解决问题所需的所有信息。如果他们对在存在未解决问题的情况下发布软件感到不安,他们应能向管理层提出充分的理由。
348. State difference between Selenium and Tosca.
请说明Selenium和Tosca之间的区别。
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e46 | 官方: 否 | 付费: 否
答案:
An automated testing strategy is the most reliable way to determine whether an application is usable and reliable. Today, Selenium and Tosca are the most popular automation testing tools.
自动化测试策略是确定应用程序是否可用和可靠的最可靠方法。如今,Selenium和Tosca是最流行的自动化测试工具。
Selenium vs Tosca -
Selenium与Tosca的区别 -
| Selenium | Tosca |
|---|---|
| Selenium is an open-source tool that is free to use. Selenium是一个免费使用的开源工具。 | Tosca is a paid and licensed automation tool. Tosca是一款付费且需要许可的自动化工具。 |
| The Selenium tool requires many scripts, such as Java, Python, Ruby, etc. Selenium工具需要大量脚本,例如Java、Python、Ruby等。 | Since it does not require scripting or coding, users are able to use it relatively easily. 由于它不需要脚本编写或编码,用户可以相对轻松地使用它。 |
| There is no built-in reporting. 没有内置的报告功能。 | Reporting capabilities are integrated into Tosca. They also have a control panel that allows them to view additional information, including graphs and pie charts. 报告功能已集成到Tosca中。他们还拥有一个控制面板,允许查看附加信息,包括图表和饼图。 |
| Selenium has low reusability for test data and artifacts. Selenium对测试数据和工件的重用性较低。 | Tosca has high reusability for test data and artifacts. Tosca对测试数据和工件的重用性较高。 |
| There is no support for SAP testing, SAP impact analysis, Business intelligence, and data warehouse test designs capabilities for autonomous SAP tools. 不支持SAP测试、SAP影响分析、商业智能和数据仓库测试设计等自主SAP工具的能力。 | Several SAP tools are supported by Tosca, including SAP testing, SAP impact analysis, Business intelligence, and data warehouse test designs. Tosca支持多种SAP工具,包括SAP测试、SAP影响分析、商业智能和数据仓库测试设计。 |
| It does not have an integrated object repository. As a result, managing too many scripts becomes challenging whenever the percentage increases. 没有集成的对象库。因此,当百分比增加时,管理太多脚本变得具有挑战性。 | The tool features a library of test-case objects. 该工具具有测试用例对象库。 |
| Automation type for Selenium is code-based. The Selenium Test Script can be created with a number of programming languages, including Java, C#, Python, etc. Selenium的自动化类型是基于代码的。Selenium测试脚本可以用多种编程语言创建,包括Java、C#、Python等。 | Tosca uses model-based automation.Rather than relying on scripts to automate tests, Tricentis Tosca applies a model-based testing method and builds a model of the application under test. Tosca使用基于模型的自动化。不依赖脚本来自动化测试,Tricentis Tosca应用基于模型的测试方法,并为被测应用程序构建模型。 |
| Test data management is not supported. 不支持测试数据管理。 | Test data management is supported. 支持测试数据管理。 |
| API testing is not possible with Selenium. 无法使用Selenium进行API测试。 | API testing is possible with Tosca. 可以使用Tosca进行API测试。 |
349. List out the main components of Tosca TestSuite.
列出Tosca TestSuite的主要组件。
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e49 | 官方: 否 | 付费: 否
答案:
As shown below, the Tosca Testsuite consists of four main components:
如下所示,Tosca Testsuite由四个主要组件组成:
- Tosca Commander: It is one of the essential parts of this tool for developing, managing, and analyzing test cases. It administers the test cases in the workspace.
- Tosca Executor: Commander is the middleware between the Test Repository and Tosca Executor, which forwards test cases from the Test Repository to the Test Executor. Next, the Tosca test executor executes test cases that have been developed on SUT (System Under Test).
- Tosca XScan (Tosca Wizard): It scans input fields on the screen and saves them as modules for Tosca Commander. Technical information is included in these modules in order to identify and direct screen elements.
- Test Repository/Common Repository: This is where complete workspaces are stored like test objects, test cases, etc. In order for several/user testers to work at the same time, the test repository is necessary.
350. What are the benefits of using Tosca as a test automation tool?
使用Tosca作为测试自动化工具有什么好处?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e4c | 官方: 否 | 付费: 否
答案:
The following are some advantages of using the Tosca test suite: - All-in-one tool with multiple features like support for model-based and risk-based testing approaches, automate both UI (User Interface) and non-UI applications, etc.
以下是使用Tosca测试套件的一些优点: - 一体化工具,具备多种功能,如支持基于模型和基于风险的测试方法,自动化UI(用户界面)和非UI应用程序等。
- Testers can enjoy a script-free experience when testing various applications. There is no need to write scripts and since scripting is not required, people obviously use it more often and more effectively.
- Able to cater to both small-scale and large-scale applications using Agile test methodology.
- Provides support for most common technologies such as SAP (System Applications and Products), Oracle, Java, SOA (Service Oriented Architecture), HTML (Hypertext Markup Language), and so on.
- Available at a reasonable cost, and provide a user-friendly GUI (Graphical user interface)
- As a result of its risk-based and model-based approach to test automation, Tosca simplifies end-to-end regression testing and reduces the time required for it.
- Copy-paste functionality for test cases and modules and the possibility to reuse assets.
351. What are different types of errors that are available in Tosca?
Tosca中有哪些不同类型的错误?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e4f | 官方: 否 | 付费: 否
答案:
The following types of errors can occur during Tosca execution: - Verification-Failure: A failure that occurs when expectations and actual results do not match for the verification step.
在Tosca执行过程中可能发生以下类型的错误: - 验证失败:当验证步骤的预期结果和实际结果不匹配时发生的失败。
- User Abort: This occurs when the tester stops the execution.
- Dialog-Failure: Apparently this is the result of some unhandled exceptions or steps. This error occurs when the application attempts to steer either a control that does not exist or is not in operation. Crashing or jamming applications (i.e., not responding) fall under this category too.
352. Explain how to run/execute tests using Tosca ExecutionLists?
解释如何使用Tosca ExecutionLists运行/执行测试?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e52 | 官方: 否 | 付费: 否
答案:
An ExecutionList is used to store completed test cases and run them all at once. The following ways can be followed in Tosca for executing ExecutionList: - Choose the Run option from Tosca Commander's context menu or press the F6 key under the Execution section.
ExecutionList用于存储已完成的测试用例并一次性运行它们。在Tosca中可以通过以下方式执行ExecutionList: - 从Tosca Commander的上下文菜单中选择“运行”选项,或在“执行”部分按下F6键。
- Simply right-click on each selected test case and select "Run".
- Use Ctrl + left mouse button to select multiple ExecutionLists and run.
- Data Science
- All Events
- My Events
353. Explain how to run/execute tests using Tosca ScratchBook?
解释如何使用Tosca ScratchBook运行/执行测试?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e55 | 官方: 否 | 付费: 否
答案:
During the creation or enhancement of a TestCase, ScratchBook executes a trial run to check its correctness or to validate if it is still incomplete. Also, you can run only individual TestSteps to perform partial test executions. In light of the fact that the compilation and execution results of TestCases will not be saved, the ScratchBook should only be viewed as a temporary aid when executing TestCase parts while building TestCases. In a ScratchBook, we have the following options for running test cases: - Run test cases as soon as they are created
在创建或增强测试用例期间,ScratchBook会执行试运行以检查其正确性或验证其是否仍不完整。此外,您还可以仅运行单个测试步骤来执行部分测试。鉴于测试用例的编译和执行结果不会被保存,ScratchBook在构建测试用例时仅应被视为执行测试用例部分的临时辅助工具。在ScratchBook中,我们有以下运行测试用例的选项:- 创建完成后立即运行测试用例
- Organize/arrange TestCases in the desired order, and then execute them.
354. Explain how to perform API testing in Tosca?
解释如何在Tosca中执行API测试?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e58 | 官方: 否 | 付费: 否
答案:
When building an application, the API layer (Application Programming Interface) is usually built first. The skills needed to build and maintain API tests make API testing a major challenge for organizations. As a result, testing becomes slow and inefficient, hindering the delivery of agile software.
在构建应用程序时,API层(应用程序编程接口)通常首先构建。构建和维护API测试所需的技能使API测试成为组织面临的主要挑战。因此,测试变得缓慢且低效,阻碍了敏捷软件的交付。
This technical obstacle is broken down by Tricentis Tosca, which simplifies API testing using a codeless, model-based approach. The Tosca API Scan provides a simple, no-code solution that supports the easy creation, management, and execution of automated API tests. One can easily test the performance and error handling of your API with its rapid end-to-end tests. To put it simply, it lets you design and automate API test cases.
这一技术障碍被Tricentis Tosca打破,它通过无代码、基于模型的方法简化了API测试。Tosca API扫描提供了一种简单、无代码的解决方案,支持自动化API测试的轻松创建、管理和执行。人们可以轻松地通过其快速的端到端测试来测试API的性能和错误处理。简单来说,它让您能够设计和自动化API测试用例。
The TOSCA API testing process is as follows: - API Services: Determine the API details and functionality for automation.
TOSCA API测试过程如下:- API服务:确定用于自动化的API详细信息和功能。
- API Scan: After scanning the API for a specific system, the API scan feature allows you to create Tosca modules.
- Create Test Case: Create test cases and perform cleanup with parameterization.
- Run: Execute tests and share reports with stack holders.
355. What is TDS (Test Data Service) Tosca?
什么是Tosca中的TDS(测试数据服务)?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e5b | 官方: 否 | 付费: 否
答案:
TDS (Test Data Service) is used in Tosca to manage test data in distributed environments. It enables us to store dynamic test data in a shared location, making it easy for test cases to read/update. Data stored in a shared location can be shared across multiple test cases since it is stored in a shared location. Additionally, it can be updated without opening Tosca, since it's considered a separate component. It enables you to manage your test data in distributed environments.
TDS(测试数据服务)在Tosca中用于在分布式环境中管理测试数据。它使我们能够将动态测试数据存储在共享位置,使测试用例易于读取/更新。存储在共享位置的数据可以跨多个测试用例共享,因为它存储在共享位置。此外,无需打开Tosca即可更新它,因为它被视为独立组件。它使您能够在分布式环境中管理测试数据。
356. Explain String Operation in Tosca Testsuite.
解释Tosca测试套件中的字符串操作。
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e5e | 官方: 否 | 付费: 否
答案:
String operations can be used in Tosca to verify or modify strings through regular expressions. For instance, it can include counting specific characters and words in a statement, replacing a word with another, or checking the format of a number. To perform String operations, you should download and import the AidPack module into your project.
字符串操作可在Tosca中通过正则表达式来验证或修改字符串。例如,它可以包括统计语句中的特定字符和单词、用另一个单词替换某个单词,或检查数字的格式。要执行字符串操作,您应将AidPack模块下载并导入到您的项目中。
Example:
示例:
For instance, we are searching for the character " - ", which should be replaced by the following character " / ". If the operation Global is selected, then "/ " is included wherever " - " occurs. In the following example, the " - ” character in 8-May-2012 is replaced by the " / ”.
例如,我们正在搜索字符“ - ”,该字符应替换为以下字符“ / ”。如果选择了Global操作,则“ - ”出现的位置都会包含“ / ”。在以下示例中,8-May-2012中的“ - ”字符被替换为“ / ”。
In the Settings dialog, the modified string should be stored as BufferStringOperation. In the following figure, modified string i.e., 8/May/2012 is stored in setting dialog buffer.
在设置对话框中,修改后的字符串应存储为BufferStringOperation。在下图中,修改后的字符串,即8/May/2012,存储在设置对话框缓冲区中。
357. What are the features of Tricentis Tosca?
Tricentis Tosca有哪些功能?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e61 | 官方: 否 | 付费: 否
答案:
Tosca's easy-to-use features make it popular with testers in the automotive, metal and mining, financial, and education industries. Tosca has the following important features: - Script-less test automation is possible using the drag and drop feature of modules, which simplifies software development.
Tosca易于使用的功能使其在汽车、金属和采矿、金融和教育行业的测试人员中广受欢迎。Tosca具有以下重要功能:- 通过模块的拖放功能可以实现无脚本测试自动化,这简化了软件开发。
- Execution is fast and Continuous Testing is available to support DevOps.
- Supports module-based test development where a model of the application under test (AUT) is created instead of scripts. A model can be used to represent the intended behavior of an AUT, as well as the testing strategy and the test environment.
- Supports risk-based testing to suggest the best test cases and calculate the risk contributions of each test case.
- Using it, business users can record their daily activities and then convert them into automated test cases, thereby eliminating the need for manual tests.
- Maintenance effort is minimal.
- Improve test stability and efficiency with a codeless approach to API testing.
- Test faster and more effectively by running multiple tests simultaneously across distributed infrastructures and virtual machines.
- Possible to automate both UI (User Interface) and non-UI applications like XML (Extensible Markup Language), SOAP (Simple Object Access Protocol), mainframe, etc.
358. How do you create a testsheet in Tosca?
如何在Tosca中创建测试表?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e64 | 官方: 否 | 付费: 否
答案:
As part of the TestCase-Design process, TestSheets are used as the main framework. The purpose of TestSheets is to organize/manage test data to follow a logical testing process. A test sheet should cover each requirement of the application. Below are the steps for creating a TestSheet: - Step 1: To begin with, right-click on the folder where you'd like to create a TestSheet.
作为测试用例设计过程的一部分,测试表被用作主要框架。测试表的目的是组织/管理测试数据,以遵循逻辑测试流程。测试表应涵盖应用程序的每个需求。以下是创建测试表的步骤:- 步骤1:首先,右键单击您想要创建测试表的文件夹。
- Step 2: From the mini toolbar, select Create TestSheet.
- Step 3: Specify the name of your TestSheet.
359. What does XL reference contain in Tosca?
Tosca中的XL引用包含哪些内容?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e67 | 官方: 否 | 付费: 否
答案:
TestCases may sometimes need access to the name of a TestCase / Instance, such as when storing data in TestDataService, and this can be acquired with {XL[Instance.Name]} or {XL[Instance]}. You must work with a TestCase template and a TestSheet to gain access to the name of a TestCase / Instance. When you want to mention the name of the TestCase in the TestCase template, use XL-reference [XL[Instance.Name]] or [XL[Instance]].
测试用例有时可能需要访问测试用例/实例的名称,例如在TestDataService中存储数据时,这可以通过{XL[Instance.Name]}或{XL[Instance]}获取。你必须使用测试用例模板和测试表来访问测试用例/实例的名称。当你想在测试用例模板中提及测试用例的名称时,请使用XL引用[XL[Instance.Name]]或[XL[Instance]]。
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万+职业规划
360. What are web services in Tosca?
Tosca中的Web服务是什么?
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e6a | 官方: 否 | 付费: 否
答案:
The Tosca Webservice Engine 3.0 utilizes web protocols like HTTP (Hypertext Transfer Protocol) to manage/control web services. It is also possible to manage/control web services using REST (Representational State Transfer) and SOAP (Simple Object Access Protocol). The Tosca Webservice Engine 3.0 is installed automatically during the standard installation of Tosca. In the System Requirements, you can find an overview of the prerequisites for using Tosca Webservice Engine 3.0. The following Standard subset XModules must be imported in order to be able to work with Webservice Engine 3.0: - TBox XEngines->Parameter Data
Tosca Webservice Engine 3.0利用HTTP(超文本传输协议)等Web协议来管理/控制Web服务。也可以使用REST(表述性状态转移)和SOAP(简单对象访问协议)来管理/控制Web服务。Tosca Webservice Engine 3.0在Tosca的标准安装过程中自动安装。在系统要求中,你可以找到使用Tosca Webservice Engine 3.0的先决条件概述。必须导入以下标准子集XModules才能使用Webservice Engine 3.0:- TBox XEngines->Parameter Data
- TBox XEngines->API
361. Explain the importance of Tosca API Scan.
解释Tosca API Scan的重要性。
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e6e | 官方: 否 | 付费: 否
答案:
API Scan by Tosca provides developers with a no-code solution that will make it easy to create, manage, and execute automated API tests. Test cases can be created for API testing and scenarios can be created for Tosca Orchestrated Service Virtualization with API Scan. In simple words, automating and designing API test cases are possible via API Scan. You can accomplish the following tasks with API Scan: - Develop test cases and modules.
Tosca的API Scan为开发者提供了一种无代码解决方案,使创建、管理和执行自动化API测试变得容易。可以为API测试创建测试用例,并可以为Tosca Orchestrated Service Virtualization与API Scan创建场景。简单来说,通过API Scan可以实现API测试用例的自动化和设计。你可以使用API Scan完成以下任务:- 开发测试用例和模块。
- Sync with the API Connection Manager
- Ensure seamless integration of API and Tosca Orchestrated Service Virtualization (OSV).
362. Explain TCShell.
解释TCShell。
- 知识点: 测试 (主题: tosca, testing;标签: interviewbit, tosca, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c7e58d557c902bc8e71 | 官方: 否 | 付费: 否
答案:
The TC-Shell is the command-line controller of Tosca Commander, providing access to most of Tosca Commander's functionality. It has two different modes of execution: interactive and scripted. - In interactive mode, the user is offered assistance and options and can access all of the functions of Tosca Commander's GUI (Graphical User Interface).
TC-Shell是Tosca Commander的命令行控制器,提供对Tosca Commander大部分功能的访问。它有两种不同的执行模式:交互式和脚本式。- 在交互模式下,用户会获得帮助和选项,并且可以访问Tosca Commander图形用户界面(GUI)的所有功能。
- In script mode, Shell runs commands from a script data file, so we must write a series of commands on a script data file and then run them. Users cannot intervene in this process. This mode is used for automating processes, for example, for working with an extensive portfolio of tests without supervision.
363. What are the possible types of errors that one can encounter in UFT?
在UFT中可能遇到哪些类型的错误?
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc9194 | 官方: 否 | 付费: 否
答案:
Following are the different types of errors that one can encounter in UFT: - Syntax Errors:
以下是在UFT中可能遇到的不同类型的错误:- 语法错误:
Syntax errors are typos or code that does not conform to the grammar of the VBscripting language. Syntax mistakes arise during code compilation and prevent the code from being executed unless the errors are corrected. Use the keyboard shortcut Ctrl+F7 to check the syntax, and the result will be presented as shown below. If the window does not appear, go to "View" and then "Errors."
语法错误是指拼写错误或不符合VB脚本语言语法的代码。语法错误在代码编译期间出现,除非修正错误,否则会阻止代码执行。使用键盘快捷键Ctrl+F7检查语法,结果将如下所示显示。如果窗口未出现,请转到“视图”,然后选择“错误”。
Logical Errors:
A logical error occurs when the script is syntactically accurate but produces unanticipated outcomes. The operation is usually not interrupted by logical errors, but the outcomes are erroneous. Logical errors can be caused by a variety of factors, including faulty assumptions or misinterpretations of the requirement, as well as poor program logic (using do-while instead of do-Until) or Infinite Loops.逻辑错误发生在脚本语法正确但产生意外结果时。逻辑错误通常不会中断操作,但结果是错误的。逻辑错误可能由多种因素引起,包括错误假设或对需求的误解,以及程序逻辑不佳(使用do-while而非do-Until)或无限循环。
Peer reviews and verification of the QTP output file/result file are two approaches to uncover logical errors and guarantee that the tool did what it was supposed to do.
同行评审和验证QTP输出文件/结果文件是发现逻辑错误并确保工具按预期工作的两种方法。Runtime Errors:
This type of error occurs during Run Time, as the name implies. Such failures occur when a script attempting to complete a task is unable to do so, and the script typically stops running because it is unable to continue.顾名思义,这种类型的错误发生在运行时间。当脚本尝试完成任务但无法完成时,会发生此类故障,脚本通常会停止运行,因为它无法继续。
Following are some well-known examples of Run-Time Errors:
以下是一些常见的运行时错误示例:
The file was not found, although the script attempted to read it.
脚本尝试读取文件,但未找到该文件。
The script is attempting to act on the item that was not found.
脚本试图对未找到的项目执行操作。
Array Index out of limits while accessing array items while dividing a number by Zero.
在数组项访问过程中,数组索引超出限制,同时发生除以零的运算。
364. What do you understand about output value in the context of UFT? What are the different types of output values present in UFT?
在UFT上下文中,你如何理解输出值?UFT中存在哪些不同类型的输出值?
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37c8558d557c902bc9198 | 官方: 否 | 付费: 否
答案:
A step in which an object property value is recorded at a given time in your test and stored in the desired location is known as an output value step. The saved values can be utilised as input in a test script at various points.
在测试中,某个对象属性值在特定时间被记录并存储到指定位置的步骤称为输出值步骤。保存的值可以在测试脚本的不同点用作输入。
The following are the different types of output values present in UFT: - Standard output value.
以下是UFT中存在的不同类型的输出值:- 标准输出值。
- Text /Text Area output value.
- Database output value.
- XML output value (from application/resources).
365. Is it feasible to run two UFT instances on the same workstation? If not, please explain why.
在同一工作站上运行两个UFT实例是否可行?如果不行,请解释原因。
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc919b | 官方: 否 | 付费: 否
答案:
No, we are unable to run two instances of UFT on the same computer. UFT, on the other hand, manages numerous instances of applications that will be evaluated. On the same PC, we can even operate on two distinct apps without interrupting UFT recording. To do so, you'll need to change a few UFT configuration parameters. From Automation -> Record and Run settings -> choose, select the option "Record and Run on any opened application." UFT, for example, can work in several windows of the Internet Explorer browser.
不,我们无法在同一台计算机上运行两个UFT实例。然而,UFT可以管理多个将被测试的应用程序实例。在同一台PC上,我们甚至可以操作两个不同的应用程序,而不会中断UFT录制。要做到这一点,你需要更改一些UFT配置参数。从自动化 -> 录制和运行设置 -> 选择,选择“在任何打开的应用程序上录制和运行”选项。例如,UFT可以在Internet Explorer浏览器的多个窗口中工作。
366. What are the advantages of using UFT as an automation tool for testing?
使用UFT作为测试自动化工具有哪些优势?
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc919e | 官方: 否 | 付费: 否
答案:
Following are the advantages of using UFT as an automation tool for testing: - UFT has record and playback capabilities.
以下是使用UFT作为测试自动化工具的优势:- UFT具有录制和回放功能。
- It records scripts on an active screen and assists testers in referring to screen object characteristics.
- UFT has a very good object recognition technique.
Integration and Support:
The tool's integration with various platforms, such as .net and mainframe, is fantastic. It works with both new and old web technologies, as well as terminal emulators and Windows thick-client apps. It facilitates continuous integration by connecting with Jenkins, Git, and other similar tools. UFT enables cross-browser testing and works with all major browsers, including Internet Explorer, Firefox, Chrome, and Apple Safari. d)Its connection with ALM allows us to store automation execution results in ALM and even schedule automation execution at a specific date and time. - Through an active screen, you can improve existing tests even if you don't have Automated Ultrasonic Testing (AUT).该工具与各种平台(如.net和大型机)的集成非常出色。它适用于新旧Web技术,以及终端模拟器和Windows厚客户端应用程序。它通过连接Jenkins、Git等类似工具促进持续集成。UFT支持跨浏览器测试,并与所有主要浏览器(包括Internet Explorer、Firefox、Chrome和Apple Safari)兼容。d)它与ALM的连接允许我们将自动化执行结果存储在ALM中,甚至可以在特定日期和时间安排自动化执行。- 通过活动屏幕,即使没有自动化超声测试(AUT),你也可以改进现有测试。
- It supports a variety of automation frameworks, including keyword-driven testing, modular testing, data-driven testing, and so on.
- It has an integrated development environment (IDE).
- It works with test management software such as Quality Center, Test Director, and Winrunner.
- Smoke, Regression, and Sanity are examples of suites that can be simply maintained.
- UFT supports Business Process Testing (BPT), a component-based testing framework that provides a strong and efficient platform for manually and automatically testing complete business processes. Its component reusability feature makes the testing process very fast, and it combines manual and automation tests with less duplication.
- It works with XML.
- QTP allows for test reporting for analysis purposes.
367. What do you understand about the synchronization point in the context of UFT? What are the different ways in which you can insert a synchronization point in UFT?
在UFT上下文中,你如何理解同步点?在UFT中插入同步点有哪些不同方式?
- 知识点: 测试 / 行为与软技能 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: behavioral | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc91a1 | 官方: 否 | 付费: 否
答案:
The timing interface between the Tool and the Application under test is known as the synchronization point. Synchronization point is a feature that allows you to set the time delay between two test script phases.
工具与被测应用程序之间的时序接口被称为同步点。同步点是一种功能,允许你设置两个测试脚本阶段之间的时间延迟。
For example, clicking on a link may take 1 second to load the website, 5 seconds, or even 10 seconds to load completely. The response time of the application server, network bandwidth, and client system capabilities are all issues to consider. The script will fail if the time varies unless the tester manages the time discrepancies intelligently.
例如,点击链接可能加载网站需要1秒,5秒,甚至10秒才能完全加载。应用程序服务器的响应时间、网络带宽和客户端系统能力都是需要考虑的问题。如果时间变化且测试人员不智能地管理时间差异,脚本将会失败。
Following are the different ways of inserting a synchronization point in UFT: - WaitProperty: WaitProperty is a method that performs a sync using the property name, value and timeout value as input. Because it is a dynamic delay, this option is recommended.
以下是UFT中插入同步点的不同方式:- WaitProperty:WaitProperty是一种方法,使用属性名、值和超时值作为输入执行同步。因为它是动态延迟,所以推荐使用此选项。
- Exist: Exist is a method that performs the sync using the Timeout value as an input. Because it is a dynamic delay, this option is recommended.
- Wait: Wait is a hardcoded sync point that waits regardless of whether or not an event has occurred. As a result, using Wait is discouraged, but it can be useful for shorter wait times like 1 or 2 seconds. For example, wait(5) would denote that the system will wait for 5 seconds.
- Sync Method: The Sync Method is only suitable for web applications with a constant lag between page loads.
- Inserting inbuilt Synchronization Points in QTP:Step 1: Enter into recording mode. If the user is not in Recording Mode, this option will be disabled.Step 2: Select "Design"-> "Synchronization Point".Step 3: We must choose the object that will serve as the Sync Point. The object window appears after you choose the object.
- Data Science
- All Events
- My Events
368. How do you close the second browser that has been opened using UFT?
你如何关闭使用UFT打开的第二个浏览器?
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc91a4 | 官方: 否 | 付费: 否
答案:
The "creation time" feature can be used to determine which browser instance was opened after another. This is nothing more than a counter for each browser instance that is launched. It starts at 0 for the first one and goes up from there. You can use the following code to close the second browser that has been opened:
“创建时间”功能可用于确定哪个浏览器实例是在另一个之后打开的。这不过是为每个启动的浏览器实例设置的计数器。它从0开始,然后逐渐递增。你可以使用以下代码关闭已打开的第二个浏览器:
Browser("creationtime:=1").Close
Browser("creationtime:=1").Close
369. What is the QTP Local Repository's extension? What does the .mtr extension stand for?
QTP本地对象仓库的扩展名是什么?.mtr扩展名代表什么意思?
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc91a7 | 官方: 否 | 付费: 否
答案:
The extension for a local repository in QTP is .bdb.
QTP中本地对象仓库的扩展名是.bdb。
The .mtr file is a binary file that provides information about checkpoints and other things. To double-check that the .bdb file is a local object repository, rename it with the extension .tsr and open it in Object Repository Management (ORM). The same objects that appear in the Object Repository will appear here. If you try the same thing with a .mtr file, it will not work.
.mtr文件是一个二进制文件,提供关于检查点和其他内容的信息。要确认.bdb文件是本地对象仓库,可以将其扩展名改为.tsr并在对象仓库管理(ORM)中打开。对象仓库中出现的相同对象也会在这里显示。如果你尝试对.mtr文件做同样的操作,则不会成功。
370. What do you understand about GetRoProperty, SetToProperty and GetToProperty in the context of UFT?
在UFT的背景下,你如何理解GetRoProperty、SetToProperty和GetToProperty?
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc91ae | 官方: 否 | 付费: 否
答案:
GetRoProperty: GetRoProperty is a built-in method for retrieving the object property's runtime value. There are four steps to using the GetRoProperty method. - In the Object Repository, make a note of the object on which you wish to utilise the GetRoProperty method.
GetRoProperty:GetRoProperty是一个内置方法,用于检索对象属性的运行时值。使用GetRoProperty方法有四个步骤。- 在对象仓库中,记下你想要使用GetRoProperty方法的对象。
- Identifies the run-time attribute that could be used for the recorded item. Object Spy is a tool that you can utilise.
- Retrieve the identified Run-time property using the GetRoProperty method and save the value in a variable.
Use this figure to make more deductions.
SetToProperty and GetToProperty: SetToProperty and GetToProperty are two methods for changing a property's value. - Let us consider a Web Button stored in the Object Repository.SetToProperty和GetToProperty:SetToProperty和GetToProperty是两种更改属性值的方法。- 让我们考虑对象仓库中存储的一个Web按钮。
- UFT produces a replica of this object called Test Object and compares it to the Run-Time Object when the test is run.
- You may get the value of a property of Test Object using GetToProperty.
- You can alter the value of a Test Object's property with SetToProperty.
- This test object, as well as any changes you make to the object properties using the SetToProperty method, is deleted when the test is finished.
- When the test is re-run, a new copy of the test object is produced in the object repository with the original property values.
371. What do you understand by data tables in the context of UFT? Explain the different types of data tables. Describe some of the data table object methods.
在UFT的背景下,你如何理解数据表?解释不同类型的数据表。描述一些数据表对象方法。
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc91b1 | 官方: 否 | 付费: 否
答案:
A DataTable, like MS Excel, aids testers in the creation of data-driven test scenarios that may be used to repeat an Action. Datatables are divided into two categories: - Local Datatable: Each action has its own private data table, sometimes known as a local data table, which can be accessed across actions.
数据表(DataTable)类似于MS Excel,帮助测试人员创建数据驱动的测试场景,这些场景可用于重复执行操作。数据表分为两类:- 本地数据表:每个操作都有自己私有的数据表,有时称为本地数据表,可以在跨操作中访问。
Global Datatable: Each test has a single global data sheet that is accessible across all actions.
The data sheet can be found under QTP's "Data" tab, as seen below.数据表可以在QTP的“Data”选项卡下找到,如下所示。
The following table lists some of the data table object methods:
下表列出了一些数据表对象方法:
| Method 方法 | Description 描述 | Syntax 语法 |
|---|---|---|
| AddSheet | Adds the supplied sheet to the data table at runtime. 在运行时将提供的表添加到数据表中。 | DataTable.AddSheet (SheetName) |
| DeleteSheet | The given sheet is removed from the run-time data table. 从运行时数据表中删除给定的表。 | DataTable.DeleteSheet( SheetID) |
| Export | The Datatable is exported to a new file in the provided location. 将数据表导出到指定位置的新文件中。 | DataTable.Export(FileName) |
| ExportSheet | Run-time export of a specific sheet of the Datatable. 导出数据表中特定表的运行时内容。 | DataTable.ExportSheet(FileName, SheetName) |
| GetSheet | The given sheet from the run-time data table is returned. 从运行时数据表返回给定的表。 | DataTable.GetSheet(SheetID) |
| GetCurrentRow | Returns the active row of the global sheet's run-time data table.2 返回全局表运行时数据表的当前活动行。2 | DataTable.GetCurrentRow |
| GetParameterCount | The number of columns in the run-time data is returned. 返回运行时数据中的列数。 | DataTable.GetParameterCount |
| GetRowCount | The number of rows in the Global Sheet's run-time data table is returned. 返回全局表运行时数据表中的行数。 | DataTable.GetRowCount |
| GetSheetCount | The total number of sheets in the run-time data table is returned. 返回运行时数据表中的总表数。 | DataTable.GetSheetCount |
| SetCurrentRow | Sets the current row's focus to the specified row number. 将当前行的焦点设置为指定的行号。 | DataTable.SetCurrentRow(RowNumber) |
| SetNextRow | Sets the focus of the run-time data table's next row. 将运行时数据表的焦点设置为下一行。 | DataTable.SetNextRow |
| SetPreviousRow | Sets the previous row's focus in the run-time data. Table 将运行时数据表中上一行的焦点设置为指定行。表 | DataTable.SetPrevRow |
372. How can you run numerous QTP scripts at the same time?
如何同时运行多个QTP脚本?
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc91b4 | 官方: 否 | 付费: 否
答案:
Using the TestBatchRunner tool, we may run numerous QTP scripts at once.
使用TestBatchRunner工具,我们可以同时运行多个QTP脚本。
373. What do you understand about actions in the context of UFT? How can you import an action into a test?
在UFT的背景下,你如何理解操作?如何将操作导入到测试中?
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc91b7 | 官方: 否 | 付费: 否
答案:
In UFT, your test will be divided into "logical units" or "Business Processes" with the help of actions. Actions aid in the creation of a more modular and efficient script. When a script is first written, it just has one action. However, depending on your needs, you can add more Actions to your Micro Focus UFT Script.
在UFT中,借助操作,你的测试将被划分为“逻辑单元”或“业务流程”。操作有助于创建更模块化和高效的脚本。当脚本首次编写时,它只包含一个操作。但是,根据你的需求,你可以向Micro Focus UFT脚本中添加更多操作。
Actions are divided into two categories:
操作分为两类:
- Reusable Actions: Actions that can be reused in other tests. They can be used numerous times in the same Test Script.
Non-Reusable Actions: Actions that aren't reusable can't be used in other tests. They can only be called once in the same script. When an action becomes large, it's a good idea to split it out. You have two options for splitting an existing activity.
The selected action is split into two sibling actions because they are independent of each other.所选操作被拆分为两个同级操作,因为它们彼此独立。
Nested Action splits the chosen action into a parent action, the last step of which invokes the second, child action.
嵌套操作将所选操作拆分为一个父操作,其最后一步调用第二个子操作。
Importing Actions into a Test can be done in two ways: - Call to COPY of an Action: When you make a Copy of an Action, the action is duplicated in its entirety into the calling test, including checkpoints, parameterization, and the relevant action tab in the Data Table. You can make modifications to a copied action without affecting or being affected by any other test when you insert a copy of an existing action. Both reusable and non-reusable actions can be duplicated.
将操作导入测试可以通过两种方式完成:- 调用操作的副本:当您制作操作的副本时,该操作会被完整复制到调用测试中,包括检查点、参数化和数据表中的相关操作选项卡。您可以对复制的操作进行修改,而不会影响其他测试或受其影响,当您插入现有操作的副本时也是如此。可复用和不可复用的操作均可复制。- Call to an EXISTING Action: In the calling test, calls to actions are read-only. Only the test in which they were created can be changed. Allows you to reuse the same action across multiple tests and simplifies test maintenance. Only "Reusable" actions are available for calls.
374. What do you understand about descriptive programming in the context of UFT? What are the different types of descriptive programming? Explain.
关于UFT中的描述性编程,您了解多少?描述性编程有哪些不同类型?请解释。
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: coding
- 分类: fullstack
- id: 69b37c8558d557c902bc91ba | 官方: 否 | 付费: 否
答案:
Descriptive programming is used to perform operations on an AUT object whose definition isn't recorded in the Object Repository. You can use this approach to skip the Object Repository and provide the Object Description directly in the statement. An object name is merely a way to link a scripted item to its description in a repository. The script should run even if the object name in your script and object repository is changed.
描述性编程用于对未在对象仓库中记录定义的AUT对象执行操作。您可以使用此方法绕过对象仓库,直接在语句中提供对象描述。对象名称只是一种将脚本项与其在仓库中的描述相关联的方式。即使脚本和对象仓库中的对象名称发生变化,脚本也应能运行。
Following are the different types of descriptive programming:
以下是描述性编程的不同类型:
Static Descriptive Programming:
静态描述性编程:
In the Static Method, you specify an object's attribute in the following pattern for object identification.
在静态方法中,您按照以下模式指定对象的属性以进行对象识别。
property:=values,
property:=values,
This format is known as a property value pair, and it is delimited by inverted commas. If your object has many descriptions for identification, use commas to separate them.
此格式称为属性值对,并用引号分隔。如果您的对象有多个描述用于识别,请用逗号分隔它们。
Dynamic Descriptive Programming:
动态描述性编程:
The second way to accomplish the same goal is to use Dynamic Descriptive Programming. It will be highly tedious to specify all the property value pairs for each sentence if your script uses the descriptive programming object candidate several times. In such instances, you might take advantage of QTP's Description Class. A description object's syntax is as follows:
实现相同目标的第二种方式是使用动态描述性编程。如果您的脚本多次使用描述性编程对象候选,则为每个语句指定所有属性值对将非常繁琐。在此类情况下,您可以利用QTP的描述类。描述对象的语法如下:
Set MyDescription = Description.Create();
Set MyDescription = Description.Create();
MyDescription("property").Value = "property-value";
MyDescription("property").Value = "property-value";
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万+职业规划
375. What do you understand about checkpoints in the context of UFT? Explain the different types of checkpoints available in UFT.
关于UFT中的检查点,您了解多少?请解释UFT中可用的不同类型检查点。
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc91be | 官方: 否 | 付费: 否
答案:
In UFT, a checkpoint is a point where the current value of an Object's specified properties is compared to the intended value. If the present and predicted values are equal, the status is PASS; otherwise, the status is FAIL.
在UFT中,检查点是一个将对象指定属性的当前值与预期值进行比较的点。如果当前值与预测值相等,则状态为PASS;否则,状态为FAIL。
Following are the different types of checkpoints available in UFT:
以下是UFT中可用的不同类型的检查点:
- Standard Checkpoint: During a run session, it compares the expected values of object properties captured during recording to the object's current values.
- Page Checkpoint: A Page Checkpoint is a Standard Checkpoint established for a web page. It's used to count how many links and images are on a page. Page Checkpoints can be used to monitor Load Time, or the time it takes for a web page to load.
- Bitmap Checkpoint: A Bitmap Checkpoint is a checkpoint that allows a user to examine the bitmap of an image or a complete web page. It compares real and expected images on a pixel-by-pixel basis.
- Image Checkpoint: An image checkpoint allows you to inspect properties such as an online image's source file location. Unlike Bitmap Checkpoint, image checkpoint does not allow you to examine pixels (bitmaps).
- Text Checkpoint: A text checkpoint is a tool for ensuring that expected text in a web page or application is present. This text could be from a specific area of the app or a small portion of the text on the screen.
- Accessibility Checkpoint: It ensures that Web-based technologies and information systems follow the World Wide Web Consortium's (W3C) instructions and recommendations. These guidelines make it simple for impaired people to use the internet.
- Database Checkpoint: A Database Checkpoint runs a query in real-time, and the database values are saved as intended. During runtime, the identical query is repeated and the actual and expected values are compared.
- Table Checkpoint: A Table Checkpoint allows you to examine the contents of cells in a table (grid) that appears in your environment on the fly. You can also inspect table parameters such as row height, cell width, and so on. Table Checkpoint is similar to Database Checkpoint in that it allows you to save your work.
- XML Checkpoint: You may verify XML Data, XML Schema, and XML Data using XML Checkpoints.
376. What are the features of UFT?
UFT有哪些特性?
- 知识点: 测试 (主题: uft, testing;标签: interviewbit, uft, topic-specific, testing)
- 类型: technical | 难度: easy | 子类型: concept
- 分类: fullstack
- id: 69b37c8558d557c902bc91c1 | 官方: 否 | 付费: 否
答案:
UFT has a lot of functionality, but it's also quite straightforward to understand and train employees on. The following are a few excellent features that offer a lot of value to scripting: - Test Combinations Generator (TCG): This software assists in the creation of test configurations by utilising test parameters and their possible values to generate different data combinations.
UFT功能丰富,但也相当易于理解和培训员工。以下是一些为脚本编写提供巨大价值的优秀特性:- 测试组合生成器(TCG):该软件通过利用测试参数及其可能值来生成不同的数据组合,协助创建测试配置。
- Insight Recording: It recognises controls solely based on their look, rather than their native properties. This can be handy for testing controls in environments where UFT isn't supported, or even on a distant machine running a non-Windows operating system. UFT recognises the controls in the application by matching them to the images saved with each of the Insight test objects when it runs the test or component.
- UFT offers built-in reporting capabilities as well as the ability to create customised output files that show exactly where a test step failed and when it did so, as well as the timestamp.
- Runtime objects for Windows are supported. We can use the Windows Runtime application to record and perform tests. With the Windows Runtime application, we may create object repositories.
377. 你如何在项目中保证代码质量与可维护性?
- 知识点: 测试 / DevOps/云 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: code-quality, maintainability, lint, testing, ci-cd, code-review, solid)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 695cc0341da553795622a6d4 | 官方: 是 | 付费: 否
答案:
TL;DR通过统一规范、自动化检查、测试体系、代码评审、CI/CD 和设计原则(如 SOLID)来持续保障质量与可维护性。
你需要遵循以下步骤来确保代码质量和可维护性:
- 在整个项目中使用一致的编码标准和风格指南
- 使用 ESLint 或 Prettier 等工具强制执行严格的 lint 与格式化
- 使用自动化测试框架实现单元测试与集成测试
- 通过代码评审流程识别并修复问题
- 使用持续集成/持续部署(CI/CD)流水线在开发生命周期中保持质量
- 遵循最佳实践,例如 SOLID 原则与设计模式,以提升组织性与复用性
378. 谈谈 Mock(模拟对象)和 Stub(桩)的区别。
- 知识点: 测试 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: unit-testing, mock, stub, test-double)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 695cc0351da553795622a7a0 | 官方: 是 | 付费: 否
答案:
TL;DRMock 与 Stub 都是单元测试中常见的测试替身(Test Double),选择取决于测试目标与需要验证的行为。
Mocks(模拟对象)和 stubs(桩)是两种常用于单元测试的方法。你可以根据测试目标选择其中之一或同时使用。以下是 mock 与 stub 的对比:
379. 如何测试静态方法(Static Method)?
- 知识点: 测试 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: java, testing, junit;标签: PowerMock, static methods, unit test)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 6965de59fa809e6d3886523d | 官方: 是 | 付费: 否
答案:
答案可以使用 PowerMock(幂等模拟框架)库来测试静态方法。
380. 怎么利用 JUnit 来测试一个方法的异常(Exception)?
- 知识点: 测试 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: java, testing, junit;标签: JUnit, exceptions, assertThrows, @Test expected)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 6965de59fa809e6d38865241 | 官方: 是 | 付费: 否
答案:
答案在题目中没有提供答案,因此这里给出一个通用回答:在 JUnit 4 可以使用 @Test(expected=SomeException.class) 或 try/catch + fail();在 JUnit 5 推荐使用 Assertions.assertThrows(SomeException.class, () -> methodCall)。
381. 在 DevOps(开发运维一体化)环境中你如何进行测试(Testing)?
- 知识点: 测试 / DevOps/云 (主题: testing, cicd, automation-testing, devops;标签: Testing, Q34, DevOps)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 696601a6fa809e6d388a2fc6 | 官方: 是 | 付费: 否
答案:
答案DevOps 中测试应融入交付流程并尽量自动化:在代码变更进入部署前通过自动化测试进行验证,并把结果持续反馈给开发。测试贯穿生命周期(如单测、集成、回归等),实现更早发现缺陷、更快修复,从而支持更高质量与更快速的交付。
382. 什么是持续测试(Continuous Testing)和自动化测试(Automation Testing)?
- 知识点: 测试 / DevOps/云 (主题: continuous-testing, automation-testing, cicd;标签: Testing, Q35, DevOps)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 696601a6fa809e6d388a2fc9 | 官方: 是 | 付费: 否
答案:
答案自动化测试是用工具与脚本替代手工测试,可反复执行且无需人工介入。持续测试则把自动化测试嵌入 DevOps 交付流水线,让每次构建都能持续被验证并快速得到反馈,避免问题流入后续阶段。这样能显著加快迭代节奏,开发也不必每次改动都手动重建并重跑全部测试。
383. 持续测试在 DevOps 中起什么作用?
- 知识点: 测试 / DevOps/云 (主题: continuous-testing, devops, quality;标签: Testing, Q38, DevOps)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 696601a7fa809e6d388a30f0 | 官方: 是 | 付费: 否
答案:
答案持续测试强调“早测、常测”,贯穿开发与交付过程。它能持续向开发反馈结果,确保每次代码变更都被验证并尽早发现缺陷,从而提升质量、降低返工成本、缩短上市时间,并通过更稳定的交付提高客户满意度。
384. DevOps 如何帮助组织降低软件故障风险?
- 知识点: 测试 / DevOps/云 (主题: reliability, monitoring, continuous-testing, postmortem;标签: Reliability, Q41, DevOps)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 696601a7fa809e6d388a3147 | 官方: 是 | 付费: 否
答案:
答案DevOps 通过协作、持续测试与监控来降低故障风险:自动化测试更早发现缺陷,监控与日志提升可观测性并快速发现异常;同时 DevOps 强调复盘与从错误中学习,把改进措施沉淀为流程与自动化,使同类问题不易再次发生。
385. 在进行测试时需要注意什么?
- 知识点: 测试 (主题: testing, qa, regression;标签: 测试执行, 风险优先, 回归测试)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 696f392a120fcc15911b7dee | 官方: 是 | 付费: 否
答案:
答案重点关注:1)明确需求与验收标准(Acceptance Criteria),避免“测了但不对题”;2)测试环境(Test Environment)一致性(版本、配置、依赖、数据);3)覆盖关键路径与边界条件(Boundary Conditions)(异常/空值/并发/权限);4)记录证据与可复现步骤(日志、截图、时间点、请求ID);5)风险优先(高频高损先测);6)回归影响面评估(改动相关模块/接口);7)与开发/产品及时同步假设与阻塞点(Blocking Points)。
386. 你觉得测试报告包含哪些要素?
- 知识点: 测试 (主题: testing, qa, reporting;标签: 测试报告, 缺陷统计, 发布建议)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 696f3938120fcc15911b8b2a | 官方: 是 | 付费: 否
答案:
答案测试报告建议包含:测试范围(版本/需求/模块)、测试环境(构建号、配置、数据集)、测试策略与类型(功能/回归/兼容/性能等)、执行概览(用例总数、通过/失败/阻塞)、缺陷统计(按严重级别/模块/状态)、关键缺陷说明(影响、复现步骤、证据、临时绕过)、风险与未测项(原因与影响)、结论与发布建议(Go/No-Go),以及后续行动项与负责人。
387. 说说你对白盒测试(White-box Testing)和黑盒测试(Black-box Testing)的理解。
- 知识点: 测试 (主题: testing, white-box, black-box;标签: 白盒测试, 黑盒测试, 测试方法)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 696f393b120fcc15911b8db4 | 官方: 是 | 付费: 否
答案:
答案黑盒测试(Black-box Testing)从外部视角验证功能与行为是否符合需求,不关心内部实现,常用等价类(Equivalence Partitioning)、边界值(Boundary Value Analysis)、状态迁移(State Transition)、因果图(Cause-Effect Graph)等方法;白盒测试(White-box Testing)基于代码结构与逻辑进行验证,关注语句/分支/条件/路径覆盖率(Coverage),常用于单元测试(Unit Testing)、代码级缺陷发现。实际项目中两者结合:黑盒保障业务正确性,白盒提升代码质量与覆盖。
388. 当你发现一个 bug,但开发人员不认为这是 bug,你怎么办?
- 知识点: 测试 / 行为与软技能 (主题: testing, bug-triage, collaboration;标签: 缺陷争议, 沟通协作, 验收标准)
- 类型: behavioral | 难度: medium | 子类型:
- 分类: fullstack
- id: 696f3949120fcc15911b96d0 | 官方: 是 | 付费: 否
答案:
答案我会先对齐“预期是什么”:引用需求/验收标准(Acceptance Criteria)/产品说明,补齐最小可复现步骤(Minimal Reproduction Steps)与证据(日志、截图、录屏、请求包、数据样例),明确影响范围与严重性(Severity);然后和开发一起复现与定位,区分是需求理解差异、环境/数据差异还是实现缺陷。若仍有争议,拉产品/PO(Product Owner)做裁决并记录结论(算Bug/算Change/算Known Issue),同时给出临时绕过方案(Workaround)与风险说明,避免口头争论无结论。
389. 软件测试都有哪些常见模型?
- 知识点: 测试 / 操作系统与网络 (主题: testing, sdlc, process-model;标签: V模型, 敏捷测试, 质量门禁)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 696f394e120fcc15911b997b | 官方: 是 | 付费: 否
答案:
答案常见与测试强相关的过程模型包括:瀑布模型(Waterfall Model)(阶段线性推进)、V模型(V-Model)(开发阶段与测试阶段一一对应,强调验证与确认)、螺旋模型(Spiral Model)(迭代+风险驱动,每轮做风险评估与验证)、敏捷模型(Agile Model)(迭代交付、持续测试、自动化回归)、DevOps/持续交付(Continuous Delivery)(CI/CD中集成自动化测试与质量门禁(Quality Gate))。面试中回答要点:模型如何影响测试介入时机、反馈速度与风险控制方式。
390. R 中的 t-test(t.test())是什么?
- 知识点: 测试 / 数据工程与数据科学/AI / 编程语言基础 (主题: r, statistics, hypothesis-testing)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 69703ee2120fcc15912fccb9 | 官方: 是 | 付费: 否
答案:
答案用于通过 t.test() 函数判断两组的均值是否相等。
t.test() function.
t.test()函数。
391. 请描述一次你做过的代码优化/重构(Code Refactoring):为什么做、怎么做、效果如何?
- 知识点: 测试 / 系统设计/架构 / 行为与软技能 (主题: refactoring, testing, architecture;标签: Refactoring, Optimization)
- 类型: behavioral | 难度: medium | 子类型: behavioral
- 分类: fullstack
- 公司: rea-group
- id: 697093b6120fcc159138b681 | 官方: 是 | 付费: 否
答案:
答案用 STAR + 技术细节:为什么要重构(性能/可维护性/团队效率/架构债)、你采取的策略(模块拆分、接口抽象、引入缓存、消除重复、加测试)、如何控制风险(feature flag、分阶段发布、回滚)、最终指标提升(响应时间、故障率、交付周期)。
392. 你如何确保代码的质量?
- 知识点: 测试 / DevOps/云 (主题: testing, ci-cd, quality;标签: code-quality, testing, code-review)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- 公司: Telstra
- id: 69709b28120fcc15913a2d66 | 官方: 是 | 付费: 否
答案:
答题要点- 标准:编码规范(Coding Standards)、可读性、可测试性、可维护性
- 机制:Code Review、单测/集成测试、静态扫描、CI门禁
- 运行期:日志、指标、告警、灰度发布与回滚
示例回答我会先用统一的编码规范与Lint/格式化工具保证一致性;关键逻辑配套单元测试(Unit Testing)与集成测试(Integration Testing),并在CI(Continuous Integration)里做静态扫描与覆盖率门禁(Coverage Gate)。上线后结合日志与指标观察质量,必要时用灰度发布(Canary Release)与快速回滚(Rollback)降低风险。
393. 你如何确保项目中的代码质量(code quality)和可维护性(maintainability)?
- 知识点: 测试 / 行为与软技能 (主题: software-engineering, testing, ci;标签: Code Review, Testing, CI, Refactoring)
- 类型: behavioral | 难度: medium | 子类型:
- 分类: fullstack
- id: 69772fbba39c9c5c3a8beb08 | 官方: 是 | 付费: 否
答案:
答案我会通过编码规范(coding standards)与架构约束(architecture constraints)(模块化(modularity)、分层(layering)、接口边界(interface boundaries))提升可读性(readability);用 Code Review(代码审查)、静态检查(static analysis)(Lint/SAST)、自动化测试(automated testing)(金字塔(test pyramid):单测(unit test)/集成(integration test)/端到端(end-to-end test))与 CI 质量门禁(quality gates)控制风险;同时用文档(documentation)与注释(comments)记录关键决策(key decisions),持续重构(refactoring)去除坏味道(code smells),并用可观测性(observability)与性能基线(performance baselines)监控质量退化(quality degradation),确保长期可维护。
394. 你在分析中常用哪些统计方法(statistical methods)?分别在什么场景使用?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: statistics, experimentation;标签: ab-testing, regression, cohort)
- 类型: technical | 难度: medium | 子类型:
- 分类: fullstack
- id: 69782c8aa39c9c5c3ab881f8 | 官方: 是 | 付费: 否
答案:
答案常用方法
我常用的方法包括:描述统计(descriptive statistics)与置信区间(confidence intervals)(快速理解分布(distribution)与不确定性(uncertainty))、假设检验(hypothesis testing)与 A/B 测试(A/B testing)(评估策略或改动效果)、回归分析(regression analysis)(量化变量关系与控制混杂(confounding))、分群/留存分析(cohort/retention analysis)(理解用户结构与生命周期(lifecycle))、以及时间序列(time series)(看趋势(trend)、季节性(seasonality)与异常(anomaly))。选择方法时会优先明确问题类型(比较/预测/解释)与数据假设(independence、distribution、sample size)。
- A/B & 假设检验:对比策略效果(转化、CTR、留存等)
- 回归:解释影响因素、控制混杂、做敏感性分析
- 分群/漏斗/留存:产品增长与用户行为分析
- 时间序列:趋势与异常检测(季节性、节假日效应)
395. Explain partitioning in ETL and write its type.
解释ETL中的分区并写出其类型。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab40e | 官方: 否 | 付费: 否
答案:
Essentially, partitioning is the process of dividing up a data storage area for improved performance. It can be used to organize your work. Having all your data in one place without organization makes it more difficult for digital tools to find and analyze the data. It is easier and faster to locate and analyze data when your data warehouse is partitioned. The following reasons make partitioning important: - Facilitate easy data management and enhance performance.
本质上,分区是将数据存储区域划分为若干部分以提高性能的过程。它可以用于组织工作。将所有数据放在一个未组织的地方会使数字工具更难找到和分析数据。当数据仓库被分区时,定位和分析数据会更容易且更快。以下原因使分区变得重要:- 便于数据管理和提升性能。
- Ensures that all of the system's requirements are balanced.
- Backups/recoveries made easier.
Simplifies management and optimizes hardware performance.
Types of Partitioning - - Round-robin Partitioning: This is a method in which data is evenly spread among all partitions. Therefore, each partition has approximately the same number of rows. Unlike hash partitioning, the partitioning columns do not need to be specified. New rows are assigned to partitions in round-robin style.分区类型- - 轮询分区:这是一种将数据均匀分布到所有分区的方法。因此,每个分区大约有相同的行数。与哈希分区不同,无需指定分区列。新行以轮询方式分配给各个分区。
- Hash Partitioning: With hash partitioning, rows are evenly distributed across partitions based on a partition key. Using a hash function, the server creates partition keys to group data.
396. Write different ways of updating a table when SSIS (SQL Server Integration Services) is being used.
写出使用SSIS(SQL Server集成服务)时更新表格的不同方式。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab411 | 官方: 否 | 付费: 否
答案:
In order to update a table in SSIS, the following steps can be taken: - Use the SQL command.
要在SSIS中更新表格,可以采取以下步骤:- 使用SQL命令。
- For storing stage data, use staging tables.
- Keep data in a cache that occupies a limited amount of space and needs to be refreshed frequently.
- Scripts can be used for scheduling tasks.
- When updating MSSQL, use the full database name.
397. Write some ETL test cases.
编写一些ETL测试用例。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab414 | 官方: 否 | 付费: 否
答案:
Among the most common ETL test cases are: - Mapping Doc Validation: Determines whether the Mapping Doc contains ETL information.
最常见的ETL测试用例包括:- 映射文档验证:确定映射文档是否包含ETL信息。
- Data Quality: In this case, every aspect of the data is tested, including number Check, Null Check, Precision Check, etc.
- Correctness Issues: Tests for missing, incorrect, non-unique, and null data.
- Constraint Validation: Make sure that the constraints are properly defined for each table.
398. Explain ETL mapping sheets.
解释ETL映射表。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab417 | 官方: 否 | 付费: 否
答案:
Typically, ETL mapping sheets include full information about a source and a destination table, including every column as well as their lookup in reference tables. As part of the ETL testing process, ETL testers may need to write big queries with multiple joins to validate data at any point in the testing process. Data verification queries are significantly easier to write using ETL mapping sheets.
通常,ETL映射表包含源表和目标表的完整信息,包括每一列以及它们在参考表中的查找。作为ETL测试过程的一部分,ETL测试人员可能需要在测试过程中的任何时间点编写带有多个连接的大查询来验证数据。使用ETL映射表可以显著简化数据验证查询的编写。
399. How ETL testing is used in third party data management?
ETL测试如何用于第三方数据管理?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab41a | 官方: 否 | 付费: 否
答案:
Different kinds of vendors develop different kinds of applications for big companies. Consequently, no single vendor manages everything. Consider a Telecommunication project in which billing is handled by one company and CRM by another. For instance, if a CRM requires data from the company that is managing the billing, now that company will be able to receive the data feed from another company. In this case, we will use the ETL process to load data from the feed.
不同类型的供应商为大公司开发不同类型的应用程序。因此,没有单一的供应商能管理所有事务。考虑一个电信项目,其中计费由一家公司处理,CRM由另一家公司处理。例如,如果CRM需要来自管理计费的公司的数据,那么那家公司将能够接收到另一家公司的数据流。在这种情况下,我们将使用ETL过程从数据流中加载数据。
400. Explain how ETL is used in data migration projects.
解释ETL在数据迁移项目中是如何使用的。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab41d | 官方: 否 | 付费: 否
答案:
Data migration projects commonly use ETL tools. As an example, if the organization managed the data in Oracle 10g earlier and now they want to move to SQL Server cloud database, the data will need to be migrated from Source to Target. ETL tools can be very helpful for carrying out this type of migration. The user will have to spend a lot of time writing ETL code. The ETL tools are therefore very useful since they make coding simpler than P-SQL or T-SQL. Hence, ETL is a very useful process for data migration projects.
数据迁移项目通常使用ETL工具。例如,如果组织之前使用Oracle 10g管理数据,现在想要迁移到SQL Server云数据库,则数据需要从源端迁移到目标端。ETL工具对于执行此类迁移非常有帮助。用户需要花费大量时间编写ETL代码。因此,ETL工具非常有用,因为它们使编码比P-SQL或T-SQL更简单。因此,ETL对于数据迁移项目是一个非常实用的过程。
401. What are the conditions under which you use dynamic cache and static cache in connected and unconnected transformations?
在连接和非连接转换中,在什么条件下使用动态缓存和静态缓存?
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab420 | 官方: 否 | 付费: 否
答案:
- In order to update the master table and slowly changing dimensions (SCD) type 1, it is necessary to use the dynamic cache.
- In the case of flat files, a static cache is used.
Conclusion
结论
With abundant job opportunities and lucrative salary options, ETL testing has become a popular trend. ETL Testing has an extensive market share and is one of the cornerstones of data warehousing and business analytics. To make this process more organized and simpler, many software vendors have introduced ETL testing tools. Most employers who seek ETL testers look for candidates with specific technical skills and experience that meet their needs. No worries, this platform is a great resource for both beginners and professionals. In this article, we have covered 35+ ETL testing interview questions ranging from freshers to experienced level questions typically asked during interviews. Preparation is key before you go for your job interview.
凭借丰富的就业机会和丰厚的薪资待遇,ETL测试已成为一种流行趋势。ETL测试拥有广泛的市场份额,是数据仓库和商业分析的重要基石之一。为了使这一过程更有组织性和更简单,许多软件供应商推出了ETL测试工具。大多数寻求ETL测试员的雇主都在寻找具备特定技术技能和经验、能满足其需求的候选人。别担心,这个平台对初学者和专业人士都是一个很好的资源。在本文中,我们涵盖了35多个ETL测试面试问题,从新手到有经验级别的问题,这些问题通常会在面试中被问到。准备工作是参加面试前的关键。
Recommended Resources:
推荐资源:
SQL
SQL
Python
Python
Java
Java
Informatica
Informatica
402. Why do we need mocking in unit testing?
为什么在单元测试中需要模拟?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37b8058d557c902bb134d | 官方: 否 | 付费: 否
答案:
Mocking is the process of creating and using mock objects that simulates the behaviour of real objects and is used to isolate the behaviour of the module under test from its external dependencies or services. These are particularly useful in unit testing and help in making unit test cases repeatable and predictable. Mocking is required in the following cases: - Whenever the module under test has dependencies that are not fully implemented. For example, if we have a module that calls a REST API that is still in progress, then to test our module, it is advised to mock the API call and perform unit testing of our module.
模拟是指创建和使用模拟对象的过程,这些对象模拟真实对象的行为,用于将被测模块的行为与其外部依赖或服务隔离。这在单元测试中特别有用,有助于使单元测试用例可重复且可预测。在以下情况下需要模拟:- 当被测模块的依赖项未完全实现时。例如,如果我们的模块调用了仍在开发中的REST API,为了测试我们的模块,建议模拟该API调用并对我们的模块执行单元测试。
- Whenever the module under test updates the system states. For example, whenever the module involves database calls that creates or updates or delete data from the system, it is very much important to mock those objects.
- Even if we have DB calls that just retrieves the data, it is advised to mock those because of the risk of DB availability.
403. What is Mockito? What are some of its advantages?
什么是 Mockito?它有哪些优势?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37b8058d557c902bb1350 | 官方: 否 | 付费: 否
答案:
Mockito is an open-source, Java-based, mocking framework that allows the creation of test objects that simulate the behaviour (mock) of real-world objects. This helps in achieving test-driven or behaviour-driven development. The framework allows developers to verify system behaviours without establishing expectations. Mockito framework attempts to eliminate expect-run-verify development patterns by removing external specifications and dependencies. Some of the advantages of Mockito are: - Mocks are created at runtime, hence reordering method input parameters or renaming interface methods will not break test code.
Mockito 是一个基于 Java 的开源模拟框架,允许创建测试对象来模拟真实对象的行为(模拟)。这有助于实现测试驱动或行为驱动开发。该框架允许开发人员验证系统行为,而不需要预先设定预期。Mockito 框架试图通过移除外部规范和依赖来消除“预期-执行-验证”的开发模式。Mockito 的一些优势是:- 模拟对象在运行时创建,因此重新排序方法输入参数或重命名接口方法不会破坏测试代码。
- Mockito supports returning of values.
- It supports exception simulation
- It provides a check on the order of method calls.
- It helps in creating mock objects using annotation.
404. When and why should we use spy?
何时以及为什么我们应该使用 spy?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37b8058d557c902bb1355 | 官方: 否 | 付费: 否
答案:
Spy is a partial mock object supported by the Mockito framework. Following are the features of spy objects: - Whenever mock is not set up, interaction on spy results in real method calls. Spy objects allow verifying interactions such as whether the method was called and how many times it was called, etc.
Spy 是 Mockito 框架支持的局部模拟对象。以下是 spy 对象的特征:- 每当未设置模拟时,对 spy 的交互会导致真实的方法调用。Spy 对象允许验证交互,例如方法是否被调用以及调用了多少次等。
They provide flexibility for setting up partial mocks. For instance, if an object has 2 methods, and we want one method to be mocked and the other to be called actually, then we can use spies.
The main difference between mock and spy is that in mock, we create a complete fake object whereas, in spy, we have a hybrid of a real object and fake/stubbed methods.mock 和 spy 之间的主要区别在于,在 mock 中,我们创建一个完全虚假的对象,而在 spy 中,我们拥有真实对象和虚假/桩方法的混合体。
405. What is the difference between thenReturn and doReturn?
thenReturn 和 doReturn 有什么区别?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37b8058d557c902bb135b | 官方: 否 | 付费: 否
答案:
thenReturn and doReturn are used for setting up stubs and are provided by the Mockito framework. They are generally used along with when clause as --> when-thenReturn and doReturn-when . when-thenReturn is used in most cases due to better readability.
thenReturn 和 doReturn 用于设置桩,由 Mockito 框架提供。它们通常与 when 子句一起使用,如 --> when-thenReturn 和 doReturn-when。when-thenReturn 在大多数情况下使用,因为其可读性更好。
Following are the differences between thenReturn and doReturn : - Type safety:doReturn takes Object parameter, unlike thenReturn. Hence there is no type check in doReturn at compile time. In the case of thenReturn, whenever the type mismatches during runtime, the WrongTypeOfReturnValue exception is raised. This is why when-thenReturn is a better option whenever we know the type.
以下是 thenReturn 和 doReturn 之间的区别:- 类型安全性:doReturn 接受 Object 参数,与 thenReturn 不同。因此,doReturn 在编译时没有类型检查。对于 thenReturn,只要在运行时类型不匹配,就会抛出 WrongTypeOfReturnValue 异常。这就是为什么在我们知道类型的情况下,when-thenReturn 是更好的选择。
- No side-effect:Since doReturn does not have type safety, there are no side effects when it is being used. Whenever thenReturn is used, if the type mismatch occurs, an exception is thrown which might result in the abortion of test cases.
406. What is the main difference between @Mock and @InjectMocks?
@Mock 和 @InjectMocks 之间的主要区别是什么?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37b8058d557c902bb1360 | 官方: 否 | 付费: 否
答案:
@Mock annotation is used for creating mocks whereas @InjectMocks is used for creating class objects. Whenever the actual method body has to be executed of a given class, then we can use @InjectMocks.
@Mock 注解用于创建模拟对象,而 @InjectMocks 用于创建类对象。每当需要执行给定类的实际方法体时,我们可以使用 @InjectMocks。
407. Why can’t we mock static methods in Mockito?
为什么我们不能在 Mockito 中模拟静态方法?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37b8058d557c902bb1365 | 官方: 否 | 付费: 否
答案:
Static methods belong to the class and not to any objects which means that all instances of the class use the same static method. They are more like procedural code and are used in legacy systems. Mock libraries create mocks at runtime utilizing dynamic instance creation using interfaces or inheritance. Since static methods are not linked with any instance, it is not possible to mock them using Mockito. However, we have frameworks like PowerMock that supports static methods.
静态方法属于类而不是任何对象,这意味着类的所有实例使用同一个静态方法。它们更像是过程式代码,常用于遗留系统。模拟库通过使用接口或继承进行动态实例创建,在运行时创建模拟对象。由于静态方法不与任何实例关联,因此无法使用 Mockito 模拟它们。然而,我们有像 PowerMock 这样的框架支持静态方法。
408. How can we mock void methods in Mockito?
如何在 Mockito 中模拟 void 方法?
- 知识点: 测试 / 编程语言基础 (主题: junit, java, testing;标签: interviewbit, junit, topic-specific, java, testing)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37b8058d557c902bb136a | 官方: 否 | 付费: 否
答案:
Consider we have a method called updateItem() which internally calls a void method called updateItem() which interacts with the database and updates the object.
考虑我们有一个名为 updateItem() 的方法,它内部调用一个名为 updateItem() 的 void 方法,该方法与数据库交互并更新对象。
public Item updateItem(Item item) {
public Item updateItem(Item item) {
if (item == null || item.getItemId() < 0) {
if (item == null || item.getItemId() < 0) {
throw new IllegalArgumentException("Invalid Id");
throw new IllegalArgumentException("无效的Id");
}
itemRepository.updateItem(item); //void method that updates database state
itemRepository.updateItem(item); //更新数据库状态的void方法
return item;
return item;
}
We can mock the void method in the following ways:
我们可以通过以下方式模拟void方法:
- doNothing-when : This is used when we do not want to check for the return parameters and skip the actual execution. When this mocked method is called, then it does nothing. The test case would be:
@Test
@Test
public void updateItemTest() {
public void updateItemTest() {
Item item = new Item(2, "Item 1");
Item item = new Item(2, "Item 1");
doNothing().when(itemRepository).updateItem(any(Item.class));
doNothing().when(itemRepository).updateItem(any(Item.class));
itemService.updateItem(item);
itemService.updateItem(item);
}
- doAnswer-when : We can also make use of doAnswer-when whenever we need to perform additional actions like computing return values based on method parameters when a mocked method is called. This is done using the following:
@Test
@Test
public void updateItemTest() {
public void updateItemTest() {
Item item = new Item(2, "Item 2");
Item item = new Item(2, "Item 2");
doAnswer((args) -> {
doAnswer((args) -> {
System.out.println("doAnswer block entered.");
System.out.println("doAnswer块已进入。");
assertEquals(customer, args.getArgument(0));
assertEquals(customer, args.getArgument(0));
return null;
返回 null;
}).when(itemRepository).updateItem(any(Item.class));
}).when(itemRepository).updateItem(any(Item.class));
itemService.updateItem(item);
itemService.updateItem(item);
}
- doThrow-when : If we want to throw an exception from void methods or any normal methods, then we can use doThrow-when as shown below:
@Test(expected = Exception.class)
@Test(expected = Exception.class)
public void updateItemTest() {
public void updateItemTest() {
Item item = new Item(3, "Item 3");
Item item = new Item(3, "Item 3");
doThrow(new Exception("Item Invalid")).when(itemRepository).updateItem(any(Item.class));
doThrow(new Exception("Item Invalid")).when(itemRepository).updateItem(any(Item.class));
itemService.updateItem(item);
itemService.updateItem(item);
}
409. When to choose manual testing over automation testing and vice versa?
何时选择手动测试而非自动化测试,反之亦然?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37bc658d557c902bb449b | 官方: 否 | 付费: 否
答案:
Choosing Manual Testing over Automation Testing - When test cases need to be run for a short duration of time (once or twice).
选择手动测试而非自动化测试——当测试用例只需在短期内运行(一次或两次)时。
- When one needs to perform exploratory testing, usability testing, or ad-hoc testing.
- When assessing an application's user-friendliness.
- Whenever flexibility is needed.
Whenever one wants to better manage complex situations/scenarios.
Choosing Automation Testing over Manual Testing - Whenever test cases have to be run repeatedly over a long period of time.选择自动化测试而非手动测试——当测试用例需要在长时间内重复运行时。
- When one needs to perform performance testing, load testing, or regression testing.
- Whenever one wishes to record the testing process.
- When one has a limited amount of time to complete the testing phase.
- When tests are needed to be executed in a standard runtime environment.
- When tests involve repetitive steps.
- When there are multiple and quick deployments for the product, the manual becomes very time taking and redundant.
410. In what way will you determine when to stop testing?
你将通过何种方式确定何时停止测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37bc658d557c902bb449e | 官方: 否 | 付费: 否
答案:
Testing can be quite challenging when it comes to determining when to stop. In the modern world, many software applications are so complex and run in so many interdependent environments, that complete testing is impossible. The following factors are often considered when deciding when to stop testing: - If deadlines are met (release deadlines, testing deadlines, etc.) and there are no high-priority issues left in the system.
在确定何时停止测试时,测试可能相当具有挑战性。在现代世界中,许多软件应用程序非常复杂,并在众多相互依赖的环境中运行,因此完整测试是不可能的。在决定何时停止测试时,通常会考虑以下因素:——如果截止日期已满足(发布截止日期、测试截止日期等),且系统中没有遗留的高优先级问题。
- Completion of test cases with a certain passing percentage.
- As soon as the test budget is depleted.
- The mean time between two inherent failures is known as the MTBF (Mean Time Between Failure). When the MTBF is quite high, the testing phase may be stopped depending on stakeholder decisions.
- As soon as the automated code coverage meets a specified threshold value and there are no critical bugs.
- If the bug rate drops below a certain level.
- After the Beta or Alpha testing period has ended.
411. Can 100% testing coverage be achieved? How do you ensure test coverage?
能否实现100%的测试覆盖率?你如何确保测试覆盖率?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37bc658d557c902bb44a1 | 官方: 否 | 付费: 否
答案:
Testing a product 100% is considered impossible. You can, however, get closer to your goal by following the steps below. - Developing an effective testing strategy.
100%测试产品被认为是不可能的。不过,你可以通过以下步骤更接近你的目标。——制定有效的测试策略。
- Prepare a checklist for all activities related to testing.
- Establish a priority list for the application's critical areas.
- List all application requirements.
- Identify the risks associated with the application.
- Utilize automated testing.
412. System testing can be done at any stage. Yes or No?
系统测试可以在任何阶段进行。对还是错?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37bc658d557c902bb44a4 | 官方: 否 | 付费: 否
答案:
No, system testing cannot be conducted at any stage of the development process. In system testing, all components of the software are tested together to ensure that the overall product meets the specified specifications. Therefore, system testing cannot take place at any stage; instead, it must be done only after all modules or units are in place and are working properly, but before User Acceptance Testing (UAT).
不,系统测试不能在开发过程的任何阶段进行。在系统测试中,软件的所有组件被一起测试,以确保整体产品满足指定的规格。因此,系统测试不能在任何阶段进行;相反,它必须仅在所有模块或单元到位并正常工作之后、用户验收测试(UAT)之前进行。
413. If proper documentation is not available for testing, what steps will you take to overcome the challenge?
如果测试没有可用适当的文档,你将采取哪些步骤来克服这一挑战?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37bc658d557c902bb44a7 | 官方: 否 | 付费: 否
答案:
QAs should refer to the following references if they cannot find standard documents such as System Requirements Specification or Feature Description Document. - Screenshots
如果QA无法找到诸如系统需求规格说明书或功能描述文档等标准文档,应参考以下资料:- 截图
- Wireframes
A previous version of the application.
In addition, having discussions with the business analyst and the developer is another reliable method. This is helpful in resolving doubts and bringing clarity to requirements. The emails exchanged could also serve as testing references.此外,与业务分析师和开发人员进行讨论是另一种可靠方法。这有助于解决疑问并明确需求。交换的电子邮件也可作为测试参考。
Another option for verifying the application's functionality is to perform smoke testing. This would expose a few very basic bugs in the application. In cases where none of the above options work, we can simply use our previous experience to test the software application.
另一种验证应用程序功能的方法是进行冒烟测试。这能暴露应用程序中一些非常基本的问题。在上述方法都不可行的情况下,我们可以简单地依靠以往的经验来测试软件应用。
414. What are some best practices that you should follow when writing test cases?
编写测试用例时,应遵循哪些最佳实践?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37bc658d557c902bb44aa | 官方: 否 | 付费: 否
答案:
When writing test cases, you should follow the following guidelines: - Assess the project's risks and deadlines before planning and prioritizing test cases and write accordingly.
编写测试用例时,应遵循以下指南:- 在规划和优先排序测试用例前,评估项目风险和截止日期,并据此编写。
- Keep the 80/20 rule in mind. For the best coverage of your application, 20% of your tests should cover 80% of its functionality.
- Make sure you don't try to test all cases at once, but rather improvise them as you go.
- Create a list of your test cases and categorize them according to business scenarios and functionality.
- Modularity and granularity are important when designing test cases.
- Provide test cases in a way that can easily be understood by others and modified if necessary.
- Remember that the software designed is ultimately for customers, so keep their requirements in mind.
- Manage a stable release cycle by using a test management tool.
- Keep track of your test cases on a regular basis. Test cases must be unique and irrelevant or duplicated must be removed.
415. When the requirements are still in flux, what is the best way to test a product?
当需求仍在变动时,测试产品的最佳方法是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37bc658d557c902bb44ad | 官方: 否 | 付费: 否
答案:
For some products, a requirement stack is not available. It may require considerable effort to identify if an application has unexpected functionality, which indicates a deeper problem with the software development process. Removing functionality that isn't necessary for the purpose of the application is a good idea. Otherwise, create a test plan based on the assumptions you've made about the product. But, it is important that you thoroughly document all assumptions in the test plan.
对于某些产品,可能没有需求文档。识别应用是否具有意外功能可能需要相当多的努力,这表明软件开发过程中存在更深层次的问题。移除对应用目的非必要的功能是个好主意。否则,根据你对产品的假设制定测试计划。但重要的是,你必须在测试计划中彻底记录所有假设。
416. What makes boundary value analysis a good method for providing test cases?
为什么边界值分析是提供测试用例的好方法?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37bc658d557c902bb44b0 | 官方: 否 | 付费: 否
答案:
A boundary value analysis is defined as a software testing technique that uses the boundary values of equivalence classes as input to test cases. Black box testing uses boundary value analysis as one of the most commonly used case design techniques.
边界值分析被定义为一种软件测试技术,它使用等价类的边界值作为测试用例的输入。黑盒测试将边界值分析作为最常用的用例设计技术之一。
In boundary value analysis, values at the boundaries are included in test cases. It is generally true that there are more errors at the boundaries of an input domain than in its center, which makes boundary value analysis an excellent method for generating test cases. In boundary value analysis, values at the boundaries are included in test cases. When the input lies within the boundary range, it is a positive test, but if it lies outside, it is a negative test. The values may include the maximum, the minimum, the inside edge, the outside edge, the typical value or the error value.
在边界值分析中,边界值被包含在测试用例中。通常,输入域的边界比其中心更容易出现错误,这使得边界值分析成为生成测试用例的绝佳方法。在边界值分析中,边界值被包含在测试用例中。当输入位于边界范围内时,为正向测试;如果位于范围外,则为负向测试。这些值可能包括最大值、最小值、内侧边缘、外侧边缘、典型值或错误值。
Example: Assume you're testing an input box accepting numbers from 1 to 20. As a result of boundary value analysis, we can divide test cases into three categories: - The test data will be the same as the input boundaries of input: 1 and 20.
示例:假设你在测试一个接受数字1到20的输入框。通过边界值分析,我们可以将测试用例分为三类:- 测试数据将与输入的边界值相同:1和20。
- Input values above the extreme edges: 2 and 21.
Input values below the extreme edges: 0 and 19.
Therefore, the boundary values are 0, 1, 2, and 19, 20, 21.因此,边界值为0、1、2以及19、20、21。
417. How do you know the code has met specifications?
如何知道代码已满足规格要求?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, manual-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37bc658d557c902bb44b3 | 官方: 否 | 付费: 否
答案:
Code that is maintainable, readable, and bug-free is considered good. Almost every organization has 'coding standards' that developers should adhere to, but everyone has different ideas about what's best and what's too many or too few. Many tools are available that ensure that test cases map to requirements, such as traceability matrixes. In the event that all test cases are successfully executed, then the code fulfils the requirement.
可维护、可读且无缺陷的代码被认为是好的。几乎每个组织都有开发人员应遵守的“编码标准”,但每个人对什么是最佳、什么是过多或过少都有不同看法。许多工具(如可追溯性矩阵)可确保测试用例映射到需求。如果所有测试用例都成功执行,则代码满足需求。
Conclusion
结论
QAs should add manual testing to any test strategy as it enables them to gain deeper insights from the end user's perspective that can be extremely useful. As manual testing relies on human testers without the aid of test automation frameworks, it is a powerful tool for judging software based on the most important metric: customer/user experience. The agile software development process continuously demands a shift towards automated testing, but manual testing will never cease to exist. An experienced, well-rounded candidate that can provide both manual and automation testing skills can assist QAs in quickly and efficiently completing the necessary tests. When you prepare for the manual interview, you are more likely to impress the hiring manager and progress to the next stage of the process.
QA应将手动测试添加到任何测试策略中,因为这能从最终用户的角度获得更深入的见解,极其有用。由于手动测试依赖人工测试人员且不借助测试自动化框架,它是基于最重要指标(客户/用户体验)判断软件的强有力工具。敏捷软件开发流程持续要求向自动化测试转变,但手动测试永远不会消失。一位经验丰富、全面发展且能提供手动和自动化测试技能的候选人,可帮助QA快速高效地完成必要测试。当你为手动面试做准备时,更有可能给招聘经理留下深刻印象并推进到下一阶段。
In light of this, we have put together a comprehensive list of interview questions frequently asked during manual testing interviews. Here we have given an overview of manual testing and compiled a list of the top 50+ manual testing interview questions for job seekers at all stages of their careers. The candidate should have a thorough understanding of key concepts, as well as the ability to clearly and persuasively present their ideas. So, prepare yourself accordingly. Good luck with your future endeavours.
鉴于这一点,我们整理了手动测试面试中常被问到的全面问题列表。此处我们提供了手动测试的概述,并为处于职业各阶段的求职者汇编了前50多个手动测试面试问题。候选人应深入理解关键概念,并能清晰而有说服力地表达想法。因此,请做好相应准备。祝你未来一切顺利。
Additional Interview Resources
其他面试资源
- https://www.interviewbit.com/automation-testing-interview-questions/
- https://www.interviewbit.com/api-testing-interview-questions/
- https://www.interviewbit.com/java-interview-questions-for-5-years-experience/
- https://www.interviewbit.com/sdlc-interview-questions/
- https://www.interviewbit.com/functional-testing-interview-questions/
- https://www.interviewbit.com/jira-interview-questions/
- https://www.interviewbit.com/mobile-testing-interview-questions/
- https://www.interviewbit.com/performance-testing-interview-questions/
- https://www.interviewbit.com/qa-interview-questions/
- https://www.interviewbit.com/database-testing-interview-questions/
- https://www.interviewbit.com/technical-interview-questions/
- https://www.interviewbit.com/blog/qa-engineer/
- https://www.interviewbit.com/blog/software-testing-methodologies/
- https://www.interviewbit.com/blog/principles-of-software-testing/
- https://www.interviewbit.com/software-testing-mcq/
418. Determine whether there is a triplet in the array whose total equals the given value, given an array and a value. If a triplet of this type exists in the array, print it and return true. If not, return false.
确定数组中是否存在一个三元组,其总和等于给定值,给定一个数组和一个值。如果数组中存在这种三元组,打印它并返回true。如果不存在,则返回false。
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6f28 | 官方: 否 | 付费: 否
答案:
Example:
示例:
Input:
输入:
arr = {12, 3, 4, 1, 6, 9}, sum = 24;
arr = {12, 3, 4, 1, 6, 9}, sum = 24;
Output:
输出:
12, 3, 9
Explanation:
说明:
The array contains a triplet (12, 3 and 9) whose sum is 24.
数组包含一个三元组(12、3和9),其总和为24。
Input:
输入:
arr = {1, 2, 3, 4, 5}, sum = 9
arr = {1, 2, 3, 4, 5}, sum = 9
Output:
输出:
5, 3, 1
Explanation:
说明:
There is a triplet (5, 3 and 1) present in the array whose sum is 9.
数组中存在一个三元组(5、3和1),其总和为9。
Approach:
方法:
The algorithm's performance can be increased by sorting the array. The two-pointer technique is used in this effective method. Fix the first element of the triplet by traversing the array. Find if there is a pair whose total equals x – array[i] using the Two Pointers technique. Because the two pointers approach takes linear time, it is preferable to a nested loop.
可以通过排序数组来提高算法的性能。这种有效方法中使用了双指针技术。通过遍历数组固定三元组的第一个元素。使用双指针技术查找是否存在一个对,其总和等于x – array[i]。由于双指针方法需要线性时间,因此它优于嵌套循环。
Code:
代码:
include <bits/stdc++.h>
using namespace std;
using namespace std;
// returns true if there is triplet with sum equal
// 如果存在总和等于' sum '的三元组,则返回true
// to 'sum' present in arr[]. Also, prints the triplet
// 并且打印该三元组,该三元组存在于arr[]中
bool findTriplet(int arr[], int arr_size, int sum)
bool findTriplet(int arr[], int arr_size, int sum)
{
int low, high;
int low, high;
//sorting the entire array
// 对整个数组进行排序
sort(arr, arr + arr_size);
sort(arr, arr + arr_size);
//Fixing the first element one by one and finding the other two elements
// 逐个固定第一个元素,并找到其他两个元素
for (int i = 0; i < arr_size - 2; i++) {
for (int i = 0; i < arr_size - 2; i++) {
// Start two index variables from opposite corners of the array and move them toward each other to find the other two members.
// 从数组的相对角开始设置两个索引变量,并将它们相互靠近移动,以找到另外两个成员。
low = i + 1; // index of the first element in the remaining elements
low = i + 1; // 剩余元素中第一个元素的索引
high = arr_size - 1; // index of the last element
high = arr_size - 1; // 最后一个元素的索引
while (low < high) {
while (low < high) {
if (arr[i] + arr[low] + arr[high] == sum) {
if (arr[i] + arr[low] + arr[high] == sum) {
printf("The triplet is %d, %d, %d", arr[i],
printf("三元组是 %d, %d, %d", arr[i],
arr[low], arr[high]);
arr[low], arr[high]);
return true;
返回 true;
}
else if (arr[i] + arr[low] + arr[high] < sum)
else if (arr[i] + arr[low] + arr[high] < sum)
low++;
low++;
else // arr[i] + arr[low] + arr[high] > sum
else // arr[i] + arr[low] + arr[high] > sum
high--;
high--;
}
}
// If we reach here, then no triplet was found
// 如果我们到达这里,那么没有找到三元组
return false;
返回 false;
}
int main()
int main()
{
int arr[] = { 12, 3, 4, 1, 6, 9 };
int arr[] = { 12, 3, 4, 1, 6, 9 };
int sum = 24;
int sum = 24;
int arr_size = sizeof(arr) / sizeof(arr[0]);
int arr_size = sizeof(arr) / sizeof(arr[0]);
findTriplet(arr, arr_size, sum);
findTriplet(arr, arr_size, sum);
return 0;
return 0;
}
Output:
输出:
The triplet is 12, 3, 9
三元组是 12, 3, 9
Explanation:
说明:
In the above code, the function findTriplet takes the input of an array, the size of the array and the sum required. First of all, we sort the array given. We traverse the array elements and fix the first element of the triplet in each iteration. We use a two-pointer approach and find the remaining two elements of the triplet, if it is possible with the given array.
在上面的代码中,函数 findTriplet 接收数组、数组大小和所需总和作为输入。首先,我们对给定的数组进行排序。我们遍历数组元素,并在每次迭代中固定三元组的第一个元素。我们使用双指针方法,并找到三元组的剩余两个元素(如果给定的数组允许这样做的话)。
Useful Resources:
有用资源:
- QA Interview Questions
- Automation Testing Interview Questions
- Software Testing Interview Questions and Answers
- Mobile App Testing
- API Testing Interview Questions
- Selenium Interview Questions
- Software Development Engineer: Career Guide
- Software Developer Vs Software Engineer
419. Write a program to print the factorial of a given input number.
编写一个程序,打印给定输入数字的阶乘。
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b37c4558d557c902bc6f2b | 官方: 否 | 付费: 否
答案:
Example:
示例:
Input:
输入:
5
Output:
输出:
120
In practically all interviews, factorial is one of the most frequently asked questions (including developer interviews) Developer interviews place a greater emphasis on programming concepts such as dynamic programming, recursion, and so on, whereas Software Development Engineer in Test interviews place a greater emphasis on handling edge scenarios such as max values, min values, negative values, and so on, and approach/efficiency becomes secondary.
在几乎所有面试中,阶乘是最常被问到的题目之一(包括开发人员面试)。开发人员面试更侧重于编程概念,如动态规划、递归等,而测试开发工程师面试则更侧重于处理边缘场景,如最大值、最小值、负值等,方法和效率成为次要因素。
The following recursive formula can be used to calculate factorial.
以下递归公式可用于计算阶乘。
n! = n * (n-1)!
n! = n * (n-1)!
n! = 1 if n = 0 or n = 1
如果 n = 0 或 n = 1,则 n! = 1
Code:
代码:
include <bits/stdc++.h>
using namespace std;
using namespace std;
// function to find the factorial of given number
// 用于查找给定数字的阶乘的函数
int findFactorial(unsigned int n)
int findFactorial(unsigned int n)
{
if (n == 0)
if (n == 0)
return 1;
return 1;
return n * factorial(n - 1);
return n * factorial(n - 1);
}
int main()
int main()
{
int number = 5;
int number = 5;
if(number < 0)
if(number < 0)
{
cout << "Negative numbers do not have factorial" << "\n";
cout << "负数没有阶乘" << "\n";
return 0;
return 0;
}
cout << "Factorial of " << number << " is " << findFactorial(number) << “\n”;
cout << "数字 " << number << " 的阶乘是 " << findFactorial(number) << “\n”;
return 0;
return 0;
}
Output:
输出:
Factorial of 5 is 120
5 的阶乘是 120
Explanation: In the above code, the function findFactorial finds the factorial of a given input number. Before making the function call, we check if the given number is negative. Negative numbers do not have a factorial and so we must display appropriate messages for it.
说明:在上述代码中,findFactorial 函数用于查找给定输入数字的阶乘。在调用函数之前,我们检查给定的数字是否为负数。负数没有阶乘,因此我们必须为其显示适当的消息。
420. Write a programme to check whether the pairs and ordering of "", "", "(", ")", "[", "]" in the expression string expression are balanced or not.
编写一个程序,检查表达式字符串 expression 中的 ""、""、"("、")"、"["、"]" 的配对和顺序是否平衡。
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b37c4558d557c902bc6f30 | 官方: 否 | 付费: 否
答案:
By balanced string, it is meant that every opening parenthesis should have its corresponding closing braces and there must not be redundant closing braces.
所谓平衡字符串,是指每个左括号都应有其对应的右括号,且不能有多余的右括号。
Example :
示例:
Input :
输入:
“[()]{}{()()}”
Output :
输出:
Balanced
Balanced
Input:
输入:
[[
Output:
输出:
Not Balanced
不平衡
Approach :
方法:
We create a character stack and now look through the expression string. If the current character is a beginning bracket ('(', ", or '['), stack it. If the current character is a closing bracket (') or " or ']'), pop from the stack; if the popped character is the matching starting bracket, all is well; otherwise, the brackets are unbalanced. If some starting brackets remain in the stack after traversal, the stack is said to be "unbalanced."
我们创建一个字符栈,然后遍历表达式字符串。如果当前字符是左括号('('、'"' 或 '['),则将其压入栈中。如果当前字符是右括号(')'、'"' 或 ']'),则从栈中弹出;如果弹出的字符是匹配的左括号,则一切正常;否则,括号不平衡。如果遍历后栈中仍留有左括号,则称该栈为“不平衡的”。
Code:
代码:
include <bits/stdc++.h>
using namespace std;
using namespace std;
// function to check if the given expression is balanced or not
// 函数用于检查给定表达式是否平衡
bool checkBalancedExpression(string str)
bool checkBalancedExpression(string str)
{
stackchar_stack;
stackchar_stack;
char top_element;
char top_element;
// Traversing the Expression
// 遍历表达式
for (int i = 0; i < str.length(); i++)
for (int i = 0; i < str.length(); i++)
{
if (str[i] == '(' || str[i] == '[' || str[i] == '{')
if (str[i] == '(' || str[i] == '[' || str[i] == '{')
{
// We push the character in the stack
// 我们将字符压入栈中
char_stack.push(str[i]);
char_stack.push(str[i]);
continue;
continue;
}
// We check if the stack is empty. If it is empty, then it is an unbalanced expression since there must be a corresponding opening bracket before the closing one.
// 我们检查栈是否为空。如果为空,则表明是平衡表达式,因为在右括号之前必须存在对应的左括号。
if (char_stack.empty())
if (char_stack.empty())
return false;
返回 false;
switch (str[i]) {
switch (str[i]) {
case ')':
情况 ')':
top_element = char_stack.top();
栈顶元素 = 字符栈.top();
char_stack.pop();
字符栈.pop();
if (top_element == '{' || top_element == '[')
如果(栈顶元素 == '{' 或 栈顶元素 == '[')
return false;
返回 false;
break;
break;
case '}':
情况 '}':
top_element = char_stack.top();
栈顶元素 = 字符栈.top();
char_stack.pop();
字符栈.pop();
if (top_element == '(' || top_element == '[')
如果(栈顶元素 == '(' 或 栈顶元素 == '[')
return false;
返回 false;
break;
break;
case ']':
情况 ']':
top_element = char_stack.top();
栈顶元素 = 字符栈.top();
char_stack.pop();
字符栈.pop();
if (top_element == '(' || top_element == '{')
如果(栈顶元素 == '(' 或 栈顶元素 == '{')
return false;
返回 false;
break;
break;
}
}
// The stack should be empty at this point for a balanced expression
// 在此点,栈应为空,表示表达式是平衡的
return (char_stack.empty());
返回(字符栈.empty());
}
int main()
int main()
{
string str = "[]{}()";
字符串 str = "[]{}()";
if (checkBalancedExpression(str))
如果(检查平衡表达式(str))
cout << "Balanced";
cout << "Balanced";
else
else
cout << "Not Balanced";
cout << "Not Balanced";
return 0;
return 0;
}
Output :
输出:
Balanced
Balanced
Explanation:
说明:
In the above code, we create a function checkBalancedExpression which takes the input of an expression string and checks whether the string is balanced or not. We start traversing the expression. Whenever we encounter an opening bracket, we push it in the stack. In the case of a closing bracket, we first check if the stack is empty or not. If it is empty, we directly return false otherwise, we check if the top element has the corresponding opening bracket or not.
在上述代码中,我们创建了一个函数checkBalancedExpression,它输入一个表达式字符串并检查该字符串是否平衡。我们开始遍历表达式。每当我们遇到一个左括号,就将其推入栈中。在遇到右括号的情况下,我们首先检查栈是否为空。如果为空,直接返回false;否则,我们检查栈顶元素是否有相应的左括号。
421. Write a program that reverses a given input number.
编写一个程序,反转给定的输入数字。
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b37c4558d557c902bc6f33 | 官方: 否 | 付费: 否
答案:
Example :
示例:
Input:
输入:
1234
Output:
输出:
4321
Approach:
方法:
We follow a greedy approach . We start extracting each digit from the original number from the end and keep on adding it at the end of the new number, thereby reversing the given number.
我们采用贪心方法。我们从原始数字的末尾开始提取每个数字,并将其持续添加到新数字的末尾,从而反转给定的数字。
Code:
代码:
include <bits/stdc++.h>
using namespace std;
using namespace std;
//function to find the reverse of the given input
//函数,用于找到给定输入的反转
int reverseNumber(int original_number)
int reverseNumber(int original_number)
{
int new_number = 0;
int new_number = 0;
while (original_number > 0) {
while (original_number > 0) {
new_number = new_number * 10 + original_number % 10; // extracting the last digit from the original number and appending it to the new number
new_number = new_number * 10 + original_number % 10; // 从原始数字中提取最后一位数字并将其追加到新数字
original_number = original_number / 10;
original_number = original_number / 10;
}
return new_number;
return new_number;
}
int main()
int main()
{
int original_number = 1234;
int original_number = 1234;
cout << "The original number is " << original_number << "\n";
cout << "原始数字是 " << original_number << "\n";
cout << "The reversed number is " << reverseNumber(original_number) << "\n";
cout << "The reversed number is " << reverseNumber(original_number) << "\n";
return 0;
return 0;
}
Output :
输出:
The original number is 1234
原始数字是1234
The reversed number is 4321
反转后的数字是4321
Explanation :
解释:
In the above code, the function reverseNumber takes the input of an integer number and returns the reverse of the number. We extract each digit from the end and append it to the new number.
在上述代码中,函数 reverseNumber 接受一个整数输入,并返回该数字的反转。我们从末尾提取每一位数字,并将其追加到新数字中。
422. Swap the values of two variables, x and y, without needing a third variable.
交换两个变量 x 和 y 的值,无需第三个变量。
- 知识点: 测试 (主题: sdet, testing, development;标签: interviewbit, sdet, topic-specific, testing, development)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4558d557c902bc6f36 | 官方: 否 | 付费: 否
答案:
- Approach 1:
The goal is to find a sum in one of the two numbers provided. The total and subtraction from the sum can then be used to swap the integers.
目标是在提供的两个数字之一中找到和。然后可以利用总和及从总和中的减法来交换整数。
Code:
代码:
include <bits/stdc++.h>
using namespace std;
using namespace std;
int main()
int main()
{
int a = 1, b = 2;
int a = 1, b = 2;
cout << "Before Swapping : a = " << a << " and b = " << b << "\n";
cout << "交换前:a = " << a << " 且 b = " << b << "\n";
a = a + b; // storing the sum of a and b in a
a = a + b; // 将 a 和 b 的和存储在 a 中
b = a - b; // storing the value of the original a in b
b = a - b; // 将原始 a 的值存储在 b 中
a = a - b; // storing the value of the original b in a
a = a - b; // 将原始 b 的值存储在 a 中
cout << "After Swapping : a = " << a << " and b = " << b << "\n";
cout << "交换后:a = " << a << " 且 b = " << b << "\n";
}
Output :
输出:
Before Swapping : a = 1 and b = 2
交换前:a = 1 且 b = 2
After Swapping : a = 2 and b = 1
交换后:a = 2 且 b = 1
Explanation : In the above code, we first stored the sum of both the numbers in the first variable. Then, we store the original value of the first variable in the second variable by subtracting the second variable from the sum. Similarly we change the value for the second variable as well. Thus, we swapped the two numbers without using a third variable. - Approach 2 :
解释:在上述代码中,我们首先将两个数字的和存储到第一个变量中。然后,通过从总和减去第二个变量,将第一个变量的原始值存储到第二个变量中。类似地,我们也更改了第二个变量的值。因此,我们无需第三个变量就交换了两个数字。- 方法 2:
To swap two variables, use the bitwise XOR operator. When two integers x and y are XORed, the result is a number with all bits set to 1 wherever the bits of x and y differ. For instance, the XOR of 10 (in Binary 1010) and 5 (in Binary 0101) is 1111, while the XOR of 7 (0111) and 5 (0101) is 1111. (0010). We can then xor the resultant XORed with the other number to swap the values. Considering the above example, when we xor 1111 with 0101 we get 1010.
要交换两个变量,请使用按位异或运算符。当两个整数 x 和 y 进行异或运算时,结果是一个数字,在 x 和 y 的位不同的位置上,所有位都设置为 1。例如,10(二进制1010)和5(二进制0101)的异或结果在二进制中是1111,而7(0111)和5(0101)的异或结果在二进制中是0010。然后我们可以将结果异或另一个数字来交换值。考虑上述示例,当我们用1111与0101进行异或时,得到1010。
Code :
代码:
include <bits/stdc++.h>
using namespace std;
using namespace std;
int main()
int main()
{
int a = 1, b = 2;
int a = 1, b = 2;
cout << "Before Swapping : a = " << a << " and b = " << b << "\n";
cout << "交换前:a = " << a << " 且 b = " << b << "\n";
a = a ^ b; // storing the xor of a and b in a
a = a ^ b; // 将a和b的异或结果存储在a中
b = a ^ b; // storing the value of the original a in b
b = a ^ b; // 将原始a的值存储在b中
a = a ^ b; // storing the value of the original b in a
a = a ^ b; // 将原始b的值存储在a中
cout << "After Swapping : a = " << a << " and b = " << b << "\n";
cout << "交换后:a = " << a << " 且 b = " << b << "\n";
}
Output :
输出:
Before Swapping : a = 1 and b = 2
交换前:a = 1 且 b = 2
After Swapping : a = 2 and b = 1
交换后:a = 2 且 b = 1
Explanation :
解释:
In the above code, we first stored the xor of both the numbers in the first variable. Then, we store the original value of the first variable in the second variable by XORing the second variable with the sum. Similarly, we change the value for the second variable as well. Thus, we swapped the two numbers without using a third variable.
在上述代码中,我们首先将两个数的异或结果存储在第一变量中。然后,通过将第二变量与异或结果进行异或运算,将第一变量的原始值存储在第二变量中。类似地,我们也改变第二变量的值。因此,我们在不使用第三个变量的情况下交换了两个数字。
423. How to create an Object Repository in your project?
如何在项目中创建对象仓库?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc7079 | 官方: 否 | 付费: 否
答案:
There is an Object Repository notion in QTP ( Quick Test Professional ). By default, when a user records a test, the objects and their properties are saved in an Object Repository. This Object Repository is used by QTP to playback scripts. There is no default Object Repository concept in Selenium. This isn't to say that Selenium doesn't have an Object Repository. Even if there isn't one by default, we could make our own.
QTP(Quick Test Professional)中存在对象仓库的概念。默认情况下,当用户录制测试时,对象及其属性会保存在对象仓库中。QTP 使用此对象仓库来播放脚本。Selenium 中没有默认的对象仓库概念。这并不是说 Selenium 没有对象仓库。即使默认没有,我们也可以自己创建。
Objects are referred to as locators in Selenium (such as ID, Name, Class Name, Tag Name, Link Text, Partial Link Text, XPath, and CSS). A collection of objects is referred to as an object repository. Placing all the locators in a separate file is one technique to construct an Object Repository (i.e., properties file). The ideal method, however, is to use Page Object Model. Each web page is represented as a class in the Page Object Model Design Pattern. A class contains all of the items associated with a specific page of a web application.
在 Selenium 中,对象被称为定位器(如 ID、名称、类名、标签名、链接文本、部分链接文本、XPath 和 CSS)。对象的集合被称为对象仓库。将所有的定位器放在一个单独的文件中是构建对象仓库的一种技术(即属性文件)。然而,理想的方法是使用页面对象模型。在页面对象模型设计模式中,每个网页被表示为一个类。一个类包含与 Web 应用程序特定页面相关联的所有项目。
424. What are the different types of waits that WebDriver supports?
WebDriver 支持哪些不同类型的等待?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc707c | 官方: 否 | 付费: 否
答案:
- Implicit Wait: Implicit wait instructs Selenium to wait a specified amount of time before throwing a "No such element" exception (One of the WebDriver Exceptions is NoSuchElementException, which occurs when the locators indicated in the Selenium Program code is unable to locate the web element on the web page).
Before throwing an exception, the Selenium WebDriver is told to wait for a particular amount of time. WebDriver will wait for the element after this time has been set before throwing an exception. Implicit Wait is activated and remains active for the duration of the browser's open state. Its default setting is 0, and the following protocol must be used to define the specific wait duration.
在抛出异常之前,Selenium WebDriver 被指示等待特定的一段时间。设置此时间后,WebDriver 将等待元素,然后才抛出异常。隐式等待被激活,并在浏览器打开状态期间保持激活。其默认设置为 0,必须使用以下协议来定义特定的等待时长。
Its Syntax is as follows:
其语法如下:
driver.manage().timeouts().implicitlyWait(TimeOut, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(TimeOut, TimeUnit.SECONDS);
- Explicit Wait: Explicit wait tells the WebDriver to wait for specific conditions before throwing an "ElementNotVisibleException" exception. The Explicit Wait command tells the WebDriver to wait until a certain condition occurs before continuing to execute the code. Setting Explicit Wait is crucial in circumstances when certain items take longer to load than others.
If an implicit wait command is specified, the browser will wait the same amount of time before loading each web element. This adds to the time it takes to run the test script. Explicit waiting is smarter, but it can only be used for specific parts. It is, nonetheless preferable to implicit wait since it allows the programme to stop for dynamically loaded Ajax items.
如果指定了隐式等待命令,浏览器将在加载每个 Web 元素前等待相同的时间。这会增加运行测试脚本所需的时间。显式等待更智能,但只能用于特定部分。然而,它优于隐式等待,因为它允许程序停止以等待动态加载的 Ajax 项目。
Its Syntax is as follows:
其语法如下:
WebDriverWait wait = new WebDriverWait(WebDriver Reference, TimeOut);
WebDriverWait wait = new WebDriverWait(WebDriver Reference, TimeOut);
- Fluent Wait: It is used to inform the WebDriver how long to wait for a condition and how often we want to check it before throwing an "ElementNotVisibleException" exception. In Selenium, Fluent Wait refers to the maximum amount of time that a Selenium WebDriver will wait for a condition (web element) to become visible.
It also specifies how often WebDriver will check for the presence of the condition before throwing the "ElementNotVisibleException." To put it another way, Fluent Wait searches for a web element at regular intervals until it timeouts or the object is found. When engaging with site items that take longer to load, Fluent Wait instructions come in handy. This is a common occurrence with Ajax apps. It is possible to establish a default polling period while using Fluent Wait. During the polling time, the user can configure the wait to ignore any exceptions. Because they don't wait out the complete duration defined in the code, fluent waits are also known as Smart Waits.
它还指定了 WebDriver 在抛出“ElementNotVisibleException”之前检查条件是否存在的时间间隔。换句话说,流畅等待会定期搜索 Web 元素,直到超时或找到对象。当与加载时间较长的站点项目交互时,流畅等待指令非常有用。这在 Ajax 应用中很常见。使用流畅等待时可以建立默认的轮询周期。在轮询期间,用户可以配置等待以忽略任何异常。由于流畅等待不会等待代码中定义的完整时长,它们也被称为智能等待。
Its Syntax is as follows:
其语法如下:
Wait wait = new FluentWait(WebDriver reference).withTimeout(timeout, SECONDS).pollingEvery(timeout, SECONDS).ignoring(Exception.class);
Wait wait = new FluentWait(WebDriver reference).withTimeout(timeout, SECONDS).pollingEvery(timeout, SECONDS).ignoring(Exception.class);
425. Mention the several types of navigation commands that can be used?
可以使用的导航命令有哪几种?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc707f | 官方: 否 | 付费: 否
答案:
The several types of navigation commands that can be used are as follows: - navigate().to() - It is used for going to the specified URL.
可以使用的几种导航命令如下:- navigate().to() - 用于跳转到指定的URL。
- driver.navigate().refresh() - The current page is refreshed using the driver.navigate().refresh() command.
- driver.navigate().forward() - This command does the same function as clicking the browser's Forward Button. Nothing is accepted or returned by it.
- driver.navigate()back() - This command does the same function as clicking the browser's Back Button. Nothing is accepted or returned by it.
426. How does a Selenium WebDriver interact with the browser?
Selenium WebDriver 如何与浏览器交互?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc7082 | 官方: 否 | 付费: 否
答案:
On a high level, the Selenium webdriver communicates with the browser and does not transform commands into JavaScript. Our Java or Python code will be transmitted as an API get and post request in the JSON wire protocol. The browser webdriver interacts with the real browser as an HTTP Request, as mentioned in the previous answer. To receive HTTP requests, each Browser Driver utilizes an HTTP server. When the URL reaches the Browser Driver, it will send the request via HTTP to the real browser. The commands in your Selenium script will be executed on the browser after this is completed. If the request is a POST request, the browser will perform an action. If the request is a GET request, the browser will generate the corresponding response. The request will then be delivered to the browser driver through HTTP, and the browser driver will send it to the user interface via JSON Wire Protocol. Learn More . - The JSON wire protocol converts test commands into HTTP requests.
从高层来看,Selenium WebDriver 与浏览器通信,不将命令转换为JavaScript。我们的Java或Python代码会作为API的get和post请求,通过JSON wire协议传输。浏览器WebDriver通过HTTP请求与真实浏览器交互,如前面回答所述。每个浏览器驱动都使用一个HTTP服务器来接收HTTP请求。当URL到达浏览器驱动时,它会通过HTTP将请求发送到真实浏览器。完成此操作后,你Selenium脚本中的命令将在浏览器上执行。如果请求是POST请求,浏览器将执行一个操作。如果请求是GET请求,浏览器将生成相应的响应。然后,该请求会通过HTTP传递给浏览器驱动,浏览器驱动再通过JSON Wire协议将其发送到用户界面。了解更多。- JSON wire协议将测试命令转换为HTTP请求。
- Every browser has its own driver that initializes the server before executing any test cases.
- The browser's driver then begins to receive the request.
427. What are Selenium WebDriver Listeners?
什么是 Selenium WebDriver 监听器?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc7085 | 官方: 否 | 付费: 否
答案:
Selenium WebDriver Listeners, as the name implies, "listen" to any event that the Selenium code specifies. Listeners are useful when you want to know what happens before you click any element, before and after you navigate to an element, or when an exception is thrown and the test fails. Listeners can be used in Selenium Automation Testing to log the order of activities and to capture a screenshot whenever an Exception is thrown. This makes debugging easier in the later stages of Test Execution. Some examples of Listeners are Web Driver Event Listeners and TestNG.
Selenium WebDriver 监听器,顾名思义,“监听”Selenium代码指定的任何事件。当你想了解点击任何元素之前发生了什么、导航到元素之前和之后的情况,或抛出异常且测试失败时,监听器非常有用。在Selenium自动化测试中,可以使用监听器记录活动顺序,并在抛出异常时捕获屏幕截图。这使得在测试执行的后期阶段更容易调试。一些监听器的示例包括 Web Driver Event Listeners 和 TestNG。
428. What is the implementation of WebDriver Listeners?
WebDriver 监听器的实现方法是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b37c4758d557c902bc7088 | 官方: 否 | 付费: 否
答案:
The Webdriver Event Listeners can be implemented in one of two ways: - WebDriverEventListener is an interface with several built-in methods for tracking Webdriver events. It necessitates the implementation of ALL of the methods described in the Interface.
Webdriver 事件监听器可以通过以下两种方式之一实现:- WebDriverEventListener 是一个接口,具有几个内置方法用于跟踪Webdriver事件。它要求实现接口中描述的所有方法。
- The AbstractWebDriverEventListener class gives us the ability to implement only the methods that we're interested in.
429. In Selenium WebDriver, how do you handle Ajax calls?
在 Selenium WebDriver 中,如何处理 Ajax 调用?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc708b | 官方: 否 | 付费: 否
答案:
When using Selenium WebDriver, one of the most prevalent challenges is handling AJAX calls. We would have no way of knowing when the AJAX call would complete, and the page would be refreshed. In this tutorial, we'll look at how to use Selenium to handle AJAX calls. AJAX (Asynchronous JavaScript and XML) is an acronym for Asynchronous JavaScript and XML. AJAX allows a web page to obtain little quantities of data from the server without having to completely reload the page. Without reloading the page, AJAX sends HTTP requests from the client to the server and then processes the server's answer. Wait commands may not work with AJAX controls. It's only that the page itself is not going to refresh.
在使用Selenium WebDriver时,最普遍的挑战之一是处理AJAX调用。我们无法知道AJAX调用何时完成,页面何时刷新。在本教程中,我们将研究如何使用Selenium处理AJAX调用。AJAX(异步JavaScript和XML)是Asynchronous JavaScript and XML的缩写。AJAX允许网页从服务器获取少量数据,而无需完全重新加载页面。在不重新加载页面的情况下,AJAX从客户端向服务器发送HTTP请求,然后处理服务器的响应。等待命令可能无法与AJAX控件一起使用。只是页面本身不会刷新。
The essential information may show on the web page without refreshing the browser when you click on a submit button. It may load in a fraction of a second, or it may take longer. We have no control over how long it takes for pages to load. In Selenium, the easiest way to deal with circumstances like this is to employ dynamic waits (i.e., WebDriverWait in combination with ExpectedCondition) The following are some of the approaches that are available:
当你点击提交按钮时,基本信息可能会在不刷新浏览器的情况下显示在网页上。它可能在一瞬间加载完成,也可能需要更长时间。我们无法控制页面加载所需的时间。在Selenium中,处理此类情况最简单的方法是使用动态等待(即WebDriverWait与ExpectedCondition结合使用)。以下是一些可用的方法:
- titleIs() – The anticipated condition looks for a specific title on a page.
wait.until(ExpectedConditions.titleIs("Big Sale of the Year"));
wait.until(ExpectedConditions.titleIs("Big Sale of the Year"));
- elementToBeClickable() – The desired condition requires that an element be clickable, which means that it must be present/displayed/visible on the screen and enabled.
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("xpath")));
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("xpath")));
- alertIsPresent() – The expected condition anticipates the appearance of an alert box.
wait.until(ExpectedConditions.alertIsPresent())!=null);
wait.until(ExpectedConditions.alertIsPresent())!=null);
- textToBePresentInElement() – The anticipated condition looks for a string pattern in an element.
wait.until(ExpectedConditions.textToBePresentInElement(By.id("text"),"text to be found");
wait.until(ExpectedConditions.textToBePresentInElement(By.id("text"),"text to be found");
430. Which implementation of WebDriver promises to be the fastest?
哪种 WebDriver 实现承诺速度最快?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b37c4758d557c902bc708e | 官方: 否 | 付费: 否
答案:
HTMLUnitDriver is the quickest WebDriver implementation because the HTMLUnitDriver does not run tests in the browser, this is the case. When compared to running the scripts without a browser, starting a browser and performing test cases took longer. For test case execution, HTMLUnitDriver used a simple HTTP request-response method.
HTMLUnitDriver是最快的WebDriver实现,因为HTMLUnitDriver不在浏览器中运行测试,情况就是这样。与不使用浏览器运行脚本相比,启动浏览器并执行测试用例耗时更长。对于测试用例执行,HTMLUnitDriver使用简单的HTTP请求-响应方法。
431. At a bare minimum, how many parameters do selenium commands have?
至少需要多少参数,Selenium命令才可运行?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc7091 | 官方: 否 | 付费: 否
答案:
The following four parameters need to be passed in Selenium:
在Selenium中需要传递以下四个参数:
- Host: This is the parameter that binds Selenium to a particular IP address. Because we usually perform Selenium tests on our local system, the value will be 'localhost.' Instead of localhost, you can specify an IP address.
The Syntax is as follows:
语法如下:
java -jar-host
java -jar-host
- Port number: TCP/IP port for connecting Selenium tests to the Selenium Grid Hub. 4444 is the default port hub.
The Syntax is as follows:
语法如下:
java -jar-role hub -port 4444
java -jar-role hub -port 4444
Assure this port isn't being used by any other software on your machine. An exception like Exception in thread "main" java.net may occur. Selenium is already running on port 4444. BindException: Selenium is already running on port 4444. Alternatively, some other service is available.
确保此端口未被机器上的任何其他软件使用。可能会出现类似“线程“main”中的异常 java.net”的异常。Selenium已在端口4444上运行。BindException:Selenium已在端口4444上运行。或者,有其他服务可用。
If this happens, you may either kill the other process using port 4444 or tell Selenium-Grid to use a new port for its hub. If you want to change the hub's port, the -port option can be used.
如果发生此情况,您可以终止使用端口4444的其他进程,或者让Selenium-Grid为其hub使用新端口。如果要更改hub的端口,可以使用-port选项。
- Browser: For the execution of the selenium scripts I required a browser to be passed.
- Url: The URL of the application needs to be passed.
432. As seen below, we establish a WebDriver reference variable called 'driver.' What exactly is the purpose of proceeding in this manner?
如下所示,我们建立了一个名为“driver”的WebDriver引用变量。以这种方式进行的确切目的是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc7094 | 官方: 否 | 付费: 否
答案:
WebDriver driver = new FirefoxDriver();
WebDriver driver = new FirefoxDriver();
instead of creating
而不是创建
FirefoxDriver driver = new FirefoxDriver();
FirefoxDriver driver = new FirefoxDriver();
We may use the same driver variable to work with any browser we want, such as IEDriver, SafariDriver, and so on if we construct a reference variable of type WebDriver.
如果我们构造一个WebDriver类型的引用变量,就可以使用同一个driver变量来处理我们想要的任何浏览器,例如IEDriver、SafariDriver等。
433. What kinds of Selenium WebDriver exceptions have you run into?
您遇到过哪些类型的Selenium WebDriver异常?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc7097 | 官方: 否 | 付费: 否
答案:
In the following project the exceptions we've run into are as follows: - Element Not Visible Exception: This error is produced when you try to discover a certain element on a webpage that is not currently accessible, despite the fact that it exists in the DOM. Also, if you're trying to find an element with an XPath that connects two or more elements, it can be difficult.
在以下项目中,我们遇到的异常如下:- 元素不可见异常(Element Not Visible Exception):当您尝试在网页上发现某个元素,但该元素当前不可访问(尽管它存在于DOM中)时,会产生此错误。此外,如果您尝试使用连接两个或多个元素的XPath查找元素,也可能会遇到困难。
Stale Element Reference Exception: This is thrown in one of two scenarios, the first of which is more prevalent:
The element has been completely removed. The element has been detached from the DOM.该元素已被完全移除。该元素已从DOM中分离。
On the elements, with which we are interacting, destruction and then restoration, we get a stale element reference exception. When this happens, the element's DOM reference becomes invalid. Because of this, we are unable to obtain the element's reference.
在与元素交互时,如果元素被销毁后又恢复,我们会遇到过时元素引用异常。发生这种情况时,元素的DOM引用变得无效。因此,我们无法获取该元素的引用。
The following are some more common exceptions: - WebDriverException
以下是一些更常见的异常:- WebDriverException
- TimeoutException
- NoAlertPresentException
- NoSuchWindowException
- IllegalStateException
- NoSuchElementException.
434. What is the best way to deal with StaleElementReferenceException?
处理StaleElementReferenceException的最佳方式是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc709a | 官方: 否 | 付费: 否
答案:
Before we look at how to manage a StaleElementReferenceException using the Page Object Model, let's have a look at how to handle a StaleElementReferenceException.
在我们查看如何使用页面对象模型来管理StaleElementReferenceException之前,让我们先看看如何处理StaleElementReferenceException。
First, let's define Stale Element Reference Exception. Stale refers to something that is old, deteriorated, and no longer fresh. An old or no longer available element is referred to as a stale element. Assume there is a WebElement in WebDriver that is discovered on a web page. The WebElement becomes stale when the DOM changes. The StaleElementReferenceException is thrown when we try to interact with a stale element.
首先,让我们定义过时元素引用异常。Stale指的是过时的、已退化的、不再新鲜的东西。过时或不再可用的元素被称为过时元素。假设WebDriver中有一个在网页上发现的WebElement。当DOM发生变化时,该WebElement会变得过时。当我们尝试与过时元素交互时,会抛出StaleElementReferenceException异常。
435. In Selenium WebDriver, how do you take a screenshot?
在Selenium WebDriver中,如何截图?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc709d | 官方: 否 | 付费: 否
答案:
During the execution of the test scripts, test cases may fail. We just capture a screenshot and save it in a result repository while manually executing the test cases. Selenium WebDriver can be used to accomplish the same thing. Some of the instances in which we might need to use Selenium WebDriver to capture a screenshot are as follows: - Problems with applications
在执行测试脚本期间,测试用例可能会失败。在手动执行测试用例时,我们只是截图并保存到结果存储库中。Selenium WebDriver可以用来完成同样的事情。以下是可能需要使用Selenium WebDriver截图的几种情况:- 应用程序问题
- Assertion Defect
- Finding Web Elements on the web page is difficult.
Take a break to look for Webelements on the page.
TakesScreenshot is a Selenium interface that has a function getScreenShotAs that may be used to take a screenshot of the programme under test. When capturing screenshots with Selenium 3, we may run into a few difficulties. We utilize the aShot() function to get around this.TakesScreenshot是Selenium的一个接口,它有一个getScreenShotAs函数,可以用来截取被测程序的截图。使用Selenium 3截图时,我们可能会遇到一些困难。我们使用aShot()函数来解决这个问题。
436. How do I use Selenium WebDriver to enter text into a text box?
如何使用Selenium WebDriver在文本框中输入文本?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70a0 | 官方: 否 | 付费: 否
答案:
Using the method sendKeys()
使用sendKeys()方法
WebDriver driver = new FirefoxDriver();
WebDriver driver = new FirefoxDriver();
driver.get("https://www.youtube.com");
driver.get("https://www.youtube.com");
driver.findElement(By.xpath("xpath")).sendKeys("Interview Bit");
driver.findElement(By.xpath("xpath")).sendKeys("Interview Bit");
437. How can I use Selenium WebDriver to clear the text in a text box?
如何使用Selenium WebDriver清除文本框中的文本?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70a7 | 官方: 否 | 付费: 否
答案:
The above task can be done using the clear() function as shown below:
上述任务可以使用如下所示的clear()函数来完成:
WebDriver driver = new FirefoxDriver();
WebDriver driver = new FirefoxDriver();
driver.get("https://www.youtube.com");
driver.get("https://www.youtube.com");
driver.findElement(By.xpath("xpath_of_element1")).sendKeys("Interview Bit");
driver.findElement(By.xpath("xpath_of_element1")).sendKeys("Interview Bit");
driver.findElement(By.xpath("xpath_of_element1")).clear();
driver.findElement(By.xpath("xpath_of_element1")).clear();
438. What is the best way to acquire the textual matter of a web element?
获取网页元素文本内容的最佳方式是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70aa | 官方: 否 | 付费: 否
答案:
The best way to acquire the textual matter of a web element is by employing the getText() method as shown below:
获取网页元素文本内容的最佳方式是使用getText()方法,如下所示:
package interviewBit;
包InterviewBit;
// package name
// 包名
import org.openqa.selenium.By;
import org.openqa.selenium.By;
import org.testng.annotations.Test;
import org.testng.annotations.Test;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebDriver;
// importing the necessary libraries
// 导入必要的库
// Test class
// 测试类
public class Test {
public class Test {
@Test
@Test
public void testmethod(){
public void testmethod(){
// sets the property as required
// 按要求设置该属性
System.setProperty("webdriver.chrome.driver","C:\Selenium Environment\Drivers\chromedriver.exe");
System.setProperty("webdriver.chrome.driver","C:\Selenium Environment\Drivers\chromedriver.exe");
//Creates a new Chrome Web Driver
// 创建一个新的Chrome Web驱动程序
WebDriver driver = new ChromeDriver();
WebDriver driver = new ChromeDriver();
driver.get("https://www.youtube.com");
driver.get("https://www.youtube.com");
String textAvailable=driver.findElement(By.xpath("//*[@id='gbw']/div/div/div[1]/div[1]/a")).getText();
String textAvailable=driver.findElement(By.xpath("//*[@id='gbw']/div/div/div[1]/div[1]/a")).getText();
System.out.println("Textual Matter which is Present is :" + textAvailable);
System.out.println("存在的文本内容是:" + textAvailable);
}
}
439. How do I retrieve the value of an attribute in Selenium WebDriver?
如何在Selenium WebDriver中检索属性的值?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70ad | 官方: 否 | 付费: 否
答案:
Using the getAttribute(value) method. It returns the value of the parameterized attribute.
使用getAttribute(value)方法。它返回参数化属性的值。
HTML:
HTML:
Interview Bit
Interview Bit
Selenium Program :
Selenium程序:
String attributeValue = driver.findElement(By.name("nameSeleniumWebDriver")).getAttribute("value");
String attributeValue = driver.findElement(By.name("nameSeleniumWebDriver")).getAttribute("value");
System.out.println("Available attribute value is :"+attributeValue);
System.out.println("可用的属性值是:"+attributeValue);
Output:
输出:
valueSeleniumWebDriver
valueSeleniumWebDriver
440. How can I use Selenium WebDriver for clicking on a hyperlink?
如何使用 Selenium WebDriver 点击超链接?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70b0 | 官方: 否 | 付费: 否
答案:
In Selenium, we use the click() method for clicking on a hyperlink.
在 Selenium 中,我们使用 click() 方法来点击超链接。
driver.findElement(By.linkText("Interview Bit Website")).click();
driver.findElement(By.linkText("Interview Bit Website")).click();
441. How do I use Selenium WebDriver for submitting a form?
如何使用 Selenium WebDriver 提交表单?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70b3 | 官方: 否 | 付费: 否
答案:
For submitting a form in Selenium WebDriver, we use the "submit" method on the element.
在 Selenium WebDriver 中提交表单时,我们在元素上使用“submit”方法。
driver.findElement(By.id("form")).submit();
driver.findElement(By.id("form")).submit();
442. In Selenium WebDriver, how do I push the ENTER key on a text box?
在 Selenium WebDriver 中,如何在文本框上按下回车键?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70b6 | 官方: 否 | 付费: 否
答案:
To utilize Selenium WebDriver to hit the ENTER key, we must use Selenium Enum Keys with the constant ENTER.
要使用 Selenium WebDriver 按下回车键,我们必须使用 Selenium 枚举 Keys 中的常量 ENTER。
driver.findElement(By.xpath("xpath")).sendKeys(Keys.ENTER);
driver.findElement(By.xpath("xpath")).sendKeys(Keys.ENTER);
443. How can I use WebDriver to mouse hover over a web element?
如何使用 WebDriver 鼠标悬停在网页元素上?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70b9 | 官方: 否 | 付费: 否
答案:
We can use the Actions class to mouse hover over a web element as shown below in the code snippet:
我们可以使用 Actions 类来鼠标悬停在网页元素上,如下方代码片段所示:
WebElement ele = driver.findElement(By.xpath("xpath"));
WebElement ele = driver.findElement(By.xpath("xpath"));
//Create object 'action' of an Actions class
//创建 Actions 类的对象 'action'
Actions action = new Actions(driver);
Actions action = new Actions(driver);
//Mouseover on an element
//鼠标悬停在元素上
action.moveToElement(ele).perform();
action.moveToElement(ele).perform();
444. In Selenium WebDriver, how do you use the Recovery Scenario?
在Selenium WebDriver中,如何使用恢复场景?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70bd | 官方: 否 | 付费: 否
答案:
Within Selenium WebDriver Java tests, by using "Try Catch Block."
在Selenium WebDriver Java测试中,通过使用“Try Catch Block”来实现。
try {
try {
driver.get("www.interviewbit.com");
driver.get("www.interviewbit.com");
}catch(Exception e){
}catch(Exception e){
System.out.println(e.getMessage());
System.out.println(e.getMessage());
}
445. What is the Selenium WebDriver Architecture?
什么是Selenium WebDriver架构?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: system-design
- 分类: fullstack
- id: 69b37c4758d557c902bc70c5 | 官方: 否 | 付费: 否
答案:
Selenium WebDriver is a web framework for performing cross-browser testing (Cross-browser testing is comparing and assessing your website's behaviour in various browser contexts. It ensures that your website provides the best possible user experience regardless of the browser used to access it). This program is used to test web-based applications to ensure that they work as expected. Selenium WebDriver allows us to write test scripts in the programming language of our choice. As previously stated, it is an improvement to Selenium RC in that it overcomes a few shortcomings. Although Selenium WebDriver is unable to handle window components, this limitation can be bypassed by using tools such as Sikuli, Auto IT, and others.
Selenium WebDriver是一个用于执行跨浏览器测试的Web框架(跨浏览器测试是比较和评估网站在各种浏览器环境中的行为。它确保无论使用哪种浏览器访问网站,都能提供最佳用户体验)。该程序用于测试基于Web的应用程序,以确保它们按预期工作。Selenium WebDriver允许我们选择自己偏好的编程语言编写测试脚本。如前所述,它是对Selenium RC的改进,因为它克服了一些缺点。虽然Selenium WebDriver无法处理窗口组件,但可以通过使用Sikuli、Auto IT等工具来绕过此限制。
The Selenium WebDriver Architecture consists of:
Selenium WebDriver架构包括:
- Selenium Client library.
- JSON wire protocol over HTTP.
- Browser Drivers.
- Browsers.
446. Why is it important to use TestNG when working with Selenium RC?
为什么在使用Selenium RC时使用TestNG很重要?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70c8 | 官方: 否 | 付费: 否
答案:
TestNG is a testing framework that provides more powerful and flexible test configuration and execution than JUnit, the default testing framework used with Selenium RC. TestNG allows for the annotation of test methods, support for data-driven testing, and the ability to run tests in parallel, which can lead to faster test execution and better test organization. Additionally, TestNG provides more advanced reporting and logging capabilities than JUnit. Using TestNG with Selenium RC can help improve the efficiency and effectiveness of automating web application testing.
TestNG是一个测试框架,它提供了比JUnit(Selenium RC中使用的默认测试框架)更强大、更灵活的测试配置和执行方式。TestNG允许注解测试方法、支持数据驱动测试,并能并行运行测试,这可以加快测试执行速度并改善测试组织。此外,TestNG比JUnit提供更先进的报告和日志记录功能。将TestNG与Selenium RC结合使用有助于提高Web应用程序测试自动化的效率和有效性。
447. Can Selenium be used to test responsive web design?
可以使用Selenium测试响应式Web设计吗?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70cb | 官方: 否 | 付费: 否
答案:
Yes, Selenium can be used to test responsive web design. Selenium is a web automation tool that allows for the automation of browser interactions, and as such, it can be used to test the responsiveness of a web page by simulating interactions on different screen sizes and resolutions. This can include testing how the page layout adjusts to different viewport sizes, testing how the page elements are displayed on different devices, and testing how the page behaves when a user switches between landscape and portrait orientations.
是的,可以使用Selenium测试响应式Web设计。Selenium是一个Web自动化工具,允许自动化浏览器交互,因此,可以通过模拟不同屏幕尺寸和分辨率下的交互来测试网页的响应性。这包括测试页面布局如何适应不同的视口大小、测试页面元素在不同设备上的显示方式,以及测试用户在横屏和竖屏方向之间切换时页面的行为。
One way to test responsive web design with Selenium is by using the Selenium WebDriver API to set the browser's viewport size and then test the page's layout and functionality. Another way is to use a third-party library such as Selenium-Responsive-Testing which allows you to test how the page behaves on different devices and screen sizes.
使用Selenium测试响应式Web设计的一种方式是利用Selenium WebDriver API设置浏览器视口大小,然后测试页面的布局和功能。另一种方式是使用第三方库,如Selenium-Responsive-Testing,它允许您测试页面在不同设备和屏幕尺寸上的行为。
It is worth noting that Selenium alone is not enough for responsive web design testing, it should be combined with other methods such as manual testing, visual testing, and using responsive design testing tools to get complete coverage.
值得注意的是,仅靠Selenium不足以进行响应式Web设计测试,应结合其他方法,如手动测试、视觉测试和使用响应式设计测试工具,以获得完整的覆盖率。
448. What API should be used to test databases when using Selenium WebDriver for database testing?
使用Selenium WebDriver进行数据库测试时,应使用什么API来测试数据库?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70ce | 官方: 否 | 付费: 否
答案:
Selenium WebDriver is a tool for automating web browsers, it's not designed for database testing. To test databases, you need a database testing tool that can connect to the database and perform various operations like running SQL queries and asserting the results. Some examples of database testing tools are DBUnit, jOOQ, and JDBC. These tools provide an API that can be used to connect to the database, perform operations and assert the results.
Selenium WebDriver是用于自动化Web浏览器的工具,并非专为数据库测试而设计。要测试数据库,您需要一种能连接数据库并执行各种操作(如运行SQL查询和断言结果)的数据库测试工具。数据库测试工具的一些示例包括DBUnit、jOOQ和JDBC。这些工具提供了可用于连接数据库、执行操作和断言结果的API。
449. What are assertions in Selenium?
Selenium 中的断言是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70d1 | 官方: 否 | 付费: 否
答案:
In the context of Selenium, assertions are used to check if the actual outcome of a test matches the expected outcome. Assertions are used to validate that a certain condition is true and if it's not true, the test execution will be stopped and an assertion error will be thrown. Assertions can be used to verify that a specific element is present on the page, to check the text of an element, to check the value of an input field, and many other things. Selenium WebDriver provides assertion methods through the org.junit.Assert and org.testng.Assert classes for JUnit and TestNG respectively.
在 Selenium 的上下文中,断言用于检查测试的实际结果是否与预期结果匹配。断言用于验证某个条件是否为真,如果条件不为真,测试执行将停止并抛出断言错误。断言可用于验证页面上是否存在特定元素、检查元素的文本、检查输入字段的值,以及许多其他内容。Selenium WebDriver 分别通过 org.junit.Assert 和 org.testng.Assert 类为 JUnit 和 TestNG 提供断言方法。
450. What is the Silk Test Tool?
什么是 Silk Test 工具?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70d4 | 官方: 否 | 付费: 否
答案:
Silk Testing (formerly known as Segue Silk Test) is a commercial, functional, and regression testing tool used for automating the testing of software applications. It is developed and maintained by Micro Focus and it is used for automating GUI-based tests for a variety of applications, including web, mobile, and desktop applications. The tool can be used to test applications on different platforms such as Windows, iOS, and Android. Silk Testing uses a proprietary scripting language called 4Test, which allows users to automate the testing process by writing test scripts that simulate user interactions with the application under test. The tool also has a visual text editor that allows users to record and edit test scripts using a GUI.
Silk Testing(原名 Segue Silk Test)是一种商业化的功能和回归测试工具,用于自动化测试软件应用程序。它由 Micro Focus 开发和维护,用于自动化基于 GUI 的测试,适用于各种应用程序,包括 Web、移动和桌面应用。该工具可用于在不同平台上测试应用程序,如 Windows、iOS 和 Android。Silk Testing 使用一种称为 4Test 的专有脚本语言,允许用户通过编写模拟用户与被测应用程序交互的测试脚本来自动化测试过程。该工具还具有可视化文本编辑器,允许用户使用 GUI 录制和编辑测试脚本。
451. What is the purpose of the testing.xml file ?
testing.xml 文件的用途是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70d7 | 官方: 否 | 付费: 否
答案:
The testing.xml file, also known as testng.xml is an XML configuration file used in the TestNG framework. It is used to configure and execute test suites and test cases. It provides a way to define and organize test methods, classes, and packages into test suites. It also allows setting up test execution order, parallel execution, test data, test listeners, test reporting, and more. With the testing.xml file, users can specify which test methods or classes should be included or excluded in a test run, what test listeners should be used, and what test configuration should be used, among other things. It is used to organize and execute test methods, classes, and packages in a logical and organized way.
testing.xml 文件,也称为 testng.xml,是 TestNG 框架中使用的 XML 配置文件。它用于配置和执行测试套件和测试用例。它提供了一种将测试方法、类和包定义和组织为测试套件的方式。它还允许设置测试执行顺序、并行执行、测试数据、测试监听器、测试报告等。使用 testing.xml 文件,用户可以指定在测试运行中包含或排除哪些测试方法或类、应使用哪些测试监听器,以及应使用哪些测试配置等。它用于以逻辑和有条理的方式组织和执行测试方法、类和包。
452. What are the areas where Selenium can improve its features?
Selenium 在哪些领域可以改进其功能?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70da | 官方: 否 | 付费: 否
答案:
Selenium has a wide range of capabilities, but some areas where it could see the benefit in extending its features include: - Mobile testing: Selenium has limited support for mobile testing. It can automate web applications on mobile browsers, but it does not support automating native mobile applications.
Selenium 具有广泛的功能,但在某些领域扩展其功能可能受益,包括:- 移动测试:Selenium 对移动测试的支持有限。它可以自动化移动浏览器上的 Web 应用,但不支持自动化原生移动应用。
- Visual testing: Selenium is mainly used for functional testing, but it does not have built-in support for visual testing. Visual testing compares the look and feel of the application to a pre-approved design and helps in identifying issues related to layout, alignment, and font.
- Cross-browser testing: Selenium supports a wide range of browsers, but there are still some browsers that are not fully supported or have limited support.
- Test reports and analysis: Selenium's test reporting capabilities are basic and it does not provide advanced test analytics features like test coverage, flaky test detection, and root cause analysis.
- Performance testing: Selenium is mainly used for functional testing, but it does not have built-in support for performance testing. Performance testing can help to measure the responsiveness, stability, and scalability of the application under test.
Continuous Integration: Selenium does not provide out-of-the-box support for continuous integration (CI) and continuous delivery (CD) pipeline, it needs to be integrated with other tools to automate the test execution in CI/CD pipeline.
It's worth noting that Selenium is widely used and has a large community of developers who are constantly working to improve and extend its capabilities. There are also many other test automation tools that can be used in combination with Selenium to address these limitations.值得注意的是,Selenium 被广泛使用,并且拥有庞大的开发者社区,他们不断努力改进和扩展其功能。还有许多其他测试自动化工具可以与 Selenium 结合使用,以解决这些限制。
453. Can you explain what Page Factory is?
你能解释一下什么是 Page Factory 吗?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70dd | 官方: 否 | 付费: 否
答案:
Page Factory is a design pattern used to create an object repository for web elements in Selenium WebDriver. It's an extension of the Page Object Model design pattern, which is used to create a centralized repository for web elements. It uses annotations to identify and initialize web elements at runtime and make the code more readable and maintainable by separating the test code from the technical details of locating web elements. In order to use Page Factory, you need to create a class for each web page and define web elements in that class using the @FindBy annotation it also contains methods for interacting with the web elements.
Page Factory 是一种设计模式,用于在 Selenium WebDriver 中为 Web 元素创建对象仓库。它是 Page Object Model 设计模式的扩展,用于为 Web 元素创建集中式仓库。它使用注解在运行时识别和初始化 Web 元素,并通过将测试代码与定位 Web 元素的细节分离开来,使代码更具可读性和可维护性。为了使用 Page Factory,你需要为每个 Web 页面创建一个类,并使用 @FindBy 注解在该类中定义 Web 元素,同时还包含与 Web 元素交互的方法。
454. What is the Actions class?
什么是 Actions 类?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70e0 | 官方: 否 | 付费: 否
答案:
The Actions class is a part of the Selenium Python bindings for automating web browsers. It allows you to perform actions on web elements, such as moving the mouse over an element, clicking on it, and sending keys to it. The Actions class is typically used in conjunction with the WebDriver class, which is the main class for interacting with a web browser.
Actions 类是 Selenium Python 绑定的一部分,用于自动化 Web 浏览器。它允许你在 Web 元素上执行操作,例如将鼠标悬停在元素上、点击元素以及向元素发送键。Actions 类通常与 WebDriver 类结合使用,WebDriver 类是与 Web 浏览器交互的主要类。
455. What are the steps for troubleshooting tests using Selenium IDE?
使用 Selenium IDE 对测试进行故障排除的步骤是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70e3 | 官方: 否 | 付费: 否
答案:
Troubleshooting tests using Selenium IDE can be a multi-step process, but here are some general steps that you can follow: - Verify that the test is correctly recorded: Make sure that the test is recorded correctly and that all the elements and commands are in the correct order.
使用 Selenium IDE 对测试进行故障排除可能是一个多步骤的过程,但这里有一些通用步骤可以遵循:- 验证测试是否正确录制:确保测试录制正确,所有元素和命令的顺序正确。
- Check the test for syntax errors: Selenium IDE will alert you if there are any syntax errors in the test, so make sure to check for and fix any errors.
- Check the test for compatibility issues: Make sure that the test is compatible with the browser and version that you are using to run the test.
- Check the test for missing elements: Make sure that all the elements used in the test are present on the web page.
- Run the test in debug mode: Selenium IDE provides a debug mode that allows you to step through the test and check the values of variables and the state of the web page at each step.
- Check the browser's developer tools: The browser's developer tools can be used to inspect the web page and check for any issues.
- Check the log messages: Selenium IDE provides a log panel where you can view log messages generated by the test. This can be useful for troubleshooting issues.
- Check the Selenium documentation: The Selenium documentation provides information on the different commands and options available in Selenium IDE, which can be helpful for troubleshooting.
- Finally, you can also seek help from the Selenium community and forums, where you can ask questions and get help from other Selenium users.
456. What steps can be taken to resolve an issue where a Selenium script only works properly on Google Chrome but not Internet Explorer?
可以采取哪些步骤来解决 Selenium 脚本仅在 Google Chrome 上正常工作但在 Internet Explorer 上不正常工作的问题?
- 知识点: 测试 / 行为与软技能 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: behavioral | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70e6 | 官方: 否 | 付费: 否
答案:
Here are some possible steps that can be taken to resolve an issue where a Selenium script only works properly on Google Chrome but not Internet Explorer:
以下是解决Selenium脚本仅在Google Chrome上正常工作但在Internet Explorer上不生效的问题时,可以采取的一些可能步骤:
Verify that the correct version of Internet Explorer is being used: Selenium supports different versions of Internet Explorer, so make sure that you are using a version that is compatible with your Selenium script. 2. Check the Internet Explorer settings: Make sure that Internet Explorer's security settings are configured correctly and that the browser is not running in compatibility mode. 3. Check the Selenium WebDriver version: Make sure that you are using the latest version of the Selenium WebDriver for Internet Explorer. 4. Check the browser's developer tools: Use the browser's developer tools to inspect the web page and check for any issues. 5. Check the log messages: Selenium provides log messages that can be helpful for troubleshooting issues. 6. Check the Internet Explorer documentation: The Internet Explorer documentation provides information on the different options and settings available in Internet Explorer, which can be helpful for troubleshooting. 7. Use a different browser: If the above steps do not resolve the issue, you may want to consider using a different browser that is supported by Selenium, like Firefox or Microsoft Edge. 8. You can also try to seek help from the Selenium community and forums, where you can ask questions and get help from other Selenium users.
- 验证使用的Internet Explorer版本是否正确:Selenium支持不同版本的Internet Explorer,因此请确保您使用的版本与您的Selenium脚本兼容。 2. 检查Internet Explorer设置:确保Internet Explorer的安全设置配置正确,并且浏览器未在兼容模式下运行。 3. 检查Selenium WebDriver版本:确保您使用的是适用于Internet Explorer的最新版本Selenium WebDriver。 4. 检查浏览器的开发者工具:使用浏览器的开发者工具检查网页并查找任何问题。 5. 检查日志消息:Selenium提供日志消息,这些消息有助于排查问题。 6. 检查Internet Explorer文档:Internet Explorer文档提供了有关Internet Explorer中可用不同选项和设置的信息,这有助于故障排除。 7. 使用其他浏览器:如果上述步骤无法解决问题,您可能需要考虑使用Selenium支持的另一种浏览器,如Firefox或Microsoft Edge。 8. 您还可以尝试从Selenium社区和论坛寻求帮助,在那里您可以提问并从其他Selenium用户那里获得帮助。
457. Is it possible to open pop-up windows with Selenium?
是否可以使用Selenium打开弹出窗口?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70ed | 官方: 否 | 付费: 否
答案:
Yes, it is possible to open pop-up windows with Selenium. Selenium WebDriver provides methods to interact with browser windows, so you can use Selenium to open new windows, switch between windows, and close windows.
是的,可以使用Selenium打开弹出窗口。Selenium WebDriver提供了与浏览器窗口交互的方法,因此您可以使用Selenium打开新窗口、在窗口之间切换以及关闭窗口。
You can open a new window using the window_handles method, and switch to the new window using the switch_to.window() method. Once you have switched to the new window, you can interact with the elements on the pop-up window just like you would interact with elements on the main window.
您可以使用window_handles方法打开新窗口,并使用switch_to.window()方法切换到新窗口。一旦切换到新窗口,您就可以像在主窗口上操作元素一样,与弹出窗口上的元素进行交互。
You can also use the Alert class of Selenium WebDriver to handle JavaScript alerts and confirmations.
您也可以使用Selenium WebDriver的Alert类来处理JavaScript警报和确认框。
It's worth noting that, while some browsers may block pop-ups by default, you need to configure the browser settings to allow pop-ups for the testing website.
值得注意的是,虽然某些浏览器默认可能阻止弹出窗口,但您需要配置浏览器设置,以允许测试网站的弹出窗口。
It's also important to use explicit waits to handle the dynamic nature of the web pages and pop-ups, as the time taken for a pop-up window to load may vary depending on the browser, internet connection, and other factors.
使用显式等待来处理网页和弹出窗口的动态性质也很重要,因为弹出窗口加载所需的时间可能因浏览器、互联网连接和其他因素而异。
458. Can selenium be used to launch web browsers?
Selenium能否用于启动网页浏览器?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70f1 | 官方: 否 | 付费: 否
答案:
Yes, Selenium provides good support to launch web browsers like Google Chrome, Mozilla Firefox, Internet Explorer, etc.
是的,Selenium提供了良好的支持来启动网页浏览器,如Google Chrome、Mozilla Firefox、Internet Explorer等。
The following commands can be used to launch web browsers using Selenium: - WebDriver driver = new FirefoxDriver();
以下命令可用于使用Selenium启动网页浏览器:- WebDriver driver = new FirefoxDriver();
- WebDriver driver = new ChromeDriver();
- WebDriver driver = new InternetExplorerDriver();
459. Is it possible to use only perform() without build()?
是否可以不调用build()而仅使用perform()?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70f7 | 官方: 否 | 付费: 否
答案:
Yes, it is possible to use the perform() method without calling the build() method. The build() method is used to construct and return an instance of the ActionChains class, which is a container for a series of actions. However, if you don't call build(), the actions will be performed immediately when you call perform().
是的,可以不调用build()方法而使用perform()方法。build()方法用于构建并返回ActionChains类的一个实例,该类是系列操作的容器。但是,如果您不调用build(),操作将在您调用perform()时立即执行。
actions.move_to_element(element).click().perform()
actions.move_to_element(element).click().perform()
The above line of code is an example of using perform() without calling build(). The move_to_element(), click() methods are chained together and the perform() method is used to execute all the chained actions.
上述代码行是不调用build()而使用perform()的示例。move_to_element()、click()方法被链式连接,perform()方法用于执行所有链式操作。
However, it is important to note that, perform() method is used to execute all the chained actions only after calling build() when you are chaining multiple actions together and want to execute them together.
然而,需要注意的是,当您将多个操作链接在一起并希望一起执行时,只有在调用build()后才能使用perform()方法执行所有链式操作。
460. What is StaleElementReferenceException? When does this occur? And how to overcome such exceptions?
什么是 StaleElementReferenceException?它何时发生?以及如何克服此类异常?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70fa | 官方: 否 | 付费: 否
答案:
StaleElementReferenceException is an exception that is thrown in Selenium WebDriver when a web element that was previously found on a web page is no longer available or has been deleted from the DOM (Document Object Model). This can happen if the web page has been refreshed, the element has been removed or replaced, or the element's parent element has been removed or replaced.
StaleElementReferenceException 是 Selenium WebDriver 中抛出的一种异常,当先前在网页上找到的 Web 元素不再可用或已从 DOM(文档对象模型)中删除时会发生。如果网页已刷新、元素被移除或替换,或者元素的父元素被移除或替换,则可能出现此情况。
This exception occurs when the element is no longer attached to the DOM, which means that the element can no longer be interacted with using the WebDriver.
当元素不再附加到 DOM 时会发生此异常,这意味着无法再使用 WebDriver 与该元素交互。
There are a few ways to overcome this exception: - Re-find the element: You can re-find the element by using the WebDriver's find_element or find_elements methods again.
有几种方法可以克服此异常:- 重新查找元素:您可以再次使用 WebDriver 的 find_element 或 find_elements 方法来重新查找元素。
try:
try:
element.click()
element.click()
except StaleElementReferenceException:
except StaleElementReferenceException:
element = driver.find_element_by_id('element_id')
element = driver.find_element_by_id('element_id')
element.click() - Wait for the element to be available: You can use explicit waits such as WebDriverWait and ExpectedConditions to wait for the element to be available before interacting with it.
element.click() - 等待元素可用:您可以使用显式等待(如 WebDriverWait 和 ExpectedConditions)在交互之前等待元素可用。
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import WebDriverWait
try:
try:
element.click()
element.click()
except StaleElementReferenceException:
except StaleElementReferenceException:
wait = WebDriverWait(driver, 10)
wait = WebDriverWait(driver, 10)
element = wait.until(EC.presence_of_element_located((By.ID, 'element_id')))
element = wait.until(EC.presence_of_element_located((By.ID, 'element_id')))
element.click() - Refresh the page: You can refresh the page using the refresh() method of the WebDriver instance and then re-find the element.
element.click() - 刷新页面:您可以使用WebDriver实例的refresh()方法刷新页面,然后重新查找元素。
try:
try:
element.click()
element.click()
except StaleElementReferenceException:
except StaleElementReferenceException:
driver.refresh()
driver.refresh()
element = driver.find_element_by_id('element_id')
element = driver.find_element_by_id('element_id')
element.click()
element.click()
It is important to note that this exception is a run-time exception, so it's best to catch it and handle it in the code, rather than letting the script crash.
需要注意的是,此异常是运行时异常,因此最好在代码中捕获并处理它,而不是让脚本崩溃。
461. In a Selenium script, what happens if you use both implicit and explicit wait?
在Selenium脚本中,如果同时使用隐式等待和显式等待会发生什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc70fd | 官方: 否 | 付费: 否
答案:
According to the official Selenium manual, mixing Implicit and Explicit Waits is not recommended. Combining the two can result in unpredictable wait times. Only one time in the code is implicit wait specified. Throughout the driver object instance, it will remain the same.
根据官方Selenium手册,不建议混合使用隐式等待和显式等待。结合两者可能导致不可预测的等待时间。代码中隐式等待只指定一次。在整个驱动对象实例中,它会保持不变。
Explicit wait is used in the code whenever it is required. At the time of execution, this wait will be called. It's a conditional waiting period. Wherever explicit wait is applied, it will supersede the implicit wait. As a result, Explicit Wait takes precedence over Implicit Wait .
显式等待在代码中需要时使用。在执行时,此等待将被调用。它是一个条件等待时间段。在应用显式等待的地方,它将取代隐式等待。因此,显式等待优先于隐式等待。
462. In a Selenium Script, what happens if you use both Thread.Sleep and WebDriver Waits?
在Selenium脚本中,如果同时使用Thread.Sleep和WebDriver等待会发生什么?
- 知识点: 测试 / 行为与软技能 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: behavioral | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc7105 | 官方: 否 | 付费: 否
答案:
The Thread.sleep() method allows you to suspend the execution for a specified amount of time in milliseconds. If we use WebDriver waits in conjunction with the Thread.sleep() method, the webdriver will pause the execution for the provided amount of time in the parameter of the Thread.sleep() function before proceeding to the next wait. If we combine both waits, the test execution time will increase.
Thread.sleep()方法允许您以毫秒为单位暂停执行指定时间。如果我们将WebDriver等待与Thread.sleep()方法结合使用,在进入下一个等待之前,WebDriver将暂停执行Thread.sleep()函数参数中提供的时间。如果我们将两种等待结合,测试执行时间将增加。
463. How can I type text into the text box without using the sendKeys() function?
如何使用不使用sendKeys()函数的方式向文本框输入文本?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b37c4758d557c902bc7109 | 官方: 否 | 付费: 否
答案:
We can use the following piece of code to type text into the text box without using the sendKeys() function:
我们可以使用以下代码片段来向文本框输入文本,而无需使用sendKeys()函数:
// To initialize js object
// 初始化 JavaScript 对象
JavascriptExecutor JS = (JavascriptExecutor)webdriver;
JavascriptExecutor JS = (JavascriptExecutor)webdriver;
// To enter username
// 输入用户名
JS.executeScript("document.getElementById('User').value='InterviewBit.com'");
JS.executeScript("document.getElementById('User').value='InterviewBit.com'");
// To enter password
// 输入密码
JS.executeScript("document.getElementById('Pass').value='tester value'");
JS.executeScript("document.getElementById('Pass').value='tester value'");
464. How does Selenium WebDriver handle hidden elements?
Selenium WebDriver 如何处理隐藏元素?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc710c | 官方: 否 | 付费: 否
答案:
Using the JavaScript executor, we can deal with hidden items.
通过使用 JavaScript 执行器,我们可以处理隐藏元素。
(JavascriptExecutor(driver)).executeScript("document.getElementsByClassName(ElementLocator).click();
(JavascriptExecutor(driver)).executeScript("document.getElementsByClassName(ElementLocator).click();
465. What are test design techniques? Explain BVA and ECP with some examples.
什么是测试设计技术?请解释 BVA 和 ECP 并举一些例子。
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc710f | 官方: 否 | 付费: 否
答案:
Test design techniques are the methods or strategies used to design and create test cases for a software application. Some common test design techniques include:
测试设计技术是用于为软件应用程序设计和创建测试用例的方法或策略。一些常见的测试设计技术包括:
Black Box Testing: Testing the functionality of the software without looking into the internal structure or code. 2. White Box Testing: Testing the internal structure or code of the software. 3. Grey Box Testing: Combining both Black Box and White Box testing methods. 4. Boundary Value Analysis (BVA): This technique is used to test the software's behaviour at its input and output boundaries. It involves testing the software with input values that are just above and just below the valid range, as well as testing the software with the maximum and minimum valid input values. 5. Equivalence Class Partitioning (ECP): This technique is used to divide the input domain of the software into a finite number of classes or partitions, where each class represents a group of input values that are expected to behave in the same way. The goal of ECP is to test the software with a representative sample of input values from each partition.
- 黑盒测试:在不查看内部结构或代码的情况下测试软件的功能。 2. 白盒测试:测试软件的内部结构或代码。 3. 灰盒测试:结合黑盒和白盒测试方法。 4. 边界值分析(BVA):该技术用于测试软件在输入和输出边界处的行为。它涉及使用刚好在有效范围之上和之下的输入值,以及使用最大和最小有效输入值来测试软件。 5. 等价类划分(ECP):该技术用于将软件的输入域划分为有限数量的类或分区,其中每个类代表一组预期表现相同的输入值。ECP 的目标是使用每个分区中的代表性输入样本来测试软件。
Examples:
示例:
BVA:
BVA(边界值分析):
In a login form, test the minimum and maximum length of the password field. 2. For a form field that accepts a date, testing the software with a date that is just before and just after the valid range of dates.
- 在登录表单中,测试密码字段的最小和最大长度。 2. 对于接受日期的表单字段,使用刚好在有效日期范围之前和之后的日期测试软件。
ECP:
ECP(等价类划分):
In a form field that accepts a phone number, divide the input domain into three classes: valid phone numbers, phone numbers that are too short, and phone numbers that are too long. 2. In a form field that accepts a price, divide the input domain into two classes: valid prices and invalid prices (e.g., negative prices).
- 在接收电话号码的表单字段中,将输入域划分为三个类别:有效电话号码、过短的电话号码和过长的电话号码。 2. 在接收价格的表单字段中,将输入域划分为两个类别:有效价格和无效价格(例如,负价格)。
It is important to note that these techniques are helpful in creating a comprehensive set of test cases that can help ensure that the software is functioning correctly.
值得注意的是,这些技术有助于创建一套全面的测试用例,从而帮助确保软件正常运行。
However, it's not enough to just use one technique, a combination of different techniques are used to test the software in different ways and identify all the possible defects.
然而,仅使用一种技术是不够的,需要结合不同的技术以不同方式测试软件,并识别所有可能的缺陷。
Recommended Resources
推荐资源
- RPA Interview Questions and Answers
- Java Interview Questions and Answers
- Automation Testing Interview Questions and Answers
- Selenium Interview Questions for 5years Experience
- Cucumber Interview Questions and Answers
- Appium Interview Questions and Answers
- Database Testing Interview Questions
- Technical Interview Guide
- Principles of Software Testing
- Difference Between Alpha and Beta Testing
- Free Software Testing Course
466. How do you set up a Selenium WebDriver project in Java using Maven? Explain the key dependencies.
如何使用Maven在Java中设置Selenium WebDriver项目?解释关键依赖项。
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc7112 | 官方: 否 | 付费: 否
答案:
Setting up Selenium with Java in a professional environment almost always involves Maven. Maven is a build automation and dependency management tool that simplifies library integration and project configuration.
在专业环境中使用Java设置Selenium几乎总是涉及Maven。Maven是一个构建自动化和依赖管理工具,可简化库集成和项目配置。
To create a Selenium project using Maven, you first create a Maven project in your IDE. This automatically generates a pom.xml file, which acts as the central configuration file for managing dependencies.
要使用Maven创建Selenium项目,首先在IDE中创建一个Maven项目。这会自动生成pom.xml文件,该文件作为管理依赖项的核心配置文件。
The most important dependencies required for a selenium webdriver java interview questions scenario are: - selenium-java - Provides the WebDriver API and browser interaction capabilities.
针对selenium webdriver java面试问题场景所需的最重要依赖项包括:- selenium-java — 提供WebDriver API和浏览器交互功能。
- testng or junit - Used for test execution and test lifecycle management.
webdrivermanager - Automatically manages browser driver binaries.
A typical pom.xml dependency section looks like this:典型的pom.xml依赖部分如下所示:
org.seleniumhq.selenium org.seleniumhq.selenium selenium-java selenium-java 4.18.1 4.18.1
org.testng org.testng testng testng 7.9.0 7.9.0 test test
io.github.bonigarcia io.github.bonigarcia webdrivermanager webdrivermanager 5.8.0 5.8.0
The selenium-java dependency includes the WebDriver implementation. TestNG (or JUnit) is used to structure and execute test cases. WebDriverManager removes the need to manually download and configure browser drivers by automatically resolving the correct driver version at runtime.
selenium-java 依赖包含 WebDriver 实现。TestNG(或 JUnit)用于组织和执行测试用例。WebDriverManager 通过在运行时自动解析正确的驱动程序版本,免去了手动下载和配置浏览器驱动程序的需要。
In Maven, the build lifecycle is also important. When you run mvn test, Maven compiles the project and executes all test classes. This becomes especially useful in CI/CD pipelines where automated Selenium tests are triggered during builds.
在 Maven 中,构建生命周期也很重要。当你运行 mvn test 时,Maven 会编译项目并执行所有测试类。这在 CI/CD 流水线中尤其有用,因为在这些流水线中,自动化 Selenium 测试会在构建期间被触发。
467. How do you read and write test data from Excel files using Apache POI with Selenium in Java?
在使用 Java 中的 Selenium 时,如何通过 Apache POI 从 Excel 文件读取和写入测试数据?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4758d557c902bc7115 | 官方: 否 | 付费: 否
答案:
In real automation frameworks, test data is separated from test logic. This is where Apache POI becomes important in selenium with java interview questions.
在实际的自动化框架中,测试数据与测试逻辑是分离的。这就是 Apache POI 在 Selenium 与 Java 面试问题中如此重要的原因。
Apache POI is a Java API used to read and write Microsoft Excel files. For .xlsx files, the commonly used classes are: - XSSFWorkbook - Represents the workbook
Apache POI 是一个用于读写 Microsoft Excel 文件的 Java API。对于 .xlsx 文件,常用的类包括:- XSSFWorkbook - 表示工作簿
- XSSFSheet - Represents a sheet
- XSSFRow - Represents a row
XSSFCell - Represents a cell
To read data from Excel:要从 Excel 读取数据:
FileInputStream fis = new FileInputStream("testdata.xlsx");
FileInputStream fis = new FileInputStream("testdata.xlsx");
XSSFWorkbook workbook = new XSSFWorkbook(fis);
XSSFWorkbook workbook = new XSSFWorkbook(fis);
XSSFSheet sheet = workbook.getSheet("Sheet1");
XSSFSheet sheet = workbook.getSheet("Sheet1");
String value = sheet.getRow(0).getCell(0).getStringCellValue();
String value = sheet.getRow(0).getCell(0).getStringCellValue();
workbook.close();
workbook.close();
fis.close();
fis.close();
To write data back to Excel:
要将数据写回 Excel:
sheet.getRow(0).createCell(1).setCellValue("PASS");
sheet.getRow(0).createCell(1).setCellValue("PASS");
FileOutputStream fos = new FileOutputStream("testdata.xlsx");
FileOutputStream fos = new FileOutputStream("testdata.xlsx");
workbook.write(fos);
workbook.write(fos);
fos.close();
fos.close();
workbook.close();
workbook.close();
In professional frameworks, Excel data is often passed into TestNG using a @DataProvider, enabling data-driven testing. The framework reads multiple rows and feeds them into test methods dynamically.
在专业框架中,Excel 数据常通过 @DataProvider 传递给 TestNG,从而实现数据驱动测试。框架会读取多行数据,并动态地将它们传入测试方法。
468. How do you implement the Singleton WebDriver pattern in a Java Selenium framework?
如何在 Java Selenium 框架中实现 Singleton WebDriver 模式?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b37c4858d557c902bc711d | 官方: 否 | 付费: 否
答案:
The Singleton pattern ensures that only one instance of WebDriver exists during test execution. This prevents multiple browser sessions from being created unintentionally and helps manage resources efficiently.
Singleton 模式确保测试执行期间只存在一个 WebDriver 实例。这可以防止意外创建多个浏览器会话,并有助于高效管理资源。
In Java, Singleton is implemented by creating a private static WebDriver instance, a private constructor, and a public method to return the instance.
在 Java 中,Singleton 通过创建私有静态 WebDriver 实例、私有构造函数和公共方法来返回该实例来实现。
Example:
示例:
public class DriverManager {
public class DriverManager {
private static WebDriver driver;
private static WebDriver driver;
private DriverManager() {}
private DriverManager() {}
public static WebDriver getDriver() {
public static WebDriver getDriver() {
if (driver == null) {
if (driver == null) {
WebDriverManager.chromedriver().setup();
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver = new ChromeDriver();
}
return driver;
return driver;
}
}
This ensures that every test class uses the same WebDriver instance.
这确保了每个测试类都使用同一个 WebDriver 实例。
However, in parallel execution scenarios, using a simple Singleton can cause session conflicts. To solve this, a ThreadLocal implementation is used so that each thread maintains its own WebDriver instance.
然而,在并行执行场景中,使用简单的单例模式可能会导致会话冲突。为了解决这个问题,采用了 ThreadLocal 实现,以便每个线程维护自己的 WebDriver 实例。
469. What are the common exceptions in Selenium WebDriver Java? How do you handle them?
Selenium WebDriver Java 中常见的异常有哪些?你是如何处理它们的?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc7122 | 官方: 否 | 付费: 否
答案:
When building automation solutions, it’s important to manage errors properly so the process runs smoothly. Interviewers ask this in selenium java interview questions to evaluate how well you understand runtime failures and recovery strategies, not just script writing.
在构建自动化解决方案时,正确管理错误非常重要,以确保流程顺利运行。面试官在 selenium java 面试问题中会问到这个,以评估你对运行时失败和恢复策略的理解程度,而不仅仅是脚本编写。
Selenium WebDriver throws several common exceptions during execution. Some of the most frequently encountered ones include: - NoSuchElementException - Thrown when WebDriver cannot locate an element using the given locator.
Selenium WebDriver 在执行过程中会抛出多种常见异常。其中最常遇到的一些包括:- NoSuchElementException - 当 WebDriver 无法使用给定的定位器找到元素时抛出。
- TimeoutException - Occurs when an explicit or implicit wait exceeds its defined time.
- ElementNotInteractableException - The element exists in the DOM but cannot be interacted with (e.g., hidden or disabled).
- StaleElementReferenceException - Happens when the DOM refreshes and the element reference becomes invalid.
- NoSuchFrameException - Thrown when switching to a frame that does not exist.
- NoSuchWindowException - Occurs when switching to a closed or non-existing window.
InvalidSelectorException - Caused by incorrect XPath or CSS selector syntax.
The most common handling strategies include:最常见的处理策略包括:
- Using Explicit Waits
Instead of directly interacting with elements, use WebDriverWait with ExpectedConditions:
不要直接与元素交互,而是使用带有 ExpectedConditions 的 WebDriverWait:
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
WebElement element = wait.until(
WebElement element = wait.until(
ExpectedConditions.elementToBeClickable(By.id("login")));
ExpectedConditions.elementToBeClickable(By.id("login")));
This prevents NoSuchElementException, TimeoutException, and ElementNotInteractableException in many cases.
这在许多情况下可以防止NoSuchElementException、TimeoutException和ElementNotInteractableException。
- Using try-catch Blocks
For controlled exception handling:
对于受控的异常处理:
try {
try {
driver.findElement(By.id("submit")).click();
driver.findElement(By.id("submit")).click();
} catch (NoSuchElementException e) {
} catch (NoSuchElementException e) {
System.out.println("Element not found");
System.out.println("元素未找到");
}
- Retry Logic for Dynamic Pages
For cases like DOM refresh (stale elements), implement retry logic:
对于像DOM刷新(元素失效)这样的情况,实现重试逻辑:
for(int i = 0; i < 3; i++) {
for(int i = 0; i < 3; i++) {
try {
try {
driver.findElement(By.id("refresh")).click();
driver.findElement(By.id("refresh")).click();
break;
break;
} catch (StaleElementReferenceException e) {
} catch (StaleElementReferenceException e) {
// retry
// 重试
}
}
In interviews, always emphasize that proper wait strategies reduce most exceptions. Exception handling should enhance stability, not mask poor locator or synchronization design.
在面试中,始终强调适当的等待策略能减少大多数异常。异常处理应增强稳定性,而不是掩盖糟糕的定位器或同步设计。
470. How do you use Java Collections and Streams API with Selenium WebElement lists?
你如何使用Java集合和Streams API来操作Selenium WebElement列表?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc7125 | 官方: 否 | 付费: 否
答案:
This question tests your Java proficiency within Selenium. Since findElements() returns a List, strong knowledge of Java Collections and Streams improves automation efficiency and readability.
这个问题测试你在Selenium中的Java熟练度。由于findElements()返回一个List,对Java集合和Streams的扎实知识能提高自动化效率和可读性。
Example:
示例:
List
Listelements = driver.findElements(By.tagName("a"));
Using Java Streams, you can filter elements dynamically:
使用Java Streams,你可以动态地筛选元素:
Listfiltered = elements.stream()
Listfiltered = elements.stream()
.filter(e -> e.getText().contains("Login"))
.filter(e -> e.getText().contains("Login"))
.collect(Collectors.toList());
.collect(Collectors.toList());
To extract all text values:
要提取所有文本值:
List
Listtexts = elements.stream()
.map(WebElement::getText)
.map(WebElement::getText)
.toList();
.toList();
To sort elements alphabetically by text:
要按文本字母顺序对元素排序:
Listsorted = elements.stream()
Listsorted = elements.stream()
.sorted(Comparator.comparing(WebElement::getText))
.sorted(Comparator.comparing(WebElement::getText))
.toList();
.toList();
You can also perform bulk actions:
你还可以执行批量操作:
elements.forEach(WebElement::click);
elements.forEach(WebElement::click);
And for assertions:
对于断言:
long count = elements.stream()
long count = elements.stream()
.filter(e -> e.isDisplayed())
.filter(e -> e.isDisplayed())
.count();
.count();
In interviews, explain that Streams improve code readability, reduce boilerplate loops, and align with modern Java practices.
在面试中,解释Streams能提升代码可读性、减少样板循环,并与现代Java实践保持一致。
471. How do you implement method chaining and Fluent Interface pattern in a Java Selenium framework?
如何在Java Selenium框架中实现方法链和流式接口模式?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b37c4858d557c902bc7128 | 官方: 否 | 付费: 否
答案:
Method chaining is a design pattern where each method returns the current object (this) or another page object. This enables writing readable and expressive test scripts.
方法链是一种设计模式,其中每个方法返回当前对象(this)或另一个页面对象。这有助于编写可读且表达力强的测试脚本。
Instead of:
而不是:
loginPage.enterUsername("user");
loginPage.enterUsername("user");
loginPage.enterPassword("pass");
loginPage.enterPassword("pass");
loginPage.clickLogin();
loginPage.clickLogin();
You can write:
你可以这样写:
loginPage.enterUsername("user")
loginPage.enterUsername("user")
.enterPassword("pass")
.enterPassword("pass")
.clickLogin();
.clickLogin();
To implement this, methods must return the current class instance.
要实现这一点,方法必须返回当前类的实例。
Example:
示例:
public class LoginPage {
public class LoginPage {
WebDriver driver;
WebDriver driver;
public LoginPage(WebDriver driver) {
public LoginPage(WebDriver driver) {
this.driver = driver;
this.driver = driver;
}
public LoginPage enterUsername(String username) {
public LoginPage enterUsername(String username) {
driver.findElement(By.id("username")).sendKeys(username);
driver.findElement(By.id("username")).sendKeys(username);
return this;
return this;
}
public LoginPage enterPassword(String password) {
public LoginPage enterPassword(String password) {
driver.findElement(By.id("password")).sendKeys(password);
driver.findElement(By.id("password")).sendKeys(password);
return this;
return this;
}
public DashboardPage clickLogin() {
public DashboardPage clickLogin() {
driver.findElement(By.id("loginBtn")).click();
driver.findElement(By.id("loginBtn")).click();
return new DashboardPage(driver);
return new DashboardPage(driver);
}
}
Here: - return this; keeps the chain within the same page.
这里:- return this; 保持链式调用在同一页面内。
return new DashboardPage(driver); transitions to the next page object.
This pattern integrates seamlessly with the Page Object Model and significantly improves test readability. It reduces repetition, creates cleaner test cases, and makes framework design more scalable.此模式与页面对象模型无缝集成,显著提高了测试可读性。它减少了重复,创建了更简洁的测试用例,并使框架设计更具可扩展性。
In interviews, mention that Fluent Interface enhances maintainability and aligns with enterprise-level framework architecture. You can also explore: - Automation Testing Interview Questions
在面试中,提及流式接口可增强可维护性并与企业级框架架构保持一致。你也可以探索:- 自动化测试面试问题
- Software Testing Interview Questions
472. How do you set up Selenium WebDriver with Python? Explain the installation and basic configuration.
如何使用Python设置Selenium WebDriver?解释安装和基本配置。
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc712b | 官方: 否 | 付费: 否
答案:
Setting up Selenium in Python involves installing the library, managing browser drivers, and configuring a basic script structure.
在Python中设置Selenium涉及安装库、管理浏览器驱动,以及配置基本的脚本结构。
Step 1: Install Selenium
步骤 1:安装 Selenium
pip install selenium
pip install selenium
It is recommended to use a virtual environment to isolate dependencies:
建议使用虚拟环境来隔离依赖:
python -m venv venv
python -m venv venv
source venv/bin/activate # macOS/Linux
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # Windows
venv\Scripts\activate # Windows
Dependencies can be tracked in a requirements.txt file:
依赖项可以记录在 requirements.txt 文件中:
pip freeze > requirements.txt
pip freeze > requirements.txt
Step 2: Manage Browser Drivers
步骤 2:管理浏览器驱动
Instead of manually downloading drivers, use webdriver-manager:
与其手动下载驱动,不如使用 webdriver-manager:
pip install webdriver-manager
pip install webdriver-manager
Example setup using Selenium 4 syntax:
使用 Selenium 4 语法的示例设置:
from selenium import webdriver
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.chrome import ChromeDriverManager
service = Service(ChromeDriverManager().install())
service = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=service)
driver = webdriver.Chrome(service=service)
driver.get("https://example.com")
driver.get("https://example.com")
driver.quit()
driver.quit()
Selenium 4 replaced the older executable_path parameter with the Service object for better driver lifecycle management.
Selenium 4 用 Service 对象取代了旧的 executable_path 参数,以便更好地管理驱动生命周期。
473. How do you use pytest framework with Selenium in Python? Explain fixtures and conftest.py.
如何在 Python 中使用 pytest 框架与 Selenium?解释 fixtures 和 conftest.py。
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc712e | 官方: 否 | 付费: 否
答案:
pytest is the most widely used Python testing framework. It provides fixtures, parameterization, and detailed reporting without requiring boilerplate test classes.
pytest 是 Python 中最广泛使用的测试框架。它提供 fixtures、参数化和详细报告,而无需编写样板测试类。
Basic Selenium Fixture
基本 Selenium Fixture
Fixtures handle setup and teardown logic.
Fixtures 处理设置和拆除逻辑。
import pytest
import pytest
from selenium import webdriver
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.chrome import ChromeDriverManager
@pytest.fixture(scope="function")
@pytest.fixture(scope="function")
def driver():
def driver():
service = Service(ChromeDriverManager().install())
service = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=service)
driver = webdriver.Chrome(service=service)
yield driver
生成驱动
driver.quit()
driver.quit()
The yield statement allows pytest to execute teardown code after the test finishes.
yield 语句允许 pytest 在测试完成后执行清理代码。
Using conftest.py
使用 conftest.py
Fixtures placed inside conftest.py become automatically available across all test files without explicit imports. This centralizes WebDriver setup.
放在 conftest.py 中的 fixture 会自动在所有测试文件中可用,无需显式导入。这集中了 WebDriver 的设置。
Markers for Selective Execution
用于选择性执行的标记
@pytest.mark.smoke
@pytest.mark.smoke
def test_login(driver):
def test_login(driver):
driver.get("https://example.com")
driver.get("https://example.com")
assert "Example" in driver.title
assert "Example" in driver.title
Run specific groups:
运行特定组:
pytest -m smoke
pytest -m smoke
Parameterization (Data-Driven Testing)
参数化(数据驱动测试)
@pytest.mark.parametrize("username,password", [
@pytest.mark.parametrize("username,password", [
("user1", "pass1"),
("user1", "pass1"),
("user2", "pass2")
("user2", "pass2")
])
def test_login(driver, username, password):
def test_login(driver, username, password):
pass
pass
Assertions in pytest use simple assert statements instead of assertEqual.
pytest 中的断言使用简单的 assert 语句,而非 assertEqual。
Configuration options can be stored in pytest.ini.
配置选项可以存储在 pytest.ini 中。
474. How do you implement headless browser testing with Python Selenium?
如何使用 Python Selenium 实现无头浏览器测试?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b37c4858d557c902bc7131 | 官方: 否 | 付费: 否
答案:
Headless execution runs the browser without a visible UI. It is commonly used in CI/CD pipelines because it reduces resource usage and speeds up execution.
无头执行在无可见 UI 的情况下运行浏览器。它常用于 CI/CD 流水线,因为它能减少资源消耗并加速执行。
Chrome Headless Example
Chrome 无头模式示例
from selenium import webdriver
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.options import Options
options = Options()
options = Options()
options.add_argument("--headless=new")
options.add_argument("--headless=new")
options.add_argument("--window-size=1920,1080")
options.add_argument("--window-size=1920,1080")
driver = webdriver.Chrome(options=options)
driver = webdriver.Chrome(options=options)
Firefox Headless Example
Firefox 无头模式示例
options.add_argument("-headless")
options.add_argument("-headless")
Additional flags commonly used in CI environments: - --no-sandbox
CI 环境中常用的附加标志:- --no-sandbox
--disable-gpu
Headless mode is faster because it skips graphical rendering. However, certain UI behaviors (especially animations or complex JavaScript interactions) may behave slightly differently compared to headed mode.无头模式因跳过图形渲染而更快。然而,某些 UI 行为(尤其是动画或复杂的 JavaScript 交互)可能与有头模式略有不同。
475. How do you handle dynamic web elements and waits in Python Selenium?
你如何处理 Python Selenium 中的动态 Web 元素和等待?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc7134 | 官方: 否 | 付费: 否
答案:
Dynamic elements require explicit waits to ensure the element is ready before interaction.
动态元素需要显式等待,以确保在交互之前元素已就绪。
Explicit Wait with Expected Conditions
使用预期条件的显式等待
from selenium.webdriver.common.by import By
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support import expected_conditions as EC
wait = WebDriverWait(driver, 10)
wait = WebDriverWait(driver, 10)
button = wait.until(
button = wait.until(
EC.element_to_be_clickable((By.ID, "submitBtn"))
EC.element_to_be_clickable((By.ID, "submitBtn"))
)
button.click()
button.click()
Common expected conditions: - EC.visibility_of_element_located
常见预期条件: - EC.visibility_of_element_located
- EC.presence_of_all_elements_located
EC.staleness_of
Custom Wait Condition自定义等待条件
wait.until(lambda d: d.find_element(By.ID, "status").text == "Loaded")
wait.until(lambda d: d.find_element(By.ID, "status").text == "Loaded")
Explicit waits are preferred over implicit waits in dynamic applications because they provide better control and stability.
在动态应用程序中,显式等待优于隐式等待,因为它们提供了更好的控制和稳定性。
476. How do you perform parallel test execution in Python Selenium using pytest-xdist?
你如何在 Python Selenium 中使用 pytest-xdist 执行并行测试?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc7137 | 官方: 否 | 付费: 否
答案:
Parallel execution in pytest is enabled using pytest-xdist.
在 pytest 中使用 pytest-xdist 启用并行执行。
Installation
安装
pip install pytest-xdist
pip install pytest-xdist
Run Tests in Parallel
并行运行测试
pytest -n 4
pytest -n 4
This runs tests using 4 parallel workers.
这使用4个并行工作者运行测试。
To automatically use all CPU cores:
要自动使用所有CPU核心:
pytest -n auto
pytest -n auto
Each worker runs tests independently, so WebDriver instances must be created inside function-scoped fixtures to ensure isolation.
每个工作者独立运行测试,因此必须在函数作用域的fixture中创建WebDriver实例,以确保隔离性。
Distribution Modes
分布式模式
pytest -n 4 --dist loadscope
pytest -n 4 --dist loadscope
This groups tests by module to reduce setup overhead.
这按模块对测试进行分组,以减少设置开销。
Parallel execution can be combined with Selenium Grid for cross-browser distributed execution in CI environments such as Jenkins or GitHub Actions.
并行执行可以与Selenium Grid结合,用于在CI环境(如Jenkins或GitHub Actions)中进行跨浏览器分布式执行。
477. How do you take screenshots and generate HTML test reports in Python Selenium?
如何在Python Selenium中截取截图并生成HTML测试报告?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc713a | 官方: 否 | 付费: 否
答案:
Taking Screenshots
截取截图
driver.save_screenshot("screenshot.png")
driver.save_screenshot("screenshot.png")
For binary format:
对于二进制格式:
driver.get_screenshot_as_png()
driver.get_screenshot_as_png()
Capture Screenshot on Failure (pytest hook)
失败时捕获截图(pytest 钩子)
Inside conftest.py:
在 conftest.py 中:
import pytest
import pytest
@pytest.hookimpl(hookwrapper=True)
@pytest.hookimpl(hookwrapper=True)
def pytest_runtest_makereport(item, call):
def pytest_runtest_makereport(item, call):
outcome = yield
outcome = yield
report = outcome.get_result()
report = outcome.get_result()
if report.when == "call" and report.failed:
if report.when == "call" and report.failed:
driver = item.funcargs["driver"]
driver = item.funcargs["driver"]
driver.save_screenshot("failure.png")
driver.save_screenshot("failure.png")
Timestamp-based naming improves traceability.
基于时间戳的命名可提高可追溯性。
Generate HTML Reports with pytest-html
使用 pytest-html 生成 HTML 报告
Install:
安装:
pip install pytest-html
pip install pytest-html
Run:
运行:
pytest --html=report.html --self-contained-html
pytest --html=report.html --self-contained-html
Allure Reporting
Allure 报告
Install:
安装:
pip install allure-pytest
pip install allure-pytest
Run:
运行:
pytest --alluredir=results
pytest --alluredir=results
allure serve results
allure serve results
Allure supports embedding screenshots, step annotations, and CI integration. You can also explore: - System Design Interview Questions
Allure 支持嵌入截图、步骤注释和 CI 集成。你还可以探索:- 系统设计面试题
- Selenium Interview Questions for 5 Yrs Experience
478. What are the different types of test automation frameworks used with Selenium? Explain each.
与 Selenium 一起使用的测试自动化框架有哪些不同类型?请逐一解释。
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc714f | 官方: 否 | 付费: 否
答案:
Selenium itself is only a browser automation tool. The structure around it, the automation framework, determines how tests are organized, executed, and maintained.
Selenium 本身只是一个浏览器自动化工具。围绕它的结构,即自动化框架,决定了测试如何组织、执行和维护。
Below are the commonly used framework types.
以下是常用的框架类型。
- Linear (Record and Playback) Framework
This is the simplest structure. Test steps are written sequentially in a single script. There is no separation between test data and test logic, and reusable methods are minimal.
这是最简单的结构。测试步骤按顺序写在一个脚本中。测试数据和测试逻辑没有分离,可重用的方法也很少。
Because everything is tightly coupled, maintenance becomes difficult as the application grows. This approach is usually limited to small projects or learning environments.
由于一切紧密耦合,随着应用程序的增长,维护变得困难。这种方法通常仅限于小型项目或学习环境。
- Modular Framework
In this structure, the application is divided into logical sections such as Login, Search, or Checkout. Separate scripts are created for each module.
在这种结构中,应用程序被划分为逻辑部分,如登录、搜索或结账。为每个模块创建单独的脚本。
The main advantage is isolation. If the Login module changes, only its related script needs modification. However, data is often still embedded within test scripts unless combined with a data-driven approach.
主要优点是隔离性。如果登录模块发生变化,只需修改其相关的脚本。然而,除非与数据驱动方法结合,数据通常仍然嵌入在测试脚本中。
- Data-Driven Framework
Here, test logic and test data are separated. The automation script remains constant, while inputs are fetched from external sources such as Excel, CSV, JSON, or databases.
在这里,测试逻辑和测试数据是分离的。自动化脚本保持恒定,而输入从外部来源获取,如 Excel、CSV、JSON 或数据库。
For example, a login test can run multiple times using different username-password combinations without modifying the script itself.
例如,登录测试可以使用不同的用户名-密码组合多次运行,而无需修改脚本本身。
This approach improves reusability and test coverage, especially when multiple input combinations must be validated.
这种方法提高了可重用性和测试覆盖率,特别是当必须验证多个输入组合时。
- Keyword-Driven Framework
In a keyword-driven structure, test steps are defined using action keywords such as Click, EnterText, Navigate, or VerifyTitle.
在关键字驱动结构中,测试步骤使用操作关键字(如Click、EnterText、Navigate或VerifyTitle)来定义。
Each keyword is mapped to a reusable method in the codebase. The test flow is driven by a keyword file (often Excel or JSON), while the underlying implementation remains in Java or Python.
每个关键字映射到代码库中的可重用方法。测试流程由关键字文件(通常是Excel或JSON)驱动,而底层实现仍保留在Java或Python中。
This abstraction allows non-technical stakeholders to define test flows without writing Selenium code directly.
这种抽象允许非技术利益相关者定义测试流程,而无需直接编写Selenium代码。
- Hybrid Framework
A hybrid framework combines multiple approaches, typically:
混合框架结合了多种方法,通常包括:
- Data-Driven
- Keyword-Driven
- Page Object Model (POM)
Most enterprise automation frameworks are hybrid. The test layer handles execution, the Page Object layer handles UI elements, utilities manage reusable functions, and external data sources control test inputs.
大多数企业自动化框架都是混合型。测试层负责执行,Page Object层处理UI元素,实用工具管理可重用函数,外部数据源控制测试输入。
This structure supports scalability, maintainability, and parallel execution.
这种结构支持可扩展性、可维护性和并行执行。
- BDD Framework
BDD frameworks use natural language to describe application behavior. Instead of writing purely code-based tests, scenarios are written in Gherkin format and mapped to Selenium step definitions.
BDD框架使用自然语言来描述应用程序行为。场景以Gherkin格式编写并映射到Selenium步骤定义,而不是编写纯代码测试。
This approach is widely used in Agile environments where collaboration between business analysts and automation engineers is required.
这种方法在需要业务分析师和自动化工程师协作的敏捷环境中被广泛使用。
Framework Comparison
框架比较
| Framework 框架 | Primary Use Case 主要用例 | Key Limitation 关键限制 |
|---|---|---|
| Linear 线性 | Small projects 小型项目 | Not scalable 不可扩展 |
| Modular 模块化 | Structured test organization 结构化测试组织 | Data coupling 数据耦合 |
| Data-Driven 数据驱动 | Multiple input validation 多个输入验证 | Data management complexity 数据管理复杂性 |
| Keyword-Driven 关键字驱动 | Business-readable workflows 业务可读的工作流 | Setup overhead 设置开销 |
| Hybrid 混合 | Enterprise automation 企业自动化 | Requires architectural planning 需要架构规划 |
| BDD | Agile collaboration 敏捷协作 | Step maintenance 步骤维护 |
479. What is BDD (Behavior-Driven Development)? How does Cucumber integrate with Selenium?
什么是BDD(行为驱动开发)?Cucumber如何与Selenium集成?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc7152 | 官方: 否 | 付费: 否
答案:
Behavior-Driven Development (BDD) is an approach where test scenarios are written in structured natural language. The purpose is to make expected system behavior understandable to both technical and non-technical stakeholders.
行为驱动开发(BDD)是一种以结构化自然语言编写测试场景的方法。其目的是使预期系统行为对技术和非技术利益相关者都可理解。
BDD uses Gherkin syntax with the following structure: - Feature
BDD使用Gherkin语法,结构如下:- Feature
- Scenario
- Given
- When
Then
A typical feature file looks like this:典型的feature文件看起来像这样:
Feature: Login functionality
功能:登录功能
Scenario: Valid login
场景:有效登录
Given user is on login page
假设用户在登录页面
When user enters valid credentials
当用户输入有效凭据
Then user should see the dashboard
那么用户应看到仪表盘
Cucumber reads the feature file and matches each step to a corresponding step definition written in Java or Python.
Cucumber 读取功能文件,并将每个步骤匹配到用 Java 或 Python 编写的相应步骤定义。
Example step definition:
步骤定义示例:
@Given("user is on login page")
@Given("用户位于登录页面")
public void openLoginPage() {
public void openLoginPage() {
driver.get("https://example.com/login");
driver.get("https://example.com/login");
}
@When("user enters valid credentials")
@When("用户输入有效凭据")
public void enterCredentials() {
public void enterCredentials() {
driver.findElement(By.id("username")).sendKeys("user");
driver.findElement(By.id("username")).sendKeys("user");
driver.findElement(By.id("password")).sendKeys("pass");
driver.findElement(By.id("password")).sendKeys("pass");
driver.findElement(By.id("loginBtn")).click();
driver.findElement(By.id("loginBtn")).click();
}
@Then("user should see the dashboard")
@Then("用户应看到仪表盘")
public void verifyDashboard() {
public void verifyDashboard() {
Assert.assertTrue(driver.getTitle().contains("Dashboard"));
Assert.assertTrue(driver.getTitle().contains("Dashboard"));
}
Execution flow:
执行流程:
Cucumber parses the feature file. 2. It identifies matching step definitions. 3. Step definitions execute Selenium WebDriver commands. 4. Results are generated as HTML or integrated reports.
- Cucumber 解析功能文件。 2. 它识别匹配的步骤定义。 3. 步骤定义执行 Selenium WebDriver 命令。 4. 结果生成为 HTML 或集成报告。
Cucumber can run with TestNG or JUnit and supports built-in HTML reporting or integration with Allure and Extent Reports.
Cucumber 可以与 TestNG 或 JUnit 运行,并支持内置的 HTML 报告或与 Allure 和 Extent Reports 的集成。
480. How do you design a Hybrid Automation Framework in Selenium? What are its components?
你如何设计 Selenium 中的混合自动化框架?其组件是什么?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc7155 | 官方: 否 | 付费: 否
答案:
A Hybrid Framework combines structured layering with externalized data and reusable components.
混合框架结合了结构化分层、外部化数据和可复用组件。
A typical architecture contains the following layers:
典型架构包含以下层:
- Test Layer
Contains TestNG or JUnit classes. Responsible for executing test cases.
包含 TestNG 或 JUnit 类。负责执行测试用例。
- Page Object Layer
Implements the Page Object Model. Each page class contains WebElements and page-specific actions.
实现页面对象模型。每个页面类包含 WebElements 和页面特定操作。
- Utility Layer
Includes reusable helpers such as:
包含可复用的辅助工具,例如:
- Excel readers
- Wait utilities
- Screenshot capture
- Common methods
- Test Data Layer
Stores external test data in Excel, JSON, or database systems.
将外部测试数据存储于 Excel、JSON 或数据库系统中。
- Configuration Layer
Contains configuration files such as config.properties for:
包含配置文件(如 config.properties),用于:
- Browser type
- Base URL
- Timeouts
- Reporting Layer
Integrates tools such as Extent Reports or Allure.
集成了诸如 Extent Reports 或 Allure 等工具。
- Driver Manager
Uses Singleton pattern to control WebDriver lifecycle.
使用单例模式控制 WebDriver 生命周期。
Example folder structure:
示例文件夹结构:
project/
project/
├── pages/
├── pages/
├── tests/
├── tests/
├── utilities/
├── utilities/
├── drivers/
├── drivers/
├── testdata/
├── testdata/
├── config.properties
├── config.properties
├── reports/
├── reports/
Execution Flow:
执行流程:
Test -> Page Object -> Utility -> Driver -> Report
测试 -> 页面对象 -> 工具 -> 驱动 -> 报告
481. How do you generate Extent Reports in Selenium? What are the alternatives?
如何在Selenium中生成Extent报告?有哪些替代方案?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc7158 | 官方: 否 | 付费: 否
答案:
Extent Reports is a reporting library that generates interactive HTML reports with logging and screenshot support.
Extent Reports是一个报告库,可生成带有日志和截图支持的交互式HTML报告。
Basic setup:
基本设置:
ExtentReports extent = new ExtentReports();
ExtentReports extent = new ExtentReports();
ExtentSparkReporter spark = new ExtentSparkReporter("report.html");
ExtentSparkReporter spark = new ExtentSparkReporter("report.html");
extent.attachReporter(spark);
extent.attachReporter(spark);
ExtentTest test = extent.createTest("Login Test");
ExtentTest test = extent.createTest("登录测试");
test.log(Status.PASS, "Login successful");
test.log(Status.PASS, "登录成功");
extent.flush();
extent.flush();
To capture screenshots on failure, integration is usually done inside a TestNG @AfterMethod.
要在失败时捕获截图,通常在TestNG的@AfterMethod内部进行集成。
Extent Reports supports: - Categorization of tests
Extent Reports支持:- 测试分类
- Screenshot embedding
- Step-level logging
Pass/Fail tracking
Alternatives include: - Allure Reports替代方案包括:- Allure报表
- TestNG default reports
- Cucumber HTML reports
ReportNG
Allure is widely used in CI pipelines because it supports multi-language integration and rich visualization.Allure在CI流水线中广泛使用,因为它支持多语言集成和丰富的可视化。
482. How do you integrate Selenium tests into a CI/CD pipeline using Jenkins?
如何使用Jenkins将Selenium测试集成到CI/CD流水线中?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc715b | 官方: 否 | 付费: 否
答案:
Selenium tests can be executed automatically on every code change using Jenkins.
使用Jenkins可以在每次代码更改时自动执行Selenium测试。
Integration process:
集成过程:
Install Jenkins. 2. Install required plugins (Maven, Git, HTML Publisher). 3. Create a new Jenkins job. 4. Configure Git repository URL. 5. Add build triggers (Webhook, Poll SCM, Scheduled). 6. Add build step: mvn clean test 7. Publish HTML reports as post-build action.
- 安装Jenkins。 2. 安装所需插件(Maven、Git、HTML Publisher)。 3. 创建新的Jenkins任务。 4. 配置Git仓库URL。 5. 添加构建触发器(Webhook、轮询SCM、定时)。 6. 添加构建步骤:mvn clean test 7. 将发布HTML报告作为构建后操作。
For browser parameterization: mvn clean test -Dbrowser=chrome
用于浏览器参数化:mvn clean test -Dbrowser=chrome
Example Jenkinsfile:
Jenkinsfile示例:
pipeline {
pipeline {
agent any
agent any
stages {
stages {
stage('Execute Tests') {
stage('执行测试') {
steps {
steps {
sh 'mvn clean test'
sh 'mvn clean test'
}
}
}
}
Docker agents can be used to ensure consistent execution environments across machines.
可以使用 Docker 代理来确保跨机器的执行环境一致性。
483. What is cross-browser testing with Selenium Grid and Docker? How do you set it up?
什么是使用 Selenium Grid 和 Docker 的跨浏览器测试?如何设置它?
- 知识点: 测试 (主题: selenium, testing, automation;标签: interviewbit, selenium, topic-specific, testing, automation)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b37c4858d557c902bc715e | 官方: 否 | 付费: 否
答案:
Cross-browser testing ensures that the application behaves consistently across different browsers and platforms.
跨浏览器测试确保应用程序在不同浏览器和平台上的行为一致。
Selenium Grid distributes test execution across multiple machines.
Selenium Grid 将测试执行分发到多台机器上。
Grid 4 architecture includes: - Router
Grid 4 架构包括:- 路由器
- Distributor
- Session Map
Nodes
Instead of manually configuring nodes, Docker can be used to spin up containers.与其手动配置节点,不如使用 Docker 来启动容器。
Typical Docker setup uses: - selenium/hub
典型的 Docker 设置包括:- selenium/hub
- selenium/node-chrome
selenium/node-firefox
Example configuration using RemoteWebDriver:使用 RemoteWebDriver 的示例配置:
ChromeOptions options = new ChromeOptions();
ChromeOptions options = new ChromeOptions();
RemoteWebDriver driver = new RemoteWebDriver(
RemoteWebDriver driver = new RemoteWebDriver(
new URL("http://localhost:4444"),
new URL("http://localhost:4444"),
options
options
);
Tests connect to the hub, and the hub assigns them to available nodes.
测试连接到中心节点,中心节点将它们分配给可用的节点。
Parallel execution can be configured using TestNG.
可使用TestNG配置并行执行。
Cloud alternatives include BrowserStack and LambdaTest.
云替代方案包括BrowserStack和LambdaTest。
484. How would you test mobile push notifications?
你会如何测试移动推送通知?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf235c | 官方: 否 | 付费: 否
答案:
I’d test notification delivery in foreground, background, and killed app states. I’d verify content like title, body, deep link navigation, and image/icon. I’d test permission denied scenarios and notification settings behavior. I’d check timing like scheduled notifications, timezone handling, and offline delivery after reconnect. I’d also validate platform-specific differences like Android notification channels and iOS behavior.
我会测试前台、后台和应用被杀状态下的通知投递。我会验证标题、正文、深链导航以及图片/图标等内容。我会测试权限被拒绝的场景和通知设置行为。我会检查定时通知、时区处理以及重连后的离线投递等时间相关方面。我还会验证平台特定差异,如 Android 通知渠道和 iOS 行为。
485. What to automate vs manual testing?
自动化测试与手动测试如何分工?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf235f | 官方: 否 | 付费: 否
答案:
I automate repetitive regression, smoke tests, API tests, and data-driven scenarios that run often in CI/CD. I keep exploratory, usability, and visual validation testing manual. I consider frequency, stability, ROI, and flakiness before automating. Not everything should be automated because maintenance cost can become high. Following the Test Automation Pyramid helps balance unit, integration, and E2E tests properly.
我会自动化执行重复的回归、冒烟测试、API 测试以及频繁在 CI/CD 中运行的数据驱动场景。我会保留探索性测试、可用性测试和视觉验证为手动测试。在自动化之前,我会考虑频率、稳定性、投资回报率和易碎性。并非所有内容都应自动化,因为维护成本可能会变得很高。遵循测试自动化金字塔有助于正确平衡单元测试、集成测试和端到端测试。
486. How would you test an OTP verification feature?
你会如何测试 OTP 验证功能?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2362 | 官方: 否 | 付费: 否
答案:
I’d test valid OTP, expired OTP, wrong OTP, resend OTP, and leading zeros. I’d verify expiry timing boundary like exact 5-minute limit. Security checks include rate limiting after multiple wrong attempts and preventing OTP reuse. I’d test multiple rapid OTP requests ensuring only the latest one works. I’d also verify OTP is not exposed in logs or API responses.
我会测试有效 OTP、过期 OTP、错误 OTP、重新发送 OTP 以及前导零。我会验证过期时间边界,如精确的 5 分钟限制。安全检查包括多次错误尝试后的速率限制以及防止 OTP 重用。我会测试多次快速请求 OTP,确保只有最新的一次有效。我还会验证 OTP 不会在日志或 API 响应中暴露。
487. Critical bug before release, fix needs 3 days – what do you do?
发布前发现严重 bug,修复需要 3 天——你会怎么做?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2365 | 官方: 否 | 付费: 否
答案:
First, I assess impact: user count affected, data loss, or security risk. Then I inform stakeholders with clear severity and evidence. We evaluate options like delaying release, feature flagging, partial rollout, or releasing with hotfix plan. Risk should be documented and formally accepted by product/business. Monitoring and support team should be prepared if released with known issue.
首先,我会评估影响:受影响的用户数量、数据丢失或安全风险。然后我会以明确的严重程度和证据告知利益相关者。我们会评估延迟发布、功能开关、部分发布或带热修复计划发布的选项。风险应被记录并由产品/业务方正式接受。如果带着已知问题发布,监控和支持团队应做好准备。
488. Developer says “it works on my machine.” What do you do?
开发者说“在我机器上能运行。”你会怎么做?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2368 | 官方: 否 | 付费: 否
答案:
I treat it as an environment issue, not an argument. I compare OS version, browser, database state, config files, and environment variables. I reproduce in a clean QA or staging environment and capture logs or HAR files as evidence. I also check for data-dependent issues and permission differences. Using Docker or shared environments helps avoid these issues in the future.
我会将其视为环境问题,而不是争论。我会比较操作系统版本、浏览器、数据库状态、配置文件和环境变量。我会在干净的 QA 或预发布环境中复现问题,并捕获日志或 HAR 文件作为证据。我还会检查数据相关问题及权限差异。使用 Docker 或共享环境有助于避免未来出现此类问题。
489. How would you test a REST API endpoint?
你会如何测试一个 REST API 端点?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf236b | 官方: 否 | 付费: 否
答案:
I’d validate required parameters, missing fields, invalid data types, and unexpected inputs. I’d verify correct HTTP methods and proper status codes like 200, 400, 401, 404, and 500. Authentication testing includes valid, invalid, and expired tokens with role-based access checks. I’d test pagination, large payloads, concurrent requests, and idempotency of PUT/DELETE. Tools like Postman, curl, or REST Assured can be integrated into CI/CD for automation.
我会验证必填参数、缺失字段、无效数据类型和意外输入。我会确认正确的 HTTP 方法和适当的状态码,如 200、400、401、404 和 500。认证测试包括有效、无效和过期令牌,并检查基于角色的访问权限。我会测试分页、大负载、并发请求以及 PUT/DELETE 的幂等性。像 Postman、curl 或 REST Assured 等工具可以集成到 CI/CD 中实现自动化。
490. How would you test a file upload feature?
你会如何测试文件上传功能?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf236e | 官方: 否 | 付费: 否
答案:
I’d test valid file types and size limits, including minimum and maximum boundaries. Then invalid cases like unsupported file types, corrupted files, zero-byte files, and double extensions like file.jpg.exe. I’d check security risks like executable uploads, path traversal, and embedded scripts. UI testing includes progress bar, cancel upload, drag-drop, and multiple uploads. I’d verify server-side validation because client-side validation alone is not secure.
我会测试有效的文件类型和大小限制,包括最小和最大边界值。然后测试无效情况,如不支持的文件类型、损坏文件、零字节文件和双扩展名如 file.jpg.exe。我会检查安全风险,如可执行文件上传、路径遍历和嵌入式脚本。UI 测试包括进度条、取消上传、拖放和多个文件上传。我会验证服务器端验证,因为仅靠客户端验证不安全。
491. Only 2 hours to test before release – what’s your approach?
发布前只有 2 小时测试时间——你的方法是什么?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2371 | 官方: 否 | 付费: 否
答案:
First, I review release notes and identify changed modules. Then I run a smoke test covering login, core feature, and checkout/payment. I focus on impacted areas and tightly connected modules for regression. I document what was tested and what was not tested due to time. Finally, I communicate risk clearly and support go/no-go decision based on business impact.
首先,我会查看发布说明并识别变更的模块。然后运行冒烟测试,覆盖登录、核心功能和结账/支付。我会专注于受影响区域和紧密连接的模块进行回归测试。我会记录已测试和因时间原因未测试的内容。最后,我会清晰传达风险,并基于业务影响支持 go/no-go 决策。
492. How would you test search functionality?
你会如何测试搜索功能?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: coding
- 分类: fullstack
- id: 69b390dc58d557c902bf2374 | 官方: 否 | 付费: 否
答案:
I’d test exact match, partial match, empty search, special characters, and case insensitivity. Then verify relevance like exact matches appearing first and correct sorting. I’d test filters combined with search and check pagination accuracy. Performance testing includes response time under large datasets and concurrent searches. I’d also test backend API search separately from UI search to validate response schema and data correctness.
我会测试精确匹配、部分匹配、空搜索、特殊字符和大小写不敏感性。然后验证相关性,如精确匹配优先显示和正确排序。我会测试与搜索结合使用的过滤器以及分页准确性。性能测试包括大数据集下的响应时间和并发搜索。我还会单独从 UI 搜索测试后端 API 搜索,以验证响应模式和数据正确性。
493. How would you test a payment gateway integration?
你会如何测试支付网关集成?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2377 | 官方: 否 | 付费: 否
答案:
I’d test successful payments using different methods like cards, UPI, and net banking. Then failure cases like insufficient funds, expired card, wrong CVV, network timeout, and duplicate payment on double click. I’d verify refund flow (full and partial), transaction ID mapping, and reconciliation with order amount. Security testing includes PCI-DSS checks, no card data stored, HTTPS, and tokenization. I would use sandbox/test card numbers and also test idempotency for repeated requests.
我会使用不同方法测试成功支付,如银行卡、UPI 和网上银行。然后测试失败情况,如余额不足、过期卡片、错误 CVV、网络超时和双击导致的重复支付。我会验证退款流程(全额和部分退款)、交易 ID 映射以及订单金额的对账。安全测试包括 PCI-DSS 检查、不存储卡数据、HTTPS 和令牌化。我会使用沙盒/测试卡号,并测试重复请求的幂等性。
494. Production bug but not reproducible – what do you do?
生产环境出现 bug 但无法复现——你会怎么做?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf237a | 官方: 否 | 付费: 否
答案:
First, I gather exact steps, browser, OS, screenshots, timestamp, and user details. Then I check server logs and error monitoring tools for that time. I try to match the same environment including browser version, network speed, and data state. I test variations like different roles, data sets, or concurrent actions to detect race conditions. If still not reproducible, I add extra logging and keep stakeholders updated with findings and risk status.
首先,我会收集确切的步骤、浏览器、操作系统、截图、时间戳和用户详细信息。然后检查该时间的服务器日志和错误监控工具。我会尝试匹配相同环境,包括浏览器版本、网络速度和数据状态。我会测试不同变量,如不同角色、数据集或并发操作,以检测竞争条件。如果仍无法复现,我会添加额外日志记录,并向利益相关者更新发现和风险状态。
495. How would you test an e-commerce shopping cart?
你会如何测试电商购物车?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf237d | 官方: 否 | 付费: 否
答案:
I’d start with add to cart scenarios like single item, multiple items, quantity update, remove item, and adding the same product multiple times. Then I’d test price calculations like subtotal, tax per region, shipping charges, and coupon logic (valid, expired, already used). I’d cover edge cases like item going out of stock, price change after adding to cart, and cart persistence across sessions. Integration testing would include cart to checkout flow and payment gateway handoff. High business impact flows like checkout and price calculation would be P0 priority.
我会从添加到购物车的场景开始,如单件商品、多件商品、数量更新、移除商品以及重复添加同一商品。然后测试价格计算,如小计、按地区征税、运费和优惠券逻辑(有效、过期、已使用)。我会覆盖边界情况,如商品缺货、添加到购物车后价格变化以及跨会话的购物车持久性。集成测试包括从购物车到结账流程以及支付网关交接。高业务影响的流程如结账和价格计算将设为 P0 优先级。
496. How would you test a login page?
你会如何测试登录页面?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2380 | 官方: 否 | 付费: 否
答案:
First, I would test basic functionality like valid and invalid username/password combinations, empty fields, case sensitivity, and account lock after multiple failed attempts. Then I would check boundary cases like max length, special characters, and SQL injection in inputs. From a security side, I’d verify HTTPS, session timeout, CAPTCHA after multiple attempts, and token expiry. I’d also test UI/UX like error messages, tab order, password masking toggle, and mobile responsiveness. Finally, I’d prioritize critical login success/failure cases as P0, security as P1, and UI polish as P2.
首先,我会测试基本功能,如有效和无效的用户名/密码组合、空字段、大小写敏感性以及多次失败尝试后的账户锁定。然后检查边界情况,如最大长度、特殊字符和输入中的 SQL 注入。从安全角度,我会验证 HTTPS、会话超时、多次尝试后的 CAPTCHA 和令牌过期。我还会测试 UI/UX,如错误消息、标签顺序、密码掩码切换和移动端响应性。最后,我会将关键登录成功/失败案例设为 P0 优先级,安全设为 P1,UI 优化设为 P2。
497. What are test entry and exit criteria?
什么是测试进入和退出标准?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2383 | 官方: 否 | 付费: 否
答案:
Entry criteria are conditions that must be met before testing starts, like approved requirements, deployed build, test environment ready, and test data prepared. Exit criteria define when testing can stop, like all critical test cases executed and no open blocker defects. They are defined in the test plan. If exit criteria are not met, risk must be documented and approved by stakeholders. This ensures controlled and structured testing process.
进入标准是测试开始前必须满足的条件,如已批准的需求、部署的构建版本、测试环境就绪以及测试数据已准备。退出标准定义了测试何时可以停止,如所有关键测试用例已执行且没有未关闭的阻塞缺陷。这些在测试计划中定义。如果退出标准未满足,风险必须记录并经利益相关者批准。这确保了受控且有结构的测试过程。
498. How do you test with incomplete requirements?
在需求不完整时如何进行测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2386 | 官方: 否 | 付费: 否
答案:
First, I identify unclear areas and document them. I raise questions to the BA or product owner and track them in a clarification log. While waiting, I test what is clear and document assumptions in test cases. I also use exploratory testing to understand expected behavior. Once clarifications come, I update test cases properly and ensure alignment.
首先,我识别不清楚的领域并记录它们。我向业务分析师或产品负责人提出问题,并在澄清日志中跟踪。在等待期间,我测试已清晰的部分并在测试用例中记录假设。我还使用探索性测试来理解预期行为。一旦澄清到位,我适当地更新测试用例并确保一致性。
499. Re-testing vs Regression testing?
重新测试与回归测试的区别?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2390 | 官方: 否 | 付费: 否
答案:
Re-testing means testing a specific defect again to confirm it is fixed. It focuses only on the failed test case. Regression testing checks that new changes have not broken existing functionality. Re-testing happens after a bug fix, while regression happens after any code change before release. Regression uses a broader test suite selected using risk-based or impact analysis strategy.
重新测试是指再次测试特定缺陷以确认其已修复。它只关注失败的测试用例。回归测试检查新更改是否破坏了现有功能。重新测试在缺陷修复后发生,而回归测试在发布前任何代码更改后发生。回归使用基于风险或影响分析策略选择的更广泛测试套件。
500. What is risk-based testing?
什么是基于风险的测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2393 | 官方: 否 | 付费: 否
答案:
Risk-based testing prioritizes features based on likelihood of failure and business impact. High-risk features get more detailed testing while low-risk areas get lighter testing. Risk is calculated as Probability × Impact. A risk matrix helps classify features as High, Medium, or Low. It is very useful when time is limited and helps focus on critical 20% features that affect 80% users.
基于风险的测试根据失败可能性和业务影响对功能进行优先级排序。高风险功能获得更详细的测试,而低风险领域获得较轻的测试。风险计算为概率×影响。风险矩阵有助于将功能分类为高、中或低。当时间有限时非常有用,有助于关注影响80%用户的关键20%功能。
501. How do you manage and report defects effectively?
如何有效管理和报告缺陷?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2396 | 官方: 否 | 付费: 否
答案:
A good bug report includes clear title, environment details, preconditions, steps to reproduce, expected and actual results, severity, priority, and attachments. Defect process usually follows Log ->Triage ->Assign ->Fix ->Retest ->Close/Reopen. Clear and detailed bugs save developer time and avoid back-and-forth confusion. Metrics like defect density and defect leakage help measure quality. Regular defect triage meetings help prioritize fixes properly.
一个好的缺陷报告包括清晰的标题、环境详情、前置条件、复现步骤、预期和实际结果、严重程度、优先级和附件。缺陷流程通常遵循记录->分类->分配->修复->重测->关闭/重新打开。清晰详细的缺陷节省开发人员时间,避免来回混淆。缺陷密度和缺陷泄漏等指标有助于衡量质量。定期缺陷分类会议有助于适当优先修复。
502. What is error guessing?
什么是错误猜测?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf2399 | 官方: 否 | 付费: 否
答案:
Error guessing is based on tester experience and intuition to find defects. It is not based on formal documents but on past defect patterns and common mistakes. Examples include testing null values, large inputs, special characters, and boundary dates. Unlike BVA or equivalence partitioning, it is not structured but experience-based. It works best when combined with structured testing techniques.
错误猜测基于测试人员的经验和直觉来发现缺陷。它不基于正式文档,而是基于过去的缺陷模式和常见错误。示例包括测试空值、大输入、特殊字符和边界日期。与边界值分析或等价类划分不同,它不是结构化的,而是基于经验的。当与结构化测试技术结合使用时效果最佳。
503. What is state transition testing?
什么是状态转换测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf239c | 官方: 否 | 付费: 否
答案:
State transition testing checks how a system moves from one state to another based on events. It focuses on valid and invalid transitions between states. For example, in ATM PIN entry, after 3 wrong attempts, the card gets blocked. Test cases cover correct flow, incorrect flow, and impossible transitions. It is useful for login systems, order workflows, and subscription states.
状态转换测试检查系统如何基于事件从一个状态移动到另一个状态。它关注状态之间的有效和无效转换。例如,在ATM PIN输入中,3次错误尝试后,卡片被阻止。测试用例覆盖正确流程、错误流程和不可能转换。它适用于登录系统、订单工作流和订阅状态。
504. What is decision table testing?
什么是决策表测试?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf239f | 官方: 否 | 付费: 否
答案:
Decision table testing is used when business rules have multiple conditions and combinations. It represents conditions and actions in a table format to cover all possible rule combinations. It is useful for complex IF-THEN-ELSE logic like insurance premium calculation based on age and health factors. It helps avoid missing combinations that equivalence partitioning may not cover. It is best used when business logic is rule-heavy and condition-based.
决策表测试用于业务规则具有多个条件和组合时。它以表格格式表示条件和动作,以覆盖所有可能的规则组合。它适用于复杂的IF-THEN-ELSE逻辑,如基于年龄和健康因素的保险费计算。它有助于避免等价类划分可能遗漏的组合。当业务逻辑规则密集且基于条件时最适合使用。
505. What is RTM and why is it important?
什么是RTM?为什么它很重要?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf23a2 | 官方: 否 | 付费: 否
答案:
Requirements Traceability Matrix (RTM) maps requirements to test cases to ensure full coverage. It shows Requirement ID, description, related test case IDs, and execution status. It helps identify missing test cases and supports impact analysis when requirements change. RTM provides an audit trail for stakeholders and ensures nothing is missed. It is usually maintained in tools like Jira, TestRail, or Azure DevOps.
需求追溯矩阵(RTM)将需求映射到测试用例,以确保全面覆盖。它显示需求ID、描述、相关测试用例ID和执行状态。它有助于识别缺失的测试用例,并在需求变更时支持影响分析。RTM为利益相关者提供审计追踪,确保没有遗漏。它通常维护在Jira、TestRail或Azure DevOps等工具中。
506. How do you write an effective test case?
如何编写有效的测试用例?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf23a5 | 官方: 否 | 付费: 否
答案:
An effective test case includes Test Case ID, title, preconditions, test data, clear steps, expected result, actual result, status, and priority. Steps should be simple and reproducible so any tester can execute them. Expected results must be specific, not vague like “it works.” Include both positive and negative test cases and keep them independent. Avoid broad or unclear test cases and always define preconditions properly.
有效的测试用例包括测试用例ID、标题、前置条件、测试数据、清晰的步骤、预期结果、实际结果、状态和优先级。步骤应简单且可重复,以便任何测试人员都能执行。预期结果必须具体,不能模糊如“能工作”。包括正面和负面测试用例,并保持它们独立。避免宽泛或不清晰的测试用例,并始终正确定义前置条件。
507. Difference between test case, test scenario, and test suite?
测试用例、测试场景和测试套件之间的区别?
- 知识点: 测试 (主题: testing, qa;标签: interviewbit, software-testing, topic-specific, testing, qa)
- 类型: technical | 难度: medium | 子类型: concept
- 分类: fullstack
- id: 69b390dc58d557c902bf23a8 | 官方: 否 | 付费: 否
答案:
A test scenario is a high-level idea of what to test, like “Verify user login functionality.” A test case is detailed step-by-step instructions with test data and expected results, like entering valid email and password and verifying dashboard loads. A test suite is a collection of related test cases grouped together, like all login-related test cases. Test scenarios come from requirements, test cases come from scenarios, and test suites are organized for execution cycles. All of this is tracked in RTM to ensure requirement coverage.
测试场景是要测试内容的高层概念,如“验证用户登录功能”。测试用例是详细的逐步指令,包含测试数据和预期结果,如输入有效的电子邮件和密码并验证仪表盘加载。测试套件是相关测试用例的集合,如所有与登录相关的测试用例。测试场景来自需求,测试用例来自场景,测试套件则为执行周期而组织。所有这些都在RTM中跟踪,以确保需求覆盖。
508. MVC(Model-View-Controller)与 MVP(Model-View-Presenter)有什么区别?
- 知识点: 测试 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: mvc, mvp, architecture, unit-testing)
- 类型: technical | 难度: hard | 子类型:
- 分类: fullstack
- id: 695cc0361da553795622a8ee | 官方: 是 | 付费: 否
答案:
TL;DRMVC 用 Controller 连接 View 与 Model;MVP 用 Presenter 与 View 通过接口(interface)交互,并更利于单元测试(unit testing)。
MVC 模式建议将代码拆分为三层:Model、View、Controller。开发者创建类或文件时应归入其中一层。而 MVP 是架构模式(architectural pattern)的进一步演进,由 Model、View、Presenter 组成。
在 MVC 中,Controller 位于 View 和 Model 之间;而在 MVP 中,View-Presenter 与 Presenter-Model 之间通过接口(interface)作为通信桥梁。
MVC 对单元测试(unit testing)支持有限,而 MVP 更支持单元测试。
509. 依赖注入(dependency injection)和工厂模式(factory pattern)之间有什么不同?
- 知识点: 测试 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: di, design-patterns, oop;标签: DI, Factory Pattern, Testing)
- 类型: technical | 难度: hard | 子类型:
- 分类: fullstack
- id: 6965d534f760bfe7d4f8d729 | 官方: 是 | 付费: 否
答案:
答案虽然两种模式都是将对象的创建从应用的逻辑中分离,但是依赖注入比工程模式更清晰。通过依赖注入,你的类就是 POJO(Plain Old Java Object),它只知道依赖(dependencies)而不关心它们怎么获取。使用工厂模式,你的类需要通过工厂(factory)来获取依赖。因此,使用 DI 会比使用工厂模式更容易测试。关于这个话题的更详细讨论请参见答案。
510. 你会如何为电商网站设计推荐系统(recommendation system)?从数据到上线闭环说明。
- 知识点: 测试 / 数据工程与数据科学/AI / 系统设计/架构 / UI/UX 设计 (主题: machine-learning, system-design, recommendation;标签: recommendation, ranking, ab-testing, ml)
- 类型: technical | 难度: hard | 子类型:
- 分类: fullstack
- id: 696f1145120fcc15911598e8 | 官方: 是 | 付费: 否
答案:
答案三层:数据(行为日志(behavior logs)+特征(features))→模型(召回(recall)+排序(ranking),多目标优化(multi-objective optimization))→工程(离线训练(offline training)、在线特征(online features)、低延迟服务(low-latency serving))并通过 A/B 实验(A/B experiments)与监控(monitoring)形成闭环。处理冷启动(cold start)、探索与多样性(exploration and diversity)、偏差(bias)与作弊(fraud),确保线上可控与可迭代。
511. 什么是软件的圈复杂度(cyclomatic complexity)?
- 知识点: 测试 / 算法与数据结构 (主题: software-engineering, testing, code-quality;标签: Cyclomatic Complexity, Refactoring, Testing)
- 类型: technical | 难度: hard | 子类型:
- 分类: fullstack
- id: 6977336da39c9c5c3a8da70a | 官方: 是 | 付费: 否
答案:
答案圈复杂度用于衡量代码控制流(control flow)的复杂程度,等价于程序中“独立路径(independent paths)”的数量,常用来估计测试所需的最少用例数并识别需要重构的高风险模块。复杂度越高,代码越难理解、维护与覆盖测试,缺陷风险也更高。降低方法包括:拆分函数(function splitting)、减少嵌套分支(nested branching)、引入早返回(early return)、用多态(polymorphism)/策略模式(strategy pattern)替代大量 if-else,并补充单元测试(unit testing)保证行为不变。
512. What is Scrumban in Agile?
敏捷中的Scrumban是什么?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792058d557c902b9791d | 官方: 否 | 付费: 否
答案:
Scrumban, as its name implies, is a hybrid Agile methodology that combines Scrum and Kanban (Scrum+Kanban = Scrumban). Hybrid project methodologies like Scruban allow teams to be flexible in adapting to stakeholders and production requirements without being overburdened by their project methodologies. Scrumban combines the structure of Scrum with flow-based methods and the flexibility of Kanban, making it an extremely versatile way of managing workflows. It increases team agility, efficiency, and productivity.
Scrumban,顾名思义,是一种结合了Scrum和Kanban的混合敏捷方法(Scrum+Kanban = Scrumban)。像Scrumban这样的混合项目方法允许团队灵活适应利益相关者和生产需求,而不会因项目方法而负担过重。Scrumban结合了Scrum的结构与基于流程的方法以及Kanban的灵活性,使其成为管理工作流程非常通用的方式。它提高了团队的敏捷性、效率和生产力。
513. Explain build-breaker.
解释构建破坏者(build-breaker)。
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97920 | 官方: 否 | 付费: 否
答案:
Software developers sometimes make inadvertent mistakes that halt the build process, produce undesirable warnings, or fail automated tests. This type of error is known as a 'Build Breaker'. As soon as the developer is aware of the problem, he/she must take immediate action to get the build back to its normal state. The tester must address these issues quickly and equitably to bring the software development back to a normal/standard state by resolving the bugs.
软件开发人员有时会犯无意错误,导致构建过程停止、产生不希望的警告或使自动化测试失败。这类错误被称为“构建破坏者”。一旦开发人员意识到问题,他/她必须立即采取行动,将构建恢复到正常状态。测试人员必须快速且公正地解决这些问题,通过解决缺陷使软件开发恢复到正常/标准状态。
Conclusion
结论
Agile testing offers many career prospects to people seeking employment with leading organizations; however, it is crucial that employees work hard and consistently in order to achieve employment. Agile testing facilitates closer collaboration between developers and testers, leading to a higher level of quality. Agile tester has to list out the corrective feedback and provide it to the developer's team as part of the continuous update cycle. Essentially, this is a continuous integration of Agile development and testing methodologies to achieve the desired results. Those preparing for Agile scrum interviews should read in-depth about this topic.
敏捷测试为寻求在领先组织就业的人提供了许多职业前景;然而,员工必须持续努力才能获得就业机会。敏捷测试促进了开发人员和测试人员之间更紧密的合作,从而带来更高质量。敏捷测试人员必须列出纠正性反馈,并将其作为持续更新周期的一部分提供给开发团队。本质上,这是敏捷开发和测试方法论的持续集成,以实现预期结果。准备敏捷Scrum面试的人应深入了解此主题。
For those who are preparing to attend an interview in this niche, the above-mentioned Agile interview questions for experienced, as well as those who are new to the field, will send you straight to the top. Candidates should have a strong grasp of concepts but also have the ability to speak confidently and decisively. Practising mock interviews can help you develop your self-confidence and prepare you for different interview scenarios. You can easily pass this interview with good preparation and a little bit of cleverness.
对于那些准备参加这一领域面试的人,上述针对经验丰富者以及新入行者的敏捷面试问题将直接把你带到顶尖水平。候选人不仅应对概念有扎实掌握,还应具备自信、果断地表达的能力。练习模拟面试可以帮助你培养自信,并为不同面试场景做好准备。通过充分准备和一点聪明才智,你可以轻松通过这次面试。
Additional Resources
其他资源
- https://www.interviewbit.com/blog/agile-model/
- https://www.interviewbit.com/blog/agile-principles/
- https://www.interviewbit.com/blog/difference-between-agile-and-scrum/
- https://www.interviewbit.com/blog/agile-vs-waterfall/
- https://www.interviewbit.com/software-testing-interview-questions/
- https://www.interviewbit.com/performance-testing-interview-questions/
- https://www.interviewbit.com/scrum-master-interview-questions/
- https://www.interviewbit.com/automation-testing-interview-questions/
- https://www.interviewbit.com/sdlc-interview-questions/
- https://www.interviewbit.com/sdet-interview-questions/
- https://www.interviewbit.com/technical-interview-questions/
- https://www.interviewbit.com/software-testing-mcq/
514. How can keeping an iteration length consistent throughout benefit the project?
在整个项目中保持迭代长度一致会带来哪些好处?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: behavioral | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97923 | 官方: 否 | 付费: 否
答案:
Here are some advantages of keeping iteration lengths consistent throughout the project: - It can serve as a consistent way of measuring the velocity of the team.
以下是在整个项目中保持迭代长度一致的一些优势: - 它可以作为衡量团队速度的一致方式。
- Establishing a consistent delivery pattern becomes more straightforward using it.
- It is inefficient to decide the iteration length at the beginning of each iteration. Test a few lengths, come to a decision, then stick with it until there is a reason to change.
- Having a consistent iteration length, be it one week, three weeks, or somewhere in between, helps teams settle into the pace that works best for them.
515. What are some impediments that a scrum master should remove?
Scrum Master应移除哪些障碍?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97926 | 官方: 否 | 付费: 否
答案:
Agile development teams continuously strive to improve their production processes. However, certain impediments may reduce the value produced, thus slowing down the development process. Impediments are factors that prevent the Development Team from producing useful software in a Sprint or impede the team from achieving its intrinsic goals. The Scrum Master's main role is to remove all impediments that prevent the Development team from moving forward. Given the self-organizing nature of the team, the Scrum Master should assist the team in trying to solve their own problems. Or better still, prevent obstacles from becoming impediments. There are many types of impediments that may arise, as you can see below. - Illness among the team members
敏捷开发团队持续努力改进其生产过程。然而,某些障碍可能会减少产生的价值,从而减慢开发过程。障碍是阻止开发团队在冲刺中生产有用软件或妨碍团队实现其内在目标的因素。Scrum Master的主要角色是移除所有阻碍开发团队前进的障碍。鉴于团队的自组织特性,Scrum Master应协助团队尝试解决自己的问题。或者更好的是,防止障碍变成阻碍。可能出现的障碍类型有很多,如下所示。 - 团队成员生病
- Unforeseen changes team composition
- Tool issues for the Development Team
- Lack of skilled personnel
- Supplier issues
- Product owner's absence
- Unnecessary meetings for the Development Team
- Restrictions on teamwork.
- Conflict among team members, etc.
516. In what ways can QA benefit an agile team?
QA 能以哪些方式使敏捷团队受益?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97929 | 官方: 否 | 付费: 否
答案:
QA ( Quality Assurance ) analysts have myriad responsibilities in agile development, as follows: - Since QA works closely with the software development team from the beginning, QA is capable of identifying potential risks. As QA analysts participate in daily scrums, they can update the team with known and critical issues, so they can stay focused on the bug and speed up their planning.
QA(质量保证)分析师在敏捷开发中承担着多种职责,具体如下:- 由于QA从一开始就与软件开发团队紧密合作,QA能够识别潜在风险。由于QA分析师参与每日站会,他们可以向团队更新已知和关键问题,从而使团队专注于缺陷并加快规划进度。
- QA estimates the testing effort required for each user story in the sprint planning session.
- QA acts as a proxy product owner in the absence of a Product Owner. Additionally, they can discuss the business requirements with the Product Owner.
- For the ongoing enhancement of user stories, QA analysts provide the product owner with feedback from their past testing experiences and the experiences of their team members during each sprint.
- Developers and QA analysts engage in quick handoff demonstrations for every new feature. QA will be able to see how the newly developed feature works, allowing them to raise questions to the development team.
517. Can you explain why Continuous Integration is important for Agile?
你能解释为什么持续集成对敏捷很重要吗?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b9792c | 官方: 否 | 付费: 否
答案:
Continuous Integration (CI) is considered one of the cornerstones of Agile development. This method of developing software requires small components of code to be integrated continuously into the main code following all the phases of the software development lifecycle (SDLC). The following are some of the benefits of CI in agile: - New features can be easily enhanced after the initial version has been released. It reduces the time required to develop new features while ensuring product stability.
持续集成(CI)被认为是敏捷开发的基石之一。这种软件开发方法要求将小段代码在软件开发生命周期(SDLC)的所有阶段中持续集成到主代码中。以下是CI在敏捷中的一些好处:- 在初始版本发布后,可以轻松增强新功能。它减少了开发新功能所需的时间,同时确保了产品的稳定性。
- Continuous integration ensures that code stays robust enough to be utilized by customers or other stakeholders at any time. Overall, this will speed up the development process.
- Moreover, it spurs more feedback between developers and customers, assisting the development team in getting things right before meeting iteration deadlines.
- By combining Agile and Continuous Integration, the SDLC can be transformed and many of its shortcomings eliminated. Ultimately, this leads to an efficient and faster deployment process.
- Effective CI assures that integration never becomes an issue as your code only reflects slight deviations from the codebase. As long as the team continuously deals with small divergences, it does not have to deal with scary divergences.
518. What is Application Binary Interface?
什么是应用程序二进制接口?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b9792f | 官方: 否 | 付费: 否
答案:
In the field of computer software, ABI stands for Application Binary Interface. It's primarily an interface between two binary program modules, one of which is a library or system facility, and the other is a user program. In essence, ABI deals with the implementation details of programs, i.e., what the code turns into after it has been compiled. API covers calling convention, data types, alignment, size, as well as how an application should handle system calls to the operating system.
在计算机软件领域中,ABI代表应用程序二进制接口。它主要是两个二进制程序模块之间的接口,其中一个模块是库或系统设施,另一个是用户程序。本质上,ABI处理程序的实现细节,即代码在编译后变成什么。API涵盖调用约定、数据类型、对齐、大小,以及应用程序应如何处理对操作系统的系统调用。
519. What is Test stub?
什么是测试桩?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97932 | 官方: 否 | 付费: 否
答案:
In Agile, a test stub is a small piece of code (modules) that simulates an component/element in the system being tested and can replace it. Top-down integration testing often involves the use of stubs to simulate or mimic the behavior of lower-level modules that have not been integrated. Stubs are temporary replacements for a called module, and produce the same output as the actual product.
在敏捷中,测试桩是一小段代码(模块),它模拟被测试系统中的组件/元素并可以替代它。自顶向下集成测试通常使用桩来模拟或模仿尚未集成的低层模块的行为。桩是所调用模块的临时替代品,并产生与实际产品相同的输出。
520. Explain Tracer Bullet.
解释追踪弹。
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97935 | 官方: 否 | 付费: 否
答案:
This spike is designed to integrate with the current architecture, current technology, and a set of best practices that will result in high-quality production code. This might seem like a very narrow implementation of the functionality, but it is not junk code. In fact, this code is of production quality, and as such, it will probably be utilized in future iterations of the project. Therefore, the next iterations can build upon this base code.
这种探测旨在与当前架构、当前技术以及一套最佳实践相结合,从而产生高质量的生成代码。这看起来可能是对功能的非常狭窄的实现,但它不是垃圾代码。事实上,这段代码具有生产质量,因此它可能会在项目的未来迭代中使用。因此,后续的迭代可以基于此基础代码进行构建。
521. What is Exploratory Testing and Scripted Testing?
什么是探索性测试和脚本化测试?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97938 | 官方: 否 | 付费: 否
答案:
There are two different testing methods that can be employed to test software release schedules, namely exploratory testing and scripted testing.
有两种不同的测试方法可用于测试软件发布计划,即探索性测试和脚本化测试。
| Exploratory Testing 探索性测试 | Scripted Testing 脚本化测试 |
|---|---|
| An exploratory testing approach allows testers to rely on their instincts, skills, and experience to perform individual tests in-depth. 探索性测试方法允许测试人员依靠其直觉、技能和经验来深入执行个别测试。 | The scripted testing process requires testers to follow a set of guidelines specifically designed to make sure that the actual results are as intended. 脚本化测试过程要求测试人员遵循一系列专门设计的指南,以确保实际结果符合预期。 |
| In-depth domain knowledge is required for this type of testing. Without proper domain expertise, tests cannot be conducted. 这种类型的测试需要深入的领域知识。没有适当的领域专业知识,无法进行测试。 | It is possible to overcome the lack of domain knowledge during the test design phase. They can analyze the document along with learning from the subject matter experts. 在测试设计阶段可以克服领域知识的缺乏。他们可以分析文档,同时向主题专家学习。 |
| Often, documentation is lacking in exploratory environments. 通常,在探索性环境中缺乏文档。 | Documentation is essential in Scripted Testing. 文档在脚本化测试中至关重要。 |
| No preparation is required, and no overhead is associated with reading the documentation. 无需准备,也没有与阅读文档相关的开销。 | Prior to executing tests, it is very important to prepare test scripts and create documentation. 在执行测试之前,准备测试脚本和创建文档非常重要。 |
| Testing involves comparing the application to the tester's expectations and understanding how the application should behave. 测试涉及将应用程序与测试人员的期望进行比较,并理解应用程序应该如何表现。 | An application is verified against the specifications of the document. 根据文档的规范验证应用程序。 |
| Learning and adaptability are key components of this approach. 学习和适应性是这种方法的关键组成部分。 | Prediction and decision-making are important aspects of this approach. 预测和决策是这种方法的重要方面。 |
| It is challenging to manage test coverage. 管理测试覆盖率具有挑战性。 | It is easier to manage test coverage. 管理测试覆盖率更容易。 |
| Automation is not possible. 自动化不可能实现。 | Automation is possible. 自动化可以实现。 |
| As testers examine an application without any proper test documentation, it is very difficult to identify any missing requirements. 由于测试人员在没有适当测试文档的情况下检查应用程序,因此很难识别任何缺失的需求。 | It helps identify any missing requirements from the requirements specification document. 这有助于识别需求规范文档中缺失的任何需求。 |
| There may be some learning curve for new testers, especially when complex applications are being developed. 新测试人员可能会有一些学习曲线,尤其是在开发复杂应用程序时。 | A new tester can readily begin testing the system since he/she has a series of steps to follow. 新测试人员可以立即开始测试系统,因为他/她有一系列步骤可循。 |
522. What do you mean by Spike and Zero sprint in Agile?
在敏捷中,Spike和零冲刺是什么意思?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b9793b | 官方: 否 | 付费: 否
答案:
Sprint Zero: The Sprint Zero is the initial sprint of a team, which occurs before the formal start of the project, before official documentation, and/or before the team's inception. Sprints are intended for the Development Team to develop a minimum number of User Stories, story mapping, a project skeleton, and develop a full-fledged product. As part of sprint zero, the team answers the following questions:
What is the duration of sprints?冲刺的持续时间是多少?
When is a sprint considered completed?
冲刺在何时被视为完成?
What tools do we use, and how should they be used?
我们使用哪些工具,以及应如何使用它们?
How should we work? Would it be best to formalize our agreement in writing?
我们应该如何工作?将我们的协议以书面形式正式化是否更好?- Spike: This shorthand term refers to "spike solutions". It represents the initial investigation or research of a software solution (which could be a feature, a bug fix, a migration task, etc.). Instead of documenting what needs to be done, try to construct a quick, throwaway solution to get a better sense of the scope of work (by validating the technical assumptions). Ideally, spikes should be scheduled along with all other features (bugs, fixes, etc.) during sprints. If a team is unable to agree on an estimate, it may realize the need for a spike.
523. What are the benefits of refactoring?
重构有哪些好处?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b9793e | 官方: 否 | 付费: 否
答案:
Refactoring offers the following benefits: - Refactoring code to make it less complex and easier to understand.
重构带来以下好处: - 重构代码使其更简单、更易理解。
- Streamline the source code design to speed up the creation of new features.
- Reduce messy and unrefined code, which may otherwise require additional rework.
- Reducing the cost of code maintenance and making it more modular and readable.
- Enhancing the architecture of software without affecting its behavior.
- Improved modularity to increase reusability.
524. Explain refactoring.
解释重构。
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97941 | 官方: 否 | 付费: 否
答案:
The word 'refactoring' describes the process of improving the internal structure, the operation, or the aesthetics of a code or component without changing/affecting its external behavior. Teams working in Agile are responsible for maintaining and enhancing their code on an incremental basis, Sprint by Sprint. Without refactoring, an Agile project will end up with poor code quality, such as unhealthy dependencies between classes, too many responsibilities per method, improper design of class responsibilities, and multiple forms of confusion and clutter. Code refactoring helps to simplify ambiguous and complex code by removing chaos.
“重构”一词描述了改善代码或组件的内部结构、操作或美观性,而不改变/影响其外部行为的过程。敏捷团队负责在每个Sprint中逐步维护和增强其代码。如果不进行重构,敏捷项目最终会面临代码质量差的问题,例如类之间的不健康依赖、每个方法承担过多职责、类职责设计不当,以及多种形式的混乱和杂乱。代码重构通过消除混乱来简化模糊和复杂的代码。
In the following example, it can be seen that the 5th module is a refactor. A refactor (5th) is usually broken down into several sequential micro-refactors, and each of those micro-refactors must be tested to ensure they are free from errors.
在以下示例中,可以看到第5个模块是一个重构。一个重构(第5个)通常被分解为几个连续微重构,每个微重构都必须进行测试以确保其无错误。
525. What is Acceptance Testing in Agile?
敏捷中的验收测试是什么?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97944 | 官方: 否 | 付费: 否
答案:
An acceptance test is a test conducted to evaluate whether or not the requirements of a software specification have been met. Testing involves comparing new features, functionality, or systems against predefined acceptance criteria. Acceptance testing is an integral part of agile development and is not merely an afterthought. The intent, however, remains the same: ensuring that software meets customer and end-user expectations.
验收测试是一种测试,用于评估软件规范的要求是否已满足。测试涉及将新功能、特性或系统与预定义的验收标准进行比较。验收测试是敏捷开发不可或缺的一部分,并非事后考虑。然而,其目的保持不变:确保软件满足客户和最终用户的期望。
526. What sets Agile Testing apart from other traditional Software Testing Models?
敏捷测试与其他传统软件测试模型有何不同?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b97947 | 官方: 否 | 付费: 否
答案:
There are various factors that set Agile testing apart from other traditional Software testing methodologies.
有各种因素将敏捷测试与其他传统软件测试方法区分开来。
| Agile Testing 敏捷测试 | Traditional Software Testing 传统软件测试 |
|---|---|
| Agile testing involves performing tests alongside software development in order to ensure greater transparency of the development process. 敏捷测试涉及在软件开发同时进行测试,以确保开发过程有更高的透明度。 | Traditional testing takes place after the entire phase of software development has been completed. The testing process comes after the development cycle is complete, and it could take a long time. 传统测试在软件开发的整个阶段完成后进行。测试过程在开发周期完成后开始,可能需要很长时间。 |
| In contrast, agile testing enables the team to "move forward (release) with working components while addressing defects in subsequent iterations". 相比之下,敏捷测试使团队能够“带着可工作的组件向前推进(发布),同时在后续迭代中处理缺陷”。 | It emphasizes on "Fix Defect Then Release". 它强调“修复缺陷然后发布”。 |
| It requires regular interaction with customers. 它需要与客户定期互动。 | Customer interaction is not mandatory on a daily or weekly basis. 客户互动并非日常或每周必须。 |
| This process, however, is based on continuous improvement; changes are made in the next iteration of the testing cycle. 然而,这个过程基于持续改进;更改在测试周期的下一次迭代中进行。 | The traditional approach allows for any necessary modifications to be made only during the next release. 传统方法只允许在下一次发布时进行必要的修改。 |
| It is more suitable for projects where the requirements fluctuate frequently. 它更适用于需求频繁波动的项目。 | Specifically, it is best suited for situations where the requirements are little or never likely to change. 具体而言,它最适合需求很少或不可能改变的情况。 |
| The business team is involved in each iteration of Agile testing. Continual feedback reduces the amount of time required to provide feedback for software development work. 业务团队参与敏捷测试的每次迭代。持续的反馈减少了为软件开发工作提供反馈所需的时间。 | User feedback is not obtained until the testing has been completed. 用户反馈直到测试完成后才获得。 |
| Agility follows a risk-prevention approach that is timely and efficient. 敏捷遵循及时且高效的风险预防方法。 | In comparison, the traditional method is a risk-averse methodology. 相比之下,传统方法是规避风险的方法论。 |
| By using an incremental and iterative approach, agile testing reduces the overall time taken to define test requirements and validate the results. This leads to more rapid release of products without delays. 通过使用增量和迭代方法,敏捷测试减少了定义测试需求和验证结果的总时间。这导致产品更快发布而不会延迟。 | As with traditional testing, it is a time-consuming process that is expensive both financially and in terms of effort. 与传统测试一样,这是一个耗时的过程,在财务和精力上都很昂贵。 |
| Continuous interaction between team members is of utmost importance. 团队成员之间的持续互动至关重要。 | Testing is done in phases, thus limiting interaction among team members. 测试分阶段进行,从而限制了团队成员之间的互动。 |
527. How do you handle continuous changes in requirements as an Agile Tester?
作为敏捷测试员,如何处理需求的持续变化?
- 知识点: 测试 / 行为与软技能 (主题: agile, testing;标签: interviewbit, agile-testing, topic-specific, agile, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3792158d557c902b9794a | 官方: 否 | 付费: 否
答案:
In cases where requirements are constantly changing, agile testers are advised to follow the following approach: - Prepare generic test cases and test plans focused on the intent of the requirement rather than its details.
在需求不断变化的情况下,建议敏捷测试员遵循以下方法: - 准备通用测试用例和测试计划,专注于需求的意图而非细节。
- Product Owners and teams must work together to understand and minimize the impact of requirements changes.
- Develop contingency plans to address the risks of changing requirements at the end of the iteration.
- It is best to automate a feature only after the feature has been stabilized and the requirements are finalized.
- Use Agile Task Boards for better project management as they help arrange development tasks into various categories like To-Do, In Progress, and Done. With this categorization, team members can see where they stand in their progress, as well as which parts of the project are in need of attention.
- A daily stand-up meeting with clients is highly beneficial because any changes that clients suggest can be discussed right away. Changes in requirements, timeframe, effort, and overall project schedule can all be discussed at a higher level and agreed upon during these meetings.
- Let your customer participate in all stages of the project, from the initial stage of identifying requirements to the final phase of implementation. The customer may change requirements during each interaction.
528. What is the importance of caching mechanism?
缓存机制的重要性是什么?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99147 | 官方: 否 | 付费: 否
答案:
Caching mechanism is the practice of storing data temporarily to retrieve data for repeated requests. This increases the performance of the system by obtaining the data from the cached copy instead of hitting the database and getting the original data.
缓存机制是临时存储数据以用于重复请求检索的实践。通过从缓存副本获取数据而不是访问数据库获取原始数据,这提高了系统的性能。
529. How do you document an API functionality? What are the tools available for achieving the same?
如何编写API功能文档?实现这一目标可用的工具有哪些?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: coding
- 分类: fullstack
- id: 69b3793a58d557c902b9914a | 官方: 否 | 付费: 否
答案:
API documentation represents any description of the functionality of the API. Since this documentation will be used by external developers, we need to follow some best practices. They are: - Plan what needs to be shown in your documentation.
API文档是指对API功能的任何描述。由于该文档将被外部开发人员使用,我们需要遵循一些最佳实践。它们是:- 规划文档中需要展示的内容。
- Do not exclude any fundamental sections of the API functionality.
- Use simple words by avoiding technical jargon.
- Include various interactive examples and resources to understand the API functionality clearly.
Consistently maintain the documentation as and when the functionality gets updated.
Some of the popular tools used for achieving API documentation are: - JavaDoc一些用于实现API文档的流行工具有:- JavaDoc
- Doxygen
- OpenAPI
- Redoc
- Swagger UI
530. What is the most important difference between API testing and UI testing?
API测试和UI测试之间最重要的区别是什么?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9914d | 官方: 否 | 付费: 否
答案:
UI testing represents testing by using Graphical User Interface. The main area of focus in this is to test the look and feel of the software application by focusing on how the application is feasible for the end-users, do the functionalities of all the items shown on the UI screen - images, fonts, buttons, layouts etc are appearing properly as expected. On the other hand, API testing ensures the testing of communication of data between various software systems. It mostly falls under the validation of back-end functionality.
UI测试是指通过图形用户界面进行的测试。其重点是通过关注软件应用对最终用户的可行性,以及UI屏幕上显示的所有项目(如图片、字体、按钮、布局等)的功能是否按预期正常出现,来测试软件应用的外观和感觉。另一方面,API测试确保各软件系统之间数据的通信测试。这主要属于后端功能的验证范畴。
531. What are the major blockers or challenges faced while performing API testing?
在执行API测试时面临的主要障碍或挑战是什么?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99150 | 官方: 否 | 付费: 否
答案:
Some of the challenges faced while doing API testing are: - Proper Parameter Selection
进行API测试时面临的一些挑战有:- 正确的参数选择
- Proper Parameter Combination
- Knowing which API needs to be called in what sequence
- Proper knowledge of output verification
- Knowing what are the proper input values that needs to be provided to the API inputs.
532. What are the principles that need to be followed while performing API Testing?
执行API测试时需要遵循的原则有哪些?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99153 | 官方: 否 | 付费: 否
答案:
There are 7 principles in API testing design. They are: - Optimal Testing: Since it is not possible to test anything exhaustively, there needs to be at least some optimal amount of testing depending on the risk assessment performed on the application.
API测试设计中有7个原则。它们是:- 最优测试:由于不可能穷尽测试一切,因此需要根据对应用进行的风险评估,至少执行一定数量的最优测试。
- Defect Clustering: This represents the clustering of modules containing most defects. As a general rule, almost 80% of the defects are found in 20% of the application modules. These risky modules can be identified by following this approach.However this principle has a problem. We might have to perform API testing repeatedly on the application which might be obstructive to finding new bugs.
- Pesticide Paradox: This paradox states that if the testers use the same test cases repeatedly, then they would not be capable of finding new bugs over a period of time. Hence, the testers need to be fully equipped by reviewing and revising the test cases regularly. New test cases are more effective in finding new bugs. However, no amount of testing can ensure that the product is 100% bug-free.
- Presence of defects: Another principle of testing is that the aim of testing should be the presence of bugs and not the absence of defects. The goal of testing is to reduce the probability of finding undiscovered bugs. In case 0 defects are found, yet we cannot fully claim that our software is 100% bug-free.
- Error absence fallacy: There can be an increased possibility of software being unusable even if it is 99% bug-free which can be wrong. The main focus of software testing is to ensure that the software addresses the business requirements correctly. This principle states that even if we identify and fix the defects if the software does not fulfil the business requirements, then the system is unusable.
- Early Testing: This principle states that it is easier to fix bugs early in the software development lifecycle. Hence, it is recommended to start testing the application as early as possible.
- Context Dependent Testing: The way we test an application depending on the type of the system. We use different techniques, methodologies and test cases to test the applications depending on the type. For example, the way we test e-commerce applications is different from the way we test online streaming applications.
533. What are the different bugs that can be found in API testing?
API测试中可以发现哪些不同类型的错误?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99156 | 官方: 否 | 付费: 否
答案:
We can find the below bugs at the time of API testing: - Duplicate or missing API functionality
在API测试时我们可以发现以下错误:- 重复或缺失的API功能
- Failure to handle negative test cases
- Failure to handle a sudden spike in load or stress
- Reliability of the application behavior
- Failure to handle requests securely
- Unused flags
- Unimplemented errors
- Poor Performance
- Issues in Multi-threading
- Improper error responses
- Improper status codes
534. Define Test API.
定义测试API。
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99159 | 官方: 否 | 付费: 否
答案:
Test API refers to a set of APIs or library utilities that helps developers to create automated test cases for testing .NET or WIN 32 systems. It has a set of basic data building blocks, data types, data structures etc.
测试API指的是有助于开发人员为测试.NET或WIN 32系统创建自动化测试用例的一组API或库实用程序。它包含一组基本的数据构建块、数据类型、数据结构等。
535. What is Payload?
什么是Payload?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9915c | 官方: 否 | 付费: 否
答案:
Payload is the most common term used in the case of REST APIs. It refers to the actual data sent to the server in the API request in different formats like JSON, XML etc.
Payload是REST API中最常用的术语。它指的是在API请求中以JSON、XML等不同格式发送到服务器的实际数据。
536. What is Run Scope?
什么是Run Scope?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9915f | 官方: 否 | 付费: 否
答案:
Run Scope is an API testing tool that is typically a web application supporting an easier user interface platform to test back-end services. For more information, visit here .
Run Scope是一个API测试工具,通常是一个支持更简单用户界面平台来测试后端服务的Web应用程序。如需更多信息,请访问此处。
537. Why is automated API testing useful?
为什么自动化API测试有用?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99162 | 官方: 否 | 付费: 否
答案:
Automated testing is useful in the long run as it helps to maximize the test coverage of the applications in a shorter period of time meaning it helps to test large test sets very easily and quickly. It enables parallel execution and helps to reduce human-generated errors in testing. It saves the time required to test applications thereby saving the overall cost.
自动化测试从长远来看是有用的,因为它有助于在更短的时间内最大化应用程序的测试覆盖率,这意味着它可以帮助非常轻松快速地测试大型测试集。它支持并行执行,并有助于减少测试中人为产生的错误。它节省了测试应用程序所需的时间,从而节省了总体成本。
538. What do you understand by Input injection?
你对输入注入有什么理解?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99165 | 官方: 否 | 付费: 否
答案:
Input injection is the act of simulating inputs for testing APIs. It can be simulated in different ways: - Direct Method Invocation
输入注入是为测试API而模拟输入的行为。它可以以不同方式模拟: - 直接方法调用
- Accessibility interface invocation
- Low-level input simulation
- Device driver simulation
- Robot Simulation.
539. What do you understand by the test environment for API?
你对API的测试环境有什么理解?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99168 | 官方: 否 | 付费: 否
答案:
The test environment is an environment that helps test the APIs developed by providing a feature to send requests and get the responses from the server. It is similar to the production environment where the Quality Analyst has enough data to perform their functionality testing. In a test environment, we can have a test database, a localized gateway, a server and a load balancer.
测试环境是一个通过提供发送请求并从服务器获取响应的功能来帮助测试所开发API的环境。它类似于生产环境,质量分析师有足够的数据来执行其功能测试。在测试环境中,我们可以拥有测试数据库、本地化网关、服务器和负载均衡器。
540. Is it possible to hack API while testing?
在测试期间有可能攻击API吗?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9916b | 官方: 否 | 付费: 否
答案:
Yes, it is possible. This is because we are sending requests over the internet which mostly follows HTTP protocol. This protocol is text-based and is easier to read. Hence, it is required to perform security testing of the APIs to ensure safer systems.
是的,这是可能的。这是因为我们通过互联网发送请求,这些请求大多遵循HTTP协议。该协议是基于文本的,更容易读取。因此,需要对API执行安全测试,以确保系统更安全。
541. How should we test the API security?
我们应该如何测试API安全性?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b9916e | 官方: 否 | 付费: 否
答案:
To test the security of the API during API testing, we need to validate 2 things: - Authentication: Whether the identity of the end-user is correct.
在API测试期间测试API的安全性时,我们需要验证两件事: - 身份验证:最终用户的身份是否正确。
Authorization: Whether the user is allowed to access the resource.
We can also validate whether the TLS or the SSL certificate used over the HTTPS protocol is valid or not.我们还可以验证通过HTTPS协议使用的TLS或SSL证书是否有效。
542. What do you understand by Big Bang Approach in testing?
你对测试中的大爆炸方法有什么理解?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99171 | 官方: 否 | 付费: 否
答案:
The big bang approach is the approach of combining all modules at once and then performing verification of the functionality after the individual modules are tested. It belongs to the category of integration testing of the applications.
大爆炸方法是一次性将所有模块组合起来,然后在单独模块测试后执行功能验证的方法。它属于应用程序集成测试的范畴。
543. How do you perform API Load Testing?
你如何执行API负载测试?
- 知识点: 测试 (主题: api-testing, testing;标签: interviewbit, api-testing, topic-specific, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3793a58d557c902b99174 | 官方: 否 | 付费: 否
答案:
- Load Testing is a category of Performance Testing that is used for checking an application’s capability to perform under various user loads.
- This is done for identifying bottlenecks in performance before the application becomes live.
- It is done by simulating many users hitting the API at the same time or in other words, artificial traffic is simulated to identify if the application is capable of handling the load by maintaining consistency in the response times and not impacting the functionality.
- One such tool to perform Load Testing is JMeter. It provides flexibility to create a test plan, define the thread groups and record test scripts to simulate artificial load to the API. It finally provides a feature to visualize the result of load testing done. For more information about using JMeter, you can refer here.
Useful Interview Resources:
有用的面试资源:
- Automation Testing
- Manual Testing
- JMeter
- Web Services
- Web API
- REST API
- Robot Framework
- Database Testing
- UFT/QTP
544. How will you automate the basic login in a web application?
你将如何自动化web应用中的基本登录功能?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a921 | 官方: 否 | 付费: 否
答案:
Assuming a tester has configured the test environment and a test tool like Selenium, here are the steps I would take to automate the login functionality. - Test the login manually to understand all the input fields, checkboxes, and buttons on the login screen. Keep a note of which pages the user is redirected to in both successful and failed logins.
假设测试人员已配置好测试环境和诸如Selenium之类的测试工具,以下是自动化登录功能我会采取的步骤。- 手动测试登录以了解登录界面上的所有输入字段、复选框和按钮。记录用户在成功和失败登录时被重定向到的页面。
- Prepare a test dataset that contains the username and password combinations. The inputs consist of varying lengths and have alphanumeric character sets.
- Develop test cases to test various paths the user might take in a real-world scenario. Note down the expected outputs for each test case.
- In the test tool, configure each test case to be manually invoked, and use the test data prepared in step 2. Record the instances where the actual output doesn’t match the expected result.
- Verify and validate the success/error messages and the redirects after each login attempt.
545. What is Selenium? What are its pros and cons?
什么是Selenium?它的优缺点是什么?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a928 | 官方: 否 | 付费: 否
答案:
For any web application, browser automation and cross-browser testing are two critical testing activities to ensure that the software works on various browsers/devices/platforms. Selenium [2] is a popular web automation tool that helps achieve that. It’s one of the most widely used and popular tools used in automation testing.
对于任何web应用,浏览器自动化和跨浏览器测试是两项关键的测试活动,以确保软件能在各种浏览器、设备和平台上正常工作。Selenium [2] 是一个流行的web自动化工具,有助于实现这一点。它是自动化测试中使用最广泛和流行的工具之一。
Advantages of Selenium: - Open Source: It’s developed in open and has excellent community support. The software is updated regularly, ensuring significant problems and bugs are fixed, and new features are getting added constantly.
Selenium的优点:- 开源:它开放开发,拥有优秀的社区支持。软件定期更新,确保重大问题和错误得到修复,并不断添加新功能。
- Cross-Browser: Selenium allows you to run and test your web application in multiple browsers, such as Chrome, Safari, Firefox, etc.
- Cross-platform: You can use Selenium on Windows, Mac OS, or Linus. This allows testing the platform compatibility of your web application.
Language Agnostic: You can use Selenium in your favorite programming languages, such as Java, C#, Python, Ruby, and many more.
Disadvantages of Selenium: - Learning Curve: One of the most common and recurring problems mentioned by new testers is that Selenium is complicated and takes a long time to learn. It requires prior programming knowledge.Selenium的缺点:- 学习曲线:新测试人员提到的最常见和反复出现的问题之一是Selenium复杂且耗时学习。它需要先前的编程知识。
- No support for desktop/mobile: Selenium only supports web applications. You cannot use it to test your desktop and mobile applications.
- No reliable tech support: As it’s open-source software, there’s no dedicated tech support that you can use in case you run into problems.
- Complicated debugging: It’s tougher to debug Selenium programs than the other tools and frameworks.
546. What are the different components of Selenium?
Selenium的不同组件有哪些?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a92d | 官方: 否 | 付费: 否
答案:
Selenium is not a single tool or a framework. It is a suite of tools that work with each other or in isolation to provide different types of automation testing. Here are the four major components of Selenium. - Selenium WebDriverA collection of open-source APIs and browser-controlling code implementations that provide a concise and straightforward programming interface.
Selenium不是单一工具或框架。它是一个工具套件,可以相互配合或独立工作,提供不同类型的自动化测试。以下是Selenium的四大主要组件。- Selenium WebDriver一组开源API和浏览器控制代码实现,提供了简洁明了的编程接口。
- Selenium GridIt enables the tester to run multiple tests across different browsers, machines, and operating systems in parallel.
Selenium IDE
Stands for the Integrated Development Environment. It allows the tester to write, record, run and debug the test cases.代表集成开发环境。它允许测试人员编写、录制、运行和调试测试用例。
547. What is UI testing?
什么是UI测试?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a930 | 官方: 否 | 付费: 否
答案:
The software’s user interface is the only thing that the users see, touch and feel. They are not concerned about the backend code, database, or the frameworks you used to build the software. Building an application with broken, inconsistent, or annoying user interfaces can be enough to lose customers.
软件的用户界面是用户看到、触摸和感知的唯一部分。他们不关心后端代码、数据库或你用来构建软件的框架。构建具有破损、不一致或令人厌烦的用户界面的应用,足以失去客户。
The goal of the UI testing is to ensure that the software uses a consistent user experience and no visual or graphical elements on the screen are broken. An advanced form of UI testing also ensures that the user interface is intuitive, prevents common mistakes, and doesn’t get in the way of the users getting their job done.
UI测试的目标是确保软件使用一致的用户体验,并且屏幕上的任何视觉或图形元素都没有损坏。高级UI测试还确保用户界面直观、防止常见错误,并且不阻碍用户完成任务。
Typically, UI testing is performed manually by a human tester. With the advancements in the tools and frameworks in automation testing, UI testing is becoming a good candidate for automation.
通常,UI测试由人类测试人员手动执行。随着自动化测试工具和框架的进步,UI测试正成为自动化的良好候选对象。
548. What is Protractor?
什么是 Protractor?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a933 | 官方: 否 | 付费: 否
答案:
Protractor is an open-source automated testing framework that allows you to perform end-to-end testing of your web applications. It’s built on top of WebDriverJS. Protractor is developed by Google and is especially used for testing Angular applications.
Protractor 是一个开源自动化测试框架,允许你对 Web 应用执行端到端测试。它构建在 WebDriverJS 之上。Protractor 由 Google 开发,尤其用于测试 Angular 应用。
Protractor runs the tests against the web application by running it in real web browsers. It also interacts with the application like an end-user would, e.g. clicking buttons, links, filling forms, etc., and verifying the result with the expected outcome.
Protractor 通过在真实 Web 浏览器中运行应用来对 Web 应用执行测试。它还像最终用户一样与应用交互,例如点击按钮、链接、填写表单等,并验证结果是否符合预期。
Since Protractor is based on the Selenium WebDriver, it’s easy to perform cross-browser testing. It provides a simple API compared to Selenium, so the learning curve is not too steep. Developers can quickly get familiar with it and start writing the end-to-end UI tests. You can also take snapshots and compare them using Protractor. It also allows you to run parallel test cases on different machines.
由于 Protractor 基于 Selenium WebDriver,因此很容易进行跨浏览器测试。与 Selenium 相比,它提供了简单的 API,因此学习曲线不太陡峭。开发人员可以快速熟悉它并开始编写端到端 UI 测试。你还可以使用 Protractor 拍摄快照并进行比较。它还允许你在不同机器上运行并行测试用例。
549. What is a test automation platform?
什么是测试自动化平台?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a936 | 官方: 否 | 付费: 否
答案:
A test automation platform is a tool or a framework that makes it easy to automate software testing. It uses programs and scripts that are written by developers or testers to automate the entire process.
测试自动化平台是一种工具或框架,使软件测试的自动化变得容易。它使用由开发人员或测试人员编写的程序和脚本来自动化整个流程。
A test automation platform typically provides all the functionality that you would need to start with automated testing. It saves you from using a plethora of tools and makes them work with each other.
测试自动化平台通常提供开始自动化测试所需的所有功能。它省去了你使用大量工具的需要,并使它们能够相互协作。
Test automation platforms primarily find their use in complex or large software projects where it’s difficult or cumbersome to perform manual testing on all the functionality provided by the software.
测试自动化平台主要用于复杂或大型软件项目,在这些项目中,对软件提供的所有功能进行手动测试困难或繁琐。
550. What are some of the alternatives to Selenium?
有哪些 Selenium 的替代方案?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a939 | 官方: 否 | 付费: 否
答案:
For a long time, Selenium has been one of the most popular test automation tools preferred by many teams. However, it is a very sophisticated tool with a steep learning curve, and it might not be suitable for all test projects. In recent years some popular alternatives have emerged, listed below. - Cucumber
很长一段时间以来,Selenium 一直是许多团队青睐的最受欢迎的测试自动化工具之一。然而,它是一个非常复杂的工具,学习曲线陡峭,可能不适合所有测试项目。近年来出现了一些流行的替代方案,列在下面。- Cucumber
It’s an open-source testing tool that allows writing tests in a simple, plain language readable by anyone on the team. It focuses on behavior-driven development, where the human-readable description of the functionality is used as the basis for testing. - Cypress
它是一个开源测试工具,允许以团队中任何人都能阅读的简单、通俗语言编写测试。它专注于行为驱动开发,其中功能的人类可读描述被用作测试的基础。- Cypress
Cypress is a free and open-source testing tool. It’s written in JavaScript and has become very popular recently because of its simplicity and advanced features that allow you to perform browser testing. Cypress makes it easy to write and debug unit tests, end-to-end tests, integration tests. It also supports taking snapshots and recordings to help to reproduce the bugs. - Robot FrameworkRobot Framework is a generic open-source automation framework. It can be used for test automation and robotic process automation (RPA).
Cypress 是一个免费且开源的测试工具。它用 JavaScript 编写,并因其简单性和允许进行浏览器测试的高级功能而近来变得非常流行。Cypress 使编写和调试单元测试、端到端测试、集成测试变得容易。它还支持拍摄快照和录制以帮助重现错误。- Robot FrameworkRobot Framework 是一个通用的开源自动化框架。它可用于测试自动化和机器人流程自动化(RPA)。
551. What is the Robot framework? Provide a brief overview of its architecture.
什么是 Robot Framework?简要概述其架构。
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: system-design
- 分类: fullstack
- id: 69b3795858d557c902b9a93c | 官方: 否 | 付费: 否
答案:
Robot Framework is an increasingly popular, open-source automation testing framework primarily used for robotic process automation (RPA). Robotic process automation tries to emulate human actions and interactions with software. Similar to real humans, robotic automation can understand (to an extent) what is on screen, press keys and buttons, navigate to links and extract data.
Robot Framework 是一个日益流行的开源自动化测试框架,主要用于机器人流程自动化(RPA)。机器人流程自动化试图模拟人类与软件的行动和交互。与真实人类类似,机器人自动化可以(在一定程度上)理解屏幕上的内容、按键和按钮、导航链接并提取数据。
The Robot Framework is written in Python and operating system agnostic. Most of the libraries in the ecosystem are also open-source. It has a modular architecture open for extension with other libraries. It defines the test data in files using a special syntax that’s specific to the framework. A test suite contains multiple such tests.
Robot Framework 用 Python 编写,且与操作系统无关。生态系统中的大多数库也是开源的。它具有模块化架构,可通过其他库进行扩展。它使用框架特有的特殊语法在文件中定义测试数据。一个测试套件包含多个此类测试。
When you start the execution of the tests, the Robot Framework parses the test data and uses the keywords provided by the libraries to interact with the software. These libraries communicate with the software directly or indirectly using driver tools.
当开始执行测试时,Robot Framework 解析测试数据,并使用库提供的关键字与软件交互。这些库直接或间接使用驱动工具与软件通信。
The Robot Framework runs the test from the command line. However, you can get detailed reports and logs in both XML and HTML formats. The framework has good support for standard libraries out-of-box, e.g. ArchiveLibrary, Browser Library, DataDriver Library, HttpRequestLibrary (for Java), etc.
Robot Framework 从命令行运行测试。但是,您可以获得XML和HTML格式的详细报告和日志。该框架开箱即用地支持标准库,例如ArchiveLibrary、Browser Library、DataDriver Library、HttpRequestLibrary(用于Java)等。
552. What are the test library APIs provided by the Robot Framework?
Robot Framework 提供的测试库API有哪些?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a93f | 官方: 否 | 付费: 否
答案:
The Robot Framework has three test library APIs. - Static API: A module or a class containing methods map directly to the keyword names that take the same arguments as the implementing methods.
Robot Framework 有三种测试库API。- 静态API:一个模块或类,其中的方法直接映射到关键字名称,这些关键字名称采用与实现方法相同的参数。
- Dynamic API: The names of the keywords to implement and how to implement is determined at runtime.
- Hybrid API: Combination of both the static and dynamic API. Libraries are classes containing the methods that tell them which keywords to implement, but those keywords must be available directly.
553. Who should be responsible for test automation? Developers or the QA?
谁应该负责测试自动化?开发人员还是QA?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a942 | 官方: 否 | 付费: 否
答案:
As a team is supposed to be a single unit responsible for shipping a quality software system, it’s a team’s responsibility to write, execute, and manage test scripts. That means the developers and the QA should collaborate and use each other’s skills to perform automation testing effectively.
作为团队,应被视为负责交付高质量软件系统的单一单元,因此编写、执行和管理测试脚本是团队的责任。这意味着开发人员和QA应协作,并利用彼此的技能来有效地进行自动化测试。
Each team has a different skill set. Some have more technical testers, some have quality-focused developers, and some have testers who came from development backgrounds and vice versa. Hence it’s not a good idea to pigeonhole automated testing to a particular department. Instead, collaboration and working together is the key to a successful automated testing strategy.
每个团队都有不同的技能组合。有些团队拥有更多技术型测试人员,有些拥有注重质量的开发人员,还有些团队中的测试人员来自开发背景,反之亦然。因此,将自动化测试固定给某个特定部门并不是一个好主意。相反,协作和共同努力是成功自动化测试策略的关键。
554. What are some risks associated with automated testing?
自动化测试有哪些相关风险?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a945 | 官方: 否 | 付费: 否
答案:
Although test automation comes with benefits such as efficient and fast, repeatable tests, there are a few risks a team should be aware of. - Negative ROI
尽管测试自动化带来了高效、快速、可重复测试等好处,但团队应意识到几个风险。- 投资回报率为负
A team can make a considerable investment to get automation testing going. Automated tests require lots of code and expensive tools. Developers and testers spend significant time in learning and implementing automated tests. However, as it’s put into practice, the team might realize that the testing strategy is not providing any real value, as the software is complex with constantly changing configuration and features. They have to keep the tests constantly up-to-date. - Playing catch-up with the technology.
团队可能需要进行大量投资才能启动自动化测试。自动化测试需要大量代码和昂贵的工具。开发人员和测试人员会花费大量时间学习和实施自动化测试。然而,在实际实践过程中,团队可能会发现,由于软件配置和功能不断变化且复杂,测试策略并未提供任何实际价值。他们必须不断更新测试。- 追赶技术进度
As with any software, automation testing tools and frameworks go through constant evolution. There is a steep learning curve to the automation tools and need prior programming experience. Instead of picking a tool and using it well, the development/testing team spends their time learning and playing with different tools and technologies. In that case, the automation testing might not realize its original promised value. - Maintenance Risk
与任何软件一样,自动化测试工具和框架也在不断演进。自动化工具的学习曲线陡峭,并且需要先前的编程经验。开发/测试团队不是选择一种工具并很好地使用它,而是花费时间学习和试用不同的工具和技术。在这种情况下,自动化测试可能无法实现其最初承诺的价值。- 维护风险
All code has to be maintained and kept up-to-date with the changing requirements and fixing bugs. Test automation code is no exception to that. Instead of building new features and fixing bugs in the software, if developers and testers find themselves spending most of their time working on the automation framework, automated testing has failed.
所有代码都必须进行维护,并根据不断变化的需求和修复缺陷而保持最新。测试自动化代码也不例外。如果开发人员和测试人员发现自己将大部分时间花在自动化框架上,而不是构建新功能和修复软件缺陷,那么自动化测试就已经失败了。
555. What are the different phases in an automation testing life cycle?
自动化测试生命周期中有哪些不同阶段?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a948 | 官方: 否 | 付费: 否
答案:
Similar to a software development and software testing life cycle, automation testing has its life cycle. Here are the major phases that an automation testing project goes through. - Figure out the scope of automation testing
与软件开发和软件测试生命周期类似,自动化测试也有其生命周期。以下是自动化测试项目经历的主要阶段。- 确定自动化测试的范围
- Choose the correct automation frameworks and tools
- Design a test plan + test execution strategy
- Set up the test environment
- Development and execution of the test cases
- Analysis and generation of test reports
556. What is CAPTCHA?
什么是CAPTCHA?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a94b | 官方: 否 | 付费: 否
答案:
CAPTCHA stands for Completely Automated Public Turing Test to tell Computers and Humans Apart. It is a type of security measure and is also known as challenge-response authentication.
CAPTCHA代表完全自动化的公共图灵测试,用于区分计算机和人类。它是一种安全措施,也被称为挑战-响应认证。
The primary goal of the CAPTCHA is to protect you from spam or denial-of-service attacks by bots/scripts by asking you to complete a simple test that is difficult for computers to follow. It proves you are human and not a computer.
CAPTCHA的主要目标是通过要求您完成一个对计算机来说难以执行的简单测试,来保护您免受机器人/脚本发来的垃圾邮件或拒绝服务攻击。它证明您是真人而不是计算机。
A CAPTCHA challenge consists of two parts: - A randomly generated sequence of letters/numbers. These alphanumeric characters appear as distorted images and might appear behind other non-significant characters to make it difficult for a computer to parse them.
CAPTCHA 验证码挑战由两部分组成:- 一个随机生成的字母/数字序列。这些字母数字字符以扭曲的图像出现,并且可能出现在其他无关字符后面,以使计算机难以解析它们。
- A text box where the user is supposed to copy the characters. To pass the test and prove that they are human, the user types the characters in the text box.
557. How do you automate the testing of CAPTCHA?
如何自动化测试CAPTCHA?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a94e | 官方: 否 | 付费: 否
答案:
It’s not possible to automate the testing of CAPTCHA. That is the goal behind any good CAPTCHA strategy. By definition, a computer can’t automate it. If it could, then it’s not a good challenge that you can use in your application.
无法自动化测试CAPTCHA。这是任何好的CAPTCHA策略的目标。从定义上讲,计算机无法自动化它。如果能自动化,那就不是一个可以在你的应用程序中使用的好挑战。
However, if you need to test an application that uses CAPTCHA, you have to work with the development team to build a workaround or a back door that allows the automated test to bypass the CAPTCHA challenge. It’s important to restrict this workaround only in the test environment and not release it to production.
然而,如果你需要测试一个使用CAPTCHA的应用程序,你必须与开发团队合作,构建一个解决方法或后门,允许自动化测试绕过CAPTCHA挑战。重要的是要限制这种方法仅在测试环境中使用,并且不要发布到生产环境。
558. What are some development practices to follow when writing automated tests?
编写自动化测试时应遵循哪些开发实践?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a951 | 官方: 否 | 付费: 否
答案:
All the software development rules apply when writing automated tests. Here are some of the best practices that one can apply for tests. - Validating the tests will fail
编写自动化测试时适用所有软件开发规则。以下是一些可以应用于测试的最佳实践。- 验证测试会失败
Similar to testing that software will work, it's essential to ensure the test will fail if the feature its testing doesn't meet the criteria. A test that never fails is worse than having no tests, as it gives a false assurance that the feature is working. - Don't Repeat Yourself (DRY)
类似于测试软件将正常工作,确保测试在它所测试的功能不符合标准时失败是至关重要的。一个从不失败的测试比没有测试更糟糕,因为它提供了功能正常工作的虚假保证。- 不要重复自己(DRY)
Avoiding duplication in code is crucial. The benefit of this strategy is that the change is isolated to a single location, preventing bugs and errors. - Keep Functions Small
避免代码中的重复至关重要。这种策略的好处是更改被隔离在单个位置,防止错误和缺陷产生。- 保持函数小巧
Since the testers who are creating automated tests are not familiar with good coding standards, it's easy to fall into the trap of creating giant functions that try to do everything. This quickly results in unmaintainable code that the team is afraid to touch when the requirements change, resulting in out-of-date tests that test the legacy behavior of the system. - Write Good Documentation
由于创建自动化测试的测试人员可能不熟悉良好的编码标准,很容易陷入创建试图处理所有事情的大型函数的陷阱。这迅速导致代码难以维护,团队在需求变化时不敢触碰这些代码,结果产生过时的测试来测试系统的遗留行为。- 编写良好的文档
Having well-written documentation explains not only the what, but then why is important for new team members when they try to understand the tests. It can also help the person who wrote the tests when they try to modify/understand the tests in the future.
编写良好的文档不仅解释了“什么”,还解释了“为什么”,这对于新团队成员试图理解测试时很重要。它也有助于编写测试的人员在未来修改和理解测试时。
559. When selecting an automation tool, what features will you look for?
在选择自动化工具时,你会关注哪些功能?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a954 | 官方: 否 | 付费: 否
答案:
Here are some of the features to look for when selecting an automation tool: - Test Environment support,
这里有一些在选择自动化工具时需要注意的功能:- 测试环境支持,
- Ease of use,
- Debugging features,
- Testing capabilities for various elements,
- UI element identification features,
- Should allow database testing.,
- Should support multiple frameworks.
560. Is automated testing making manual testing obsolete?
自动化测试是否使手动测试过时?
- 知识点: 测试 (主题: automation, testing;标签: interviewbit, automation-testing, topic-specific, automation, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b3795858d557c902b9a957 | 官方: 否 | 付费: 否
答案:
No. Automated testing is not making manual testing obsolete. Though automated tests help avoid regression issues or find problems that you are already aware of, manual exploratory testing is essential to find the bugs you don’t know about, such as incorrect requirements or implementations.
不是。自动化测试并未使手动测试过时。尽管自动化测试有助于避免回归问题或发现你已知的问题,但手动探索性测试对于发现你不知道的缺陷(如错误的需求或实现)至关重要。
Some types of testing, such as exploratory testing, usability, and accessibility testing, need to be performed by a human tester. Automated testing is only as good as automated tests. If bugs or problems are in the tests themselves, they will provide wrong results, giving false assurance to the stakeholders.
某些类型的测试,如探索性测试、可用性和可访问性测试,需要由人工测试人员执行。自动化测试的质量仅限于自动化测试本身。如果测试中存在错误或问题,它们将提供错误的结果,给利益相关者虚假的保证。
Good automation testing tests repeatable test cases which you can reproduce deterministically. It certainly reduces the amount of manual testing that a human tester would perform but does not eliminate it. Once a human tester discovers a bug, they can add automation tests to ensure that it’s caught automatically in the future.
良好的自动化测试测试可重复的测试用例,这些用例可以确定性复现。它确实减少了人工测试人员执行的手动测试量,但并未消除。一旦人工测试人员发现缺陷,他们可以添加自动化测试以确保将来自动捕获它。
561. Explain briefly how Behavioral Driven Development works?
请简要解释行为驱动开发(BDD)是如何工作的?
- 知识点: 测试 / 行为与软技能 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: behavioral | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5970 | 官方: 否 | 付费: 否
答案:
There are majorly three steps in the working of BDD. They are as follows:- - Behaviour Description: We list down the features of our application first in the feature file.
BDD的工作主要分为三个步骤。它们如下:- - 行为描述:我们首先在特性文件中列出应用程序的特性。
- Making the Step Definition file: The mapping between each step of the scenario defined in the feature file and a code of the function to be executed is stored in the steps definition file.
- Testing and running: We run the test cases to check if we pass. In general, a lot of failures are observed before achieving the final code.
562. What is a test harness in the context of Cucumber?
在Cucumber的上下文中,什么是测试脚手架?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5973 | 官方: 否 | 付费: 否
答案:
The test harness in Cucumber helps in separating the task of establishing the context and interacting with the browser from cleaning up the step definition files. It gathers the stubs, drivers, and other tools needed to enable test execution automation in testing.
Cucumber中的测试脚手架有助于将建立上下文和与浏览器交互的任务与清理步骤定义文件分开。它收集了在测试中实现测试执行自动化所需的桩、驱动和其他工具。
The following is the purpose of the test harness:- - To run a set of tests either within the framework or with the help of the test harness
测试脚手架的用途如下:- - 在框架内或借助测试脚手架运行一组测试
- To enter data into the program being tested.
- Debugging becomes more flexible and supported.
- To record the outputs of the software under test
- To keep track of the test results (pass/fail) for each test.
Aids developers in determining code coverage at the code level.
The advantages of the test harness are as follows:- - As a result of automation, productivity increases.测试脚手架的优点如下:- - 由于自动化,生产力提高。
- Improved software quality as a result of automation allows us to be more productive.
- Tests can be scheduled.
- Can handle complex conditions that testers have a hard time simulating.
563. What is the difference between RSpec and Cucumber?
RSpec和Cucumber有什么区别?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5976 | 官方: 否 | 付费: 否
答案:
RSpec and Cucumber are two examples of testing frameworks. Traditional Unit Testing is used by RSpec. It refers to the practice of testing a section of an application separately from the remaining part of the application. As a result, your model performs what it's expected to do, the controller does what it's expected to do, and so on. Both RSpec and Cucumber are used for Acceptance Testing, also known as ATDD, BDD, and other terms. The following are the major differences between RSpec and Cucumber:- - The fundamental distinction between RSpec and Cucumber is the element of business readability.
RSpec和Cucumber是测试框架的两个例子。传统单元测试由RSpec使用。它指的是将应用程序的一部分与其余部分分开测试的做法。因此,你的模型执行预期行为,控制器执行预期行为,等等。RSpec和Cucumber都用于验收测试,也称为ATDD、BDD等术语。以下是RSpec和Cucumber的主要区别:- - RSpec和Cucumber之间的根本区别在于业务可读性的元素。
- Unit testing is the primary purpose of RSpec. Cucumber, on the other hand, is primarily utilized in behavior-driven development. It can be used for System and Integration Testing as well.
- Cucumber separates the specs or features from the test code, allowing product owners to provide or review the specification without having to walk through the code.
- RSpec includes a similar method, but instead of elaborating a step with a Describe, it executes the statement using the business specification. This method is easier for developers to use, but a little more difficult for non-technical people.
564. Difference between Selenium and Cucumber.
Selenium和Cucumber的区别。
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5979 | 官方: 否 | 付费: 否
答案:
Open-source testing tools, Selenium and Cucumber are both used for functional testing. However, there are some distinctions between them.
开源测试工具Selenium和Cucumber都用于功能测试。然而,它们之间存在一些区别。
Here are some key distinctions between Selenium and Cucumber: - Cucumber is a behavior-driven development automation tool that may be used with Selenium. Selenium is a web browser automation tool for web projects (or Appium).
以下是Selenium和Cucumber之间的一些关键区别:- Cucumber是一种行为驱动开发自动化工具,可以与Selenium一起使用。Selenium是用于Web项目(或Appium)的Web浏览器自动化工具。
- Cucumber is used for acceptance testing, while Selenium is used for automated UI testing.
- Technical teams (SDETs/programmers) favour Selenium, while non-technical teams often choose Cucumber (business stakeholders and testers).
- Cucumber isn't required for Selenium to work. Cucumber's step-definition implementation is based on Selenium or Appium.
- The script creation with Selenium is complicated, whereas Cucumber is straightforward.
565. Why do we need to use Cucumber with Selenium?
为什么我们需要将Cucumber与Selenium一起使用?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba597c | 官方: 否 | 付费: 否
答案:
Cucumber and Selenium are two widely used testing frameworks and technologies. Selenium is widely used for functional testing in many organizations. These companies use Cucumber in conjunction with Selenium because Cucumber makes the application flow easier to read and comprehend. The most important advantage of combining Cucumber and Selenium is that it allows developers to build test cases in simple feature files that managers, non-technical stakeholders, and business analysts can understand. It allows you to develop tests in Gherkin, a human-readable programming language. Java,.NET, PHP, Python, Perl, and other programming languages are supported by the Selenium-Cucumber framework.
Cucumber和Selenium是两种广泛使用的测试框架和技术。Selenium在许多组织中广泛用于功能测试。这些公司将Cucumber与Selenium结合使用,因为Cucumber使应用程序流程更易于阅读和理解。结合Cucumber和Selenium最重要的优点是,它允许开发人员用简单的特性文件编写测试用例,这些文件可以被经理、非技术利益相关者和业务分析师理解。它允许你使用Gherkin(一种人类可读的编程语言)开发测试。Java、.NET、PHP、Python、Perl等编程语言都由Selenium-Cucumber框架支持。
566. In a feature file, what is the maximum number of scenarios?
在特性文件中,场景的最大数量是多少?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba597f | 官方: 否 | 付费: 否
答案:
A feature file in Cucumber can include a maximum of 10 scenarios. This quantity can differ from one project to the next and from one organization to the next. It's advisable to keep the number of scenarios in the feature file to a minimum.
Cucumber中的特性文件最多可以包含10个场景。这个数量可能因项目和组织而异。建议将特性文件中的场景数量保持在最低限度。
567. What do you mean by Test Driven Development (TDD)?
你说的测试驱动开发(TDD)是什么意思?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5982 | 官方: 否 | 付费: 否
答案:
TDD is an abbreviation that stands for Test-Driven Development. This is a development practice in which the test cases are created first, followed by the code that underpins the test cases. TDD may also be used to construct automation testing. TDD takes longer to develop due to the fact that it finds fewer flaws. The TDD development practice has increased the quality of code, which is more reusable and flexible as a result. TDD also aids developers in achieving high test coverage, ranging from 90% to 100%. The sole disadvantage of TDD for developers is that they must build test cases before producing code.
TDD是Test-Driven Development(测试驱动开发)的缩写。这是一种开发实践,先创建测试用例,然后是支撑测试用例的代码。TDD也可用于构建自动化测试。由于发现缺陷较少,TDD开发所需时间更长。TDD开发实践提高了代码质量,使代码更加可重用和灵活。TDD还帮助开发人员实现高达90%至100%的高测试覆盖率。TDD对开发人员的唯一缺点是必须在编写代码之前构建测试用例。
The following is a list of the TDD methodology's basic six-step process: - First, all the test cases are written. Based on your requirements, you must create an automated test case.
以下是TDD方法论基本六步流程的列表:- 首先,编写所有测试用例。基于你的需求,你必须创建自动化测试用例。
- Carry out all of the tests: Carry out these automated test cases on the code that has been developed so far.
- Modify the code for that test case: You must develop the code to make that test casework as intended if it fails throughout this step.
- Rerun the test cases: Now you must rerun the test cases to ensure that all of the previously developed test cases have been implemented.
- Modularize your code as follows: This is a step that can be skipped. However, refactoring your code to make it more readable and reusable is recommended. That is why it is necessary.
- For new test scenarios, repeat steps 1–5: This is the final phase in the process. You must now repeat the process for the remaining test cases till all of them have been implemented.
568. Difference between TDD and BDD.
TDD和BDD之间的区别。
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5985 | 官方: 否 | 付费: 否
答案:
| TDD | BDD |
|---|---|
| Test-Driven Development (TDD) is a method of developing software that is driven by tests. This means that the developers must first write the test cases before writing the code. 测试驱动开发(TDD)是一种由测试驱动的软件开发方法。这意味着开发人员必须先编写测试用例,然后才能编写代码。 | BDD is an acronym for behavior-driven development. It's a behavior-based development approach. BDD是行为驱动开发(Behavior-Driven Development)的缩写。它是一种基于行为的开发方法。 |
| TDD tests are developed in a variety of programming languages, including Java,.NET, Python, Ruby, and others. TDD测试用多种编程语言开发,包括Java、.NET、Python、Ruby等。 | Given-When-Then steps are used to write BDD tests in a human-readable fashion. Non-technical people may read and comprehend these tests as well. 使用Given-When-Then步骤以人类可读的方式编写BDD测试。非技术人员也可以阅读和理解这些测试。 |
| The scope is the key distinction between TDD and BDD. TDD is a development methodology. 范围是TDD和BDD之间的关键区别。TDD是一种开发方法论。 | BDD, on the other hand, is a collaborative methodology. 另一方面,BDD是一种协作方法论。 |
| When a test fails because the specified function does not exist, TDD recommends writing the simplest code possible to pass the test, then reworking to remove duplication, and so on. 当测试因指定函数不存在而失败时,TDD建议编写最简单的代码以通过测试,然后重构以消除重复,以此类推。 | Creating an executable specification that fails because the feature isn't available, then writing the simplest code possible to make the spec pass in BDD. This process is repeated until a release candidate is ready to be delivered. 在BDD中,创建因功能不可用而失败的可执行规范,然后编写最简单的代码使规范通过。重复此过程,直到准备好交付候选版本。 |
| The test cases are written by the developers in TDD. 在TDD中,测试用例由开发人员编写。 | Users or testers write automated specifications in BDD, which are then wired to the code under test by developers. 在BDD中,用户或测试人员编写自动化规范,然后由开发人员将这些规范连接到被测代码。 |
| Because TDD tests are written in specific programming languages, they are difficult to interpret by non-programmers. 由于TDD测试是用特定编程语言编写的,因此非程序员难以理解。 | Non-programmers can read BDD tests since they are written in a human-readable format. 非程序员可以阅读BDD测试,因为它们以人类可读的格式编写。 |
569. What is the use of the Options tag in the Cucumber Framework?
在Cucumber框架中Options标签的用途是什么?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5988 | 官方: 否 | 付费: 否
答案:
The Options tag is a part of the TestRunner file in the Cucumber framework, and it takes the form of an annotation named @CucumberOptions.
Options标签是Cucumber框架中TestRunner文件的一部分,其形式为名为@CucumberOptions的注解。
It has two parameters: glue and feature:
它有两个参数:glue和feature:
Feature: The path to the feature file is specified by the feature option. 2. Glue: The glue argument is used to provide the step definition file's location.
- Feature:feature选项指定特性文件的路径。 2. Glue:glue参数用于提供步骤定义文件的位置。
Example:
示例:
import org.junit.runner.RunWith;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import cucumber.api.junit.Cucumber;
@RunWith (Cucumber.class)
@RunWith (Cucumber.class)
@CucumberOptions (
@CucumberOptions (
features = "src/test/Sample/features ",
features = "src/test/Sample/features ",
glue = {"StepDefinitionFile"}
glue = {"StepDefinitionFile"}
)
public class SampleTestRunner {
public class SampleTestRunner {
}
570. How does the execution start in Cucumber?
Cucumber 中的执行是如何开始的?
- 知识点: 测试 / 行为与软技能 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: behavioral | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba598b | 官方: 否 | 付费: 否
答案:
Cucumber execution will begin at the support level. In support, it will first load the env.rb file, then hooks.rb, and last start executing feature file scenario steps.
Cucumber 的执行将从支持层开始。在支持层中,它首先会加载 env.rb 文件,然后是 hooks.rb,最后开始执行功能文件的场景步骤。
571. What is grouping in the context of Cucumber?
在 Cucumber 的上下文中,分组是什么?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba598e | 官方: 否 | 付费: 否
答案:
Cucumber is unconcerned about the names of your step definition files or the order in which you place them. Instead of maintaining all steps in a single file, we can create steps.rb file for each major action/feature. This is referred to as grouping.
Cucumber 不关心步骤定义文件的名称或放置顺序。与其将所有步骤保存在单个文件中,我们可以为每个主要操作/功能创建 steps.rb 文件。这被称为分组。
572. How can you run Cucumber tests parallelly?
如何并行运行 Cucumber 测试?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5991 | 官方: 否 | 付费: 否
答案:
The Cucumber JVM Parallel Plugin, which may be used with Serenity BDD, can be used to conduct parallel tests in Cucumber. The plugin will look in the src/test/resources directory for feature files. After that, it will create runners for each file.
Cucumber JVM 并行插件(可与 Serenity BDD 一起使用)可用于在 Cucumber 中执行并行测试。该插件会在 src/test/resources 目录中查找功能文件。之后,它会为每个文件创建运行器。
573. What are some of the prerequisites that you should consider while building a Selenium Cucumber automation application?
构建 Selenium Cucumber 自动化应用程序时,应考虑哪些先决条件?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5994 | 官方: 否 | 付费: 否
答案:
We consider the following before building a Selenium Cucumber automation application:- - Determine the type of application you'll be testing. Is it a Web app, a mobile app, or a desktop application?
在构建 Selenium Cucumber 自动化应用程序之前,我们需考虑以下事项:- - 确定你要测试的应用程序类型。是 Web 应用、移动应用还是桌面应用?
- Is there a need for backend testing? Databases or SDKs, for example.
- Is it necessary to run the app through an internationalization test?
- It must include a report that allows you to track down a problem with minimal effort.
- It must be able to generate parametrization tests automatically.
- Any setup-related settings or global attributes should be defined in a config file.
- To segregate the functionality, use abstraction at every level.
574. Difference between JBehave and Cucumber.
JBehave 和 Cucumber 之间的区别。
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba5997 | 官方: 否 | 付费: 否
答案:
Despite the fact that Cucumber and JBehave have the same goal in mind, acceptance tests are two quite distinct frameworks: - Cucumber is built on Ruby, while JBehave is a pure Java Framework.
尽管 Cucumber 和 JBehave 的目标相同,但验收测试是两个截然不同的框架: - Cucumber 基于 Ruby 构建,而 JBehave 是纯 Java 框架。
- Cucumber is built on features, whereas JBehave is based on stories.
575. How can you run a selected test from a group of tests in Cucumber?
如何在 Cucumber 中从一组测试中运行选定的测试?
- 知识点: 测试 (主题: cucumber, bdd, testing;标签: interviewbit, cucumber, topic-specific, bdd, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37a5858d557c902ba599c | 官方: 否 | 付费: 否
答案:
We may execute a single test from a set of tests in the Cucumber framework using the tags idea. This is found in the TestRunner file's @CucumberOptions section. With the use of the @t keyword, we may tag a scenario in the feature file. A scenario can have one or more tags within the feature file. We can separate test scenarios with the assistance of tagging. We must pass the value within the tags argument to execute a selected test in Cucumber, and we must pass the value within the tags parameter to exclude a test from running.
在 Cucumber 框架中,我们可以使用标签概念从一组测试中执行单个测试。这位于 TestRunner 文件的 @CucumberOptions 部分。通过在功能文件中使用 @t 关键字,我们可以标记一个场景。场景可以在功能文件中具有一个或多个标签。借助标签,我们可以分离测试场景。要在 Cucumber 中执行选定的测试,我们必须在 tags 参数中传递 值,并且必须传递 值在 tags 参数中,以排除测试运行。
Conclusion:
结论:
Cucumber is frequently used in BDD because it is an open-source technology. It's also quite simple to grasp, has a lot of room for additional features, and it's rather easy to connect Cucumber with Selenium or other third-party tools/jars, etc. It is quite easy for anyone who has just started learning Cucumber or for those who have intermediate experience in Cucumber/BDD because it has active help groups/members. Cucumber also allows for connectivity with an excel sheet and Jenkins.
Cucumber 在 BDD 中经常使用,因为它是一项开源技术。它也非常易于理解,具有很大的扩展空间,并且将 Cucumber 与 Selenium 或其他第三方工具/库等连接起来相当容易。对于刚开始学习 Cucumber 或对 Cucumber/BDD 有一定经验的人来说,它相当简单,因为它有活跃的帮助小组/成员。Cucumber 还支持与 Excel 表格和 Jenkins 的连接。
Recommended Resources and References: - Cucumber Documentation
推荐资源和参考: - Cucumber 文档
- Automation Testing
- Selenium WebDriver
- Robot Framework
576. State difference between ETL testing and manual testing.
ETL测试与手动测试之间的状态区别。
- 知识点: 测试 / 数据工程与数据科学/AI (主题: etl, testing;标签: interviewbit, etl-testing, topic-specific, etl, testing)
- 类型: technical | 难度: hard | 子类型: concept
- 分类: fullstack
- id: 69b37aec58d557c902bab3e7 | 官方: 否 | 付费: 否
答案:
| ETL Testing ETL测试 | Manual Testing 手动测试 |
|---|---|
| The test is an automated process, which means that no special technical knowledge is needed aside from understanding the software. 测试是一个自动化过程,这意味着除了理解软件外,不需要特殊的技术知识。 | It requires technical expertise in SQL and Shell scripting since it is a manual process. 它需要SQL和Shell脚本方面的技术专长,因为它是一个手动过程。 |
| It is extremely fast and systematic, and it delivers excellent results. 它极其快速且系统化,并能提供出色的结果。 | In addition to being time-consuming, it is highly prone to errors. 除了耗时外,它还极易出错。 |
| Databases and their counts are central to ETL testing. 数据库及其计数是ETL测试的核心。 | Manual testing focuses on the program's functionality. 手动测试侧重于程序的功能性。 |
| Metadata is included and can easily be altered. 包含元数据,且可以轻松更改。 | It lacks metadata, and changes require more effort. 它缺乏元数据,更改需要更多努力。 |
| It is concerned with error handling, log summary, and load progress, which eases the developer's and maintainer's workload. 它关注错误处理、日志摘要和加载进度,这减轻了开发者和维护者的工作量。 | From a maintenance perspective, it requires maximum effort. 从维护角度来看,它需要最大程度的努力。 |
| It is very good at handling historical data. 它非常擅长处理历史数据。 | As data increases, processing time decreases. 随着数据增加,处理时间会减少。 |
评论