1. What design patterns are used in automated code? A: Design patterns used to automate code:

① Singleton design pattern;

② Factory model;

③PO design mode;

(4) Data-driven mode;

(5) Interface oriented programming design mode.

Selenium is an open source Web testing automation framework that supports the development of automated test scripts in multiple programming languages and cross-browser testing.

3. What are annotations in TestNG? A: @test, @beforeSuite, @AfterSuite, @beforeTest, @AfterTest, @beforeClass, @afterClass, @beforeMethod, @AfterMethod, @dataProvider.

4. What is assertion? A: Assert is used to verify in your code that the actual result meets the expected result, throwing an exception and providing an assertion log if the test case fails.

5. What’s good about TestNG? A: TestNG annotations are powerful and convenient. TestNG allows for parallel testing and group execution of tests. TestNG also allows you to generate test reports and display a variety of reports on top of which you can develop test report plug-ins and test listeners.

6. What is Web automation testing? A: Web automated testing refers to automated testing at the UI (user interface) level, where testers test the business logic of a web site by opening a browser through programming automation (test case scripts).

Write down the interfaces or classes in Selenium that you are most familiar with. A: webDriver, lnternetExplorerDriver, FirefoxDriver, ChromeDriver, WebElement, WebDriverWait, By.

What are the element positioning types? A: There are eight methods of element positioning in the By class, all of which are static methods: By id (), By the name (), By the tagName (), By the className (), By the cssSelector (), By the linkText (), By the partialLinText (), By the xpath ().

9. Is there any other way to click the login button besides click? A: You can also use the submit () method if the type of the input element is submit.

10, how to automate the test of functions containing verification codes? A:

1) Image recognition, technical difficulty, poor effect, not recommended;

2) Shield verification, invite development processing, but not recommended in pre-production environment or production environment;

3) Universal captcha, using a captcha that no one else in charge can guess.

How do I check if the check button is selected? A: you can use the isSelected () method of the element, if it returns true it isSelected, otherwise it is not.

12, How to handle the Alert popover? A: To handle the Alert popup, you need to jump to Alert first, and then click ok or cancel button.

Alertalet=driver.switchTo().alert();

// Switch to alertalert… accept();

/ / determine alert. Dismiss (); / / cancel

How to use WebDriver to right click the mouse operation? A: Use the Actions class

Actionsactions=newActions(driver);

actions.moveToElement(element).perform();

actions.contextClick().perform();

What is an example of method overloading in webDriver? A: Frame (StringNama),frame(intIndex), Frame (WebElementelement)

15, how to select a menu item in the drop-down menu? A: If the drop-down menu is a Select TAB, use the following method:

SelectByValue () or selectBylndex() or selectByVisibleText(). If the drop-down menu is not created using the Select tag, you can locate the elements directly by xpath and click select.

The following is my automation for the technology of some induction and summary, I hope to help the heart of the technology on the road to go all the way to black friends! With tutorial learning materials ~

These materials should be the most comprehensive and complete preparation warehouse for those who do [software testing]. This warehouse also accompanied me through the most difficult journey. I hope it can also help you! Everything should be done as early as possible, especially in the technology industry, we must improve our technical skills.

Follow my wechat official number: [Sad Latiao] free ~

My learning exchange group: 902061117 group of technical cattle to communicate and share ~

If my blog is helpful to you, if you like my blog content, please “like” “comment” “favorites” one key three even oh!