Automated test interview questions and answers

What is automated testing? What does automated testing learn? Automated test interview questions and answers?-Hang the interviewer after reading!

I. Introduction

I recently complained about children's shoes and said that it is difficult to find those comprehensive and suitable automated test interview questions online. Here is based on my personal experience and collection:

You read right, don't panic, take your time.

Let's start with what is automated testing!

2. What is automated testing?

What is automated testing?

When I first learned about automated testing, I knew nothing about automated testing except for the three "automated" titles, which are just like falling in love. Just like falling in love, you need to know who she is before finding a girlfriend .

Automatic testing is a process that transforms human-driven testing into machine execution. It is a process of testing programs with programs. Wordy! Then ...

3. What skills do you need to learn for automated testing?

This is what I wrote before. I can learn more about the skills that the automated test siege lion needs to learn in 2020!


4. The most complete automated test interview questions and answers for the entire network in 2020, the original dry goods are here

1. Will you encapsulate the automated testing framework?

This is the most asked, and many companies even write directly in the recruitment requirements!

Of course, the main core framework of the automation framework is layered + PO mode: respectively: the basic encapsulation layer BasePage, PO page object layer, TestCase test case layer. Then add log processing module, ini configuration file reading module, unittest + ddt data drive module, and Jenkins continuous integration mode.

2. How to implement and promote automated testing in the company?

1. The project team researched and selected automation tools and met to demonstrate demo cases. We mainly demonstrated two types of selenium and robotframework.

2. Build an automated testing framework and gradually implement automation in the project.

3. Curing the project's automation process and framework into documents

4. Promote the application to other project groups of the company

3. Please describe the automated testing process?

1. Write an automated test plan

2. Design automated test cases

3. Write automated testing frameworks and scripts

4. Debug and maintain the script

5. Unattended test

6. Post script maintenance (add use cases, develop updated versions)

4. How to write automated test cases? Choose one of the following answers:

1. The use case is designed by the automation test engineer. Generally, the basic business process is the beginning (login-complete a business-exit)

2. Screen from system test cases or provided by business engineer

5. Execution strategy of automated testing in the previous project?

The last project was executed regularly. The set execution time is 12 o'clock in the evening. After the execution is completed, an email notification will be sent automatically.

6. Did the automated test find more bugs?

Not many, because the previous project team used the basic functions that have passed the test to automate scripting and execute automated tests in subsequent versions. It mainly ensures that the functions that have passed the test will have no problems after the new version is updated.

7. What is the value of automated testing? Why is your company doing automated testing?

After citing automated testing, it can replace a lot of tedious regression testing work and liberate business testers, so that business testers can focus on complex business function modules. Automated testing generally automates stable functions to ensure There will be no bugs in previously stabilized functions due to product updates

8. Have there been any false positives in automated testing? What should I do if a false alarm occurs?

There have been false positives. Sometimes the automated test report shows that a bug was found. Actually, go through manual testing to confirm that the bug does not exist.

The reasons for false positives are generally:

1. Element positioning is unstable, and the stability of the script needs to be improved as much as possible;

2. The development updated the page but the test was not updated and maintained in time!

9. During the automated testing process, what problems did you encounter and how to solve them?

1. Frequently change the page, often modify the code in the page object class

2. Automated testing has occasionally had false positives

3. The results of automated test coverage: Jenkins creates folders based on time

4. Automatic test code maintenance is more troublesome

5. Automated testing to compare database data

10. What framework does the last company use for automated testing?

You can name one of the following:

1.python+selenium+unittest+htmltestrunner

2.python+selenium+pytest+allure

3. robotframework+Selenium2Library

11. Does your automation team have its own group?

Of course there are: The group number we use is: 695458161 There are many software testing and automation gods to solve the problems in the project, and free materials will be issued from time to time.

12. In selenium automated testing, what type of testing do you generally complete? Automated coverage?

It is mainly smoke test and regression test. Regression testing mainly writes some scenarios with stable functions, which are realized by automated means, saving test time. Because automated test cases are also constantly updated and iterated, there is no deliberate statistics, about 30% -40%!

13. During the execution of the script, how to highlight the current element?

This is actually using javaScript to modify the border style of the current element to achieve the highlighting effect,

14. If an element cannot be located, what are the reasons you would generally consider?

1. The page load element is too slow, plus waiting time

2. The page has a frame frame page, you need to jump into the frame frame before positioning

