[Software Testing Interview Questions] compiled by veterans, a summary and analysis of real interview questions from first-tier manufacturers...


Preface

1. Interview type

Online interview:

  • video interview
  • Phone interview

Offline interview:

  • company interview

Interview questions:
①Technical questions

  • function test
  • automated test
  • Performance Testing
  • app automated testing
  • ui automated testing
  • Interface automated testing

②Personnel issues

Pen questions:

  • python basic questions
  • Operating system Linux common commands
  • Database related issues
  • Test theory and methods
  • Main types of questions in written examinations
  • Algorithm questions, multiple choice questions, judgment questions, question and answer questions

2. Review of recent interview questions

1) If the front-end interface changes, it will affect the back-end interface use cases. For example, if there are 20 use cases in the back-end, how will you solve it?

If the front interface will affect the rear interface, first confirm the changes in the front interface
and then analyze its impact on the rear interface based on the content of the change.

If the change is small, you only need to modify the affected parts of the rear interface.

If the change is large, it may be necessary to redesign and write back-end interface use cases.
Make corresponding adjustments and modifications as soon as possible.

2) How do you mostly position UI automation? What to do when an element cannot be located?

8 major positioning methods

id
class
xpath
css
link text
partial link text
tag name
name

The element did not finish loading. Waiting, forced waiting, implicit waiting, explicit waiting 2. The element switches subpages in the iframe or frame.

Elements are disabled, readonly, invisible (hidden, style='disply:none') For some methods that WebDriver does not provide or functions that cannot be implemented, WebDriver provides the driver.execute_script() method to execute

JavaScript code. Assume that an input box can be positioned through id='text', but text content cannot be entered through send_keys(). This can be achieved with the help of JavaScript code.

text = "input text" driver.execute_script("var obj=document.getElementById('text'); obj.value' " + text + "';") 

The page jumps to a new tab page, or a warning box pops up. Select the drop-down box to switch pages, as well as switch the warning box and switch the drop-down selection box.

Dynamic attributes or dynamic DIV layers

auto-id-E7NOva6B4ky0NzK7
auto-id-JaBOLRNXdMdgx29R

# xpath中提供了三个⾮常好的⽅法来为我们定位部分属性值

driver.find_element_by_xpath ("//div[contains(@id, 'auto-id')]")
driver.find_element_by_xpath ("//div[starts-with(@id, 'auto-id')]")
driver.find_element_by_xpath ("//div[ends-with(@id, 'auto-id)]")

contains(a, b) # 如果a中含有字符串b, 则返回true,否则返回false
starts-with(a, b) # 如果a是以字符串b开头, 返回true,否则返回false
ends-with(a, b) # 如果a是以字符串b结尾, 返回true,否则返回false

scroll bar, add scroll

3) If an element is deeply nested and cannot be located using xpath, what should you do?

Try using other positioning methods, such as using css positioning method

If you still can't locate it using css, you may need to communicate with the developer to modify the structure of the html.

4) Have you encountered any serious bugs while doing automation? How to solve it?

Specific examples: elements cannot be located, page loading times out, interface returns abnormal data, etc.

Solution: First, you can investigate the cause of the problem by checking logs and error messages, and then communicate with the team and development

Analyze and solve problems together, including modifying positioning methods, increasing waiting time, retrying operations, troubleshooting interface problems, etc.

5) How do you usually check interface data?

Verify the returned status code;
verify the returned data structure;
verify the returned data content;

6) For example, some interface tokens will expire. How do you deal with them in the interface parameters?

Add logic to the automated script to first determine whether the token has expired.

If the token expires, you can re-obtain the token in the script and send the request, replacing the original token parameters.

7) What are the functions of the system under test?

Just describe it based on the modules and core businesses you are responsible for in your resume.

8) Will abnormal scenarios be considered during the trial process?

During the testing process, abnormal scenarios must be considered, because testing of abnormal scenarios often exposes the weak links of the system.

By analyzing requirements and user behavior, we will determine possible abnormal situations and write test cases for testing.

Common abnormal scenarios: entering illegal data, entering data out of range, network abnormalities, etc.

9) Have you written the complete mock yourself?

Have used mock framework for unit testing in projects

Usage and principle: During the testing process, you can create virtual objects or simulated objects as needed to
simulate the behavior of the object under test and return results for independent unit testing.

Write relevant test cases and use mock objects to verify expected behavior and results

10) Explain the flow of funds in the credit system

Finance-related projects are written in the project, and specific business scenarios will be asked:
sources of funds;
loan issuance;
repayment recovery;
interest recovery;
fund allocation;

11) Have you ever written any toolkits in code?

