3 rounds of technology, 1 round of HR, byte 27Koffer in hand....

Interviews are generally divided into technical interviews and hr interviews. In terms of format, there are few group interviews, and a small number of companies may have a cross interview. But in general, the technical interview is basically to examine your professional technical level, and the hr interview is mainly for interviews. It depends on whether the person's overall quality and family situation meet the company's requirements. Generally speaking, as long as you pass the technical HR interview, there is basically no problem with the technology (there are also a few companies that will interview many people in the HR interview)

We mainly talk about the technical aspect, and the technical aspect is mainly to examine the professional technical knowledge and level. The following are the interview questions for the automated testing post that we have sorted out.

1. Can the test script you write run on different browsers
? Of course, the use cases I wrote can run on the three browsers of IE, Firefox and Google. The idea of ​​implementation is to encapsulate a method and pass in a browser string respectively. If it is passed in IE, use IE, if it is passed in FireFox, it will use FireFox, if it is passed in Chrome, it will use Chrome browser, and what browser can be used Configure in the general ini configuration file. It should be noted that the drivers used by each browser are different.

2. What is PO mode and why should it be used?
PO is the abbreviation of Page Object mode. It is a design concept, which means that a page is regarded as an object, and the operation method between the elements of the page is the page object. Attributes and behaviors, the PO mode generally uses a three-layer architecture, which are: the base encapsulation layer BasePage, the PO page object layer, and the TestCase test case layer.

3. Can you encapsulate the automated testing framework?
This question is the most frequently asked, and even many companies directly uninstall the recruitment requirements

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

4. How to deal with the alert pop-up window?
Use the driver.switch_to.alert method to jump to the alert pop-up window first

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

5. How to deal with multi-window?
This multi-window jump processing is often encountered in projects. That is, when you click a link, the link will be opened in a new tab, and then you need to find elements on the page opened in 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. After clicking, get the handles of all windows through driver.window_handles,

3. Then loop to find the handle of the new window, and then jump to the new window through the driver.switch_to.window() method.

6. How to verify that the element is enabled/disabled/checked?
After locating the element: judge by three methods: isEnabled(), isSelected(), and isDisplayed() respectively.

7. Are there many bugs found in automated testing?
Not many, because the project team used to write automated scripts for the basic functions that have been tested 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.

8. What do you think is the value of automated testing? Why does your company need automated testing?
After citing automated testing, it can replace a large number of tedious regression testing tasks, liberate business testers, and allow business testers to concentrate on complex business function modules. Automated testing generally automates stabilized functions to ensure There will be no bugs in previously stabilized functions due to product updates

9. Has automated testing ever falsely reported bugs? What about false positives?
There have been false positives. Sometimes the automated test report shows that a bug has been found, but the actual bug does not exist through manual testing.

Common reasons for false positives are:

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 did not update and maintain in time!

1. How to implement and promote automated testing in the company?
1. The project team researches and selects automation tools and holds a meeting to demonstrate demo cases. We mainly demonstrate selenium and robotframework.

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

3. Solidify the automation process and framework of the project into documents

4. Promote to other project team applications of the company

10. Please describe the automated testing process?
1. Write an automated test plan

2. Design automated test cases

3. Write automated test frameworks and scripts

4. Debug and maintain the script

5. Unattended testing

6. Later script maintenance (adding use cases, developing updated versions)

11. How to write automated test cases? You can choose one of the following answers:
1. The use case is designed by the automation test engineer himself. Generally, the basic business process is the main one at the beginning (login-complete a business-exit)

2. Screened from system test cases or provided by business engineers

12. Execution strategy for automated testing in the previous project?
In the previous project, it was executed regularly, and the set execution time was 12 o'clock in the evening. After the execution was completed, an email notification would be sent automatically

13. During the automated testing process, what problems did you encounter and how did you solve them?
1. Change the page frequently, and often need to modify the code in the page object class

2. Occasional false positives in automated testing

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

4. Automated test code maintenance is more troublesome

5. Automated testing for database comparison data

14. What framework did you use for automated testing in the last company?
You can name one of the following:

1.python+selenium+unittest+htmltestrunner

2.python+selenium+pytest+allure

3. robotframework+Selenium3

15. In selenium automation testing, what type of testing do you generally complete? Automated coverage?

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

16. How to highlight the current element during script execution?
This is actually using javaScript to modify the border style of the current element to achieve the highlighting effect.

17. If an element cannot be positioned, what reasons do you generally consider?
1. Page loading elements are too slow, adding waiting time

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

3. The element may be a dynamic element, and the positioning method needs to be optimized. You can use some elements to locate or locate through parent nodes or sibling nodes.

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

18. What element positioning methods are you familiar with? (Eight element positioning methods)
id, name, class, tag, link_text, Partial link text, css, xpath

19. How to deal with the frame page?
First use driver.switch_to.frame() to jump into the frame,

Then operate the page elements,

Use driver.swith_to.default_content() to jump out after the operation

20. How to handle the drop-down menu?
There is a class called Select in Selenium, which supports the operation of drop-down menus. The method of use is as follows:

1. Positioning elements

2. Convert the positioned element into a Select object.

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 deal with the web form of the calendar?
First, analyze the front-end code of the calendar plug-in on the current web page to see if it can be realized by element positioning and clicking on the date. If not, you may need to use javascript. There are also some calendar controls that have a text input box, and the sendKeys() method can be used to directly pass in a time data.

22. Give an example to explain the exceptions you have encountered.
Common selenium exceptions include these:

NoSuchElementException: No such element exception
TimeoutException: Timeout exception

ElementNotVisibleException: The element is not visible exception
NoSuchAttributeException: No such attribute exception
NoSuchFrameException: No such frame exception

23. Close the difference between quit and close in the browser.
Simply put, both of them can realize the function of exiting the browser session. Close is to close the tab page you are currently focusing on, and quit is to close all browser tab pages and exit the browser. session. Knowing these two differences, we know that quit is generally used before the end of the test, and close is used to close a certain page during the execution of the use case.

24. How to implement screenshots in Selenium, and how to implement screenshots only when use case execution fails.
Selenium provides a get_screenshot_as_file() method to capture screenshots. It is generally used in combination with try/except to capture exceptions and take error screenshots.

25. How to implement file upload?
After locating the element, just use the send_keys() method to set it directly, and 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 waiting (forced waiting) 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. ImplicitlyWait (implicit wait) will continue to search for elements within the specified time range until the element is found or timed out. The characteristic is that it must wait for the entire page to load.

3. WebDriverWait (explicit wait) is usually a function code that we customize. This code is used to wait for an element to be loaded before continuing to execute subsequent codes.

27. How does your testing team improve their testing skills?

It relies more on technical discussions and learning exchanges. In addition to our company's internal groups, we will also have related technical exchange groups, where we can learn with many peers and improve our skill tree. The technology update iteration of the IT industry is inherently fast, so it is even more necessary to maintain a learning attitude.

Interview question arrangement :

For the above knowledge points, after a long period of sorting out, documents and explanation videos have been formed, and some screenshots are given below:

 

This document should be of great help to friends who are interviewing this year . I hope everyone can receive a satisfactory offer. If you find it useful, remember to like and save it. Click on the small card below to share. 

Guess you like

Origin blog.csdn.net/kk_lzvvkpj/article/details/130565565