3. It may be that the element is a dynamic element, and the positioning method should be optimized. You can use some element positioning or through the parent node or sibling node.

4. The element may be recognized, but it cannot be operated, such as the element is unavailable and cannot be written. Need to use js to complete the pre-operation,

15. What are the elements positioning methods you are familiar with?

id name classname link_text css xpath

16. How to deal with frame frame page?

First use driver.switch_to.frame () to jump into the frame,

Then manipulate the page elements,

After the operation, use driver.swith_to.default_content () to jump out

17. How to deal with the alert pop-up window?

Use the driver.switch_to.alert method to jump to the alert popup first

Then click the OK button through accept, click the dismiss to cancel the difficulty, and get the text of the pop-up window through text ().

18. How to deal with multiple windows?

This jump processing between multiple windows, we often encounter in the project. That is, when you click on a link, the link will open in a new tab, and then you will find the element on the page opened by the new tab

1. We use driver.current_window_handle to get the current window handle before clicking the link.

2. Click the link again. Click to get all window handles through driver.window_handles

3. Then recycle to find the handle of the new window, and then jump to the new window by driver.switch_to.window ()

19. How to verify that the element is enabled / disabled / checked?

After positioning the element: judge by three methods: isEnabled (), isSelected (), and isDisplayed ().

20. How to handle the drop-down menu?

In Selenium, there is a class called Select, which supports operations on drop-down menus. The method of use is as follows:

1. Positioning elements

2. Convert the positioned elements into Select objects.

sel = Select (positioned element object)

3. Select the drop-down box by subscript or value or text.
sel.select_by_index (index);
sel.select_by_value (value);
sel.select_by_visible_text (text);

21. How do you handle web forms like calendars?

First, we must analyze the front-end code of the current webpage trial calendar plug-in to see if it can be located by element and click the date. If not, you may need to use javascript. There are also calendar controls with a text input box, which can be directly sentKeys () method to achieve the incoming data of a time.

22. Give an example to explain what exceptions you have encountered

Common selenium exceptions are these:

NoSuchElementException: No such element exception
TimeoutException: Timeout exception

ElementNotVisibleException: Element invisible exception
NoSuchAttributeException: No such attribute exception
NoSuchFrameException: No frame exception

23. Close the difference between quit and close in the browser

To put it simply, both can quit the browser session function, close is to close the tab page you are currently focused on, and quit is to close all browser tab pages and quit the browser session. Knowing the difference between these two, we know that quit is generally used before the end of the test, and close is used to close a page during the use case.

24. How to take a screenshot in Selenium, and how to take a screenshot if the use case fails to execute

Selenium provides a get_screenshot_as_file () method to take screenshots. It is generally used in conjunction with try / except to catch exceptions to take error screenshots.

25. How to upload files?

After locating the element, just use the send_keys () method to set it. The parameter is the path of the file to be uploaded.

26. What are the three types of waiting in automation? What are their characteristics?

1. Thread wait (forced wait) such as time.sleep (2): the thread is forced to sleep for 2 seconds, and after 2 seconds, the subsequent code is executed. It is recommended to use less.

2. imlicitlyWait (implicit waiting) will continue to search for elements within the specified time range until it finds the element or times out, the feature is that it must wait for the entire page to load.

3. WebDriverWait (explicit wait) is usually a custom function code, this code is used to wait for an element to load, and then continue to execute subsequent code

27. Can the test script you write run on different browsers?

Of course, the use case I wrote can be run on three browsers: IE, Firefox and Google. The idea of ​​implementation is to encapsulate a method, passing in a browser string respectively, using IE if passing in IE, using FireFox if passing in FireFox, using the Chrome browser if passing in Chrome, and what browser can be used Configure in the overall ini configuration file. It should be noted that the driver used by each browser is different.

28. What is PO mode and why use it

PO is the abbreviation of Page Object mode. It is a design idea, which means that a page is treated as an object, and the operation method between the elements of the page is the attributes and behavior of the page object. , Respectively: basic encapsulation layer BasePage, PO page object layer, TestCase test case layer.

5. I wish you a successful interview, please give your OFFER, please accept it!

Finally, I wish every job seeker can find his wish job! Immediately achieve promotion and salary increase!

 

 

This article is reproduced from the Zhuge Zhuge: https://zhuanlan.zhihu.com/p/133325731

Guess you like

Origin www.cnblogs.com/mrjade/p/12737889.html