For example, in automated testing, I have written some encapsulated toolkits
to handle browser driver initialization, synchronization and other operations.

In interface testing, write data processing, encryption and decryption operations for processing interface requests and responses.
The main core function of the toolkit: improve testing efficiency and improve code reusability.

12) How to test systems involving third parties?

Take corresponding measures to solve the problem.
Simulate the third-party system: Use mock technology to simulate the response of the third-party system for independent testing. This method can avoid any negative impact on the third-party system.

Dependency, improves the controllability and stability of testing
Integration testing: If integration testing with actual third parties is allowed, direct access through the third-party system can be performed for end-to-end testing. This method can verify that the entire system is consistent with the third party. Whether the system interaction is normal, but attention needs to be paid to the preparation of the test environment and test data

Static analysis: Perform static analysis on the interface documents of the third-party system to understand its functions, parameters, return values, etc., and write corresponding test cases for testing.

This method is suitable for situations where direct integration with third systems cannot be achieved

13) After the user obtains the loan amount, which steps will involve the consumption of null pointer exceptions?

After the loan amount is obtained, the consumption environment involved includes:
repayment;
daily consumption;
investment;

Null pointer exception: caused by the use of null objects or null references in the code.
Check the null references in the code: before using the object, make sure that the object cannot be null.

Use judgment conditions: make judgments before execution may cause a null pointer exception to avoid null references.

Use null value processing tool classes;

14) In addition to the failure to build a good data structure for the index column, what other reasons may cause slow queries?

What are the reasons why database query data is slow?
Query conditions are too complex;
database table design is unreasonable;
database server resources are insufficient;
network delay;
database statistics are inaccurate;
trivial competition;
hard disk IO bottleneck;

15) In what ways can we optimize the slow query problem?

Optimize query statements, simplify query conditions as much as possible, and reduce the use of related tables or subqueries.

Make sure to design the database tables properly, standardize and optimize redundant fields
. Check the resource configuration of the database to ensure sufficient CPU, memory, and disk space.

Check that the network remains normal to meet latency and bandwidth requirements
. Collect and update data statistics so that the database can optimize query plans
. Adjust the lock strategy to avoid lock competition and blocking
. Check hard disk performance and optimize IO operations.

16) Problems related to the pytest framework

How to skip a use case?

Use the mark mark decorator's skip in the pytest framework to skip the use case.
Write the skip decorator above the use case. Skip
conditionally.
Skip unconditionally.

Briefly introduce the pre- and post-functions of Pytest?

The fixture decorator in pytest is often used to define pre- and post-functions.
Pre-operations: initialize data, create a test environment, and query the database.
Post-operations: perform some cleanup work, such as closing database connections, deleting test files, and closing drivers.

How to rerun test case in Pytest?

You can use the pytest plug-in repeat to implement repeated execution of the use case
. After the plug-in is successfully installed, you can add the -n 3 parameter to the command line and it can be repeated three times.

How to parameterize in pytest?

The decorator parameterize is provided in the pytest mark to implement parameterization;
the parameters of the decorator are variable names and value lists, and the use case will be automatically executed multiple times based on the list; the
formal parameters and actual parameters of the use case need to be written in parameterized brackets ;
The data type used for actual parameters is a list, nested list or tuple; the
formal parameter uses a string type;

Briefly describe the Pytest fixture fixture()

The fixture decorator in pytest is often used to define pre- and post-functions

Pre-operation: initialize data, create test environment, query database
Post-operation: perform some cleanup work, such as closing database connection, deleting test files, closing driver

The following is the most comprehensive software testing engineer learning knowledge architecture system diagram in 2023 that I compiled.

1. Python programming from entry to proficiency

Please add image description

2. Practical implementation of interface automation projects

Please add image description

3. Web automation project actual combat

Please add image description

4. Practical implementation of App automation project

Please add image description

5. Resumes of first-tier manufacturers

Please add image description

6. Test and develop DevOps system

Please add image description

7. Commonly used automated testing tools

Please add image description

8. JMeter performance test

Please add image description

9. Summary (little surprise at the end)

Although the road is bumpy, as long as you have faith, move forward bravely, and pursue your dreams, you can surpass your limits, create miracles, and become that fearless warrior who keeps making progress and never gives up.

On the stage of life, only by persistently pursuing dreams and overcoming difficulties and challenges can we gain real growth and success. Believe in yourself and move forward bravely, and you will write your own magnificent chapter.

No matter what kind of ups and downs and difficulties you encounter, as long as you have faith and persist in struggling, every effort will be one step closer to your dream. Believe in your abilities and chase bravely, and you will create your own brilliant life.

Guess you like

Origin blog.csdn.net/csdnchengxi/article/details/134877810