1. What is design pattern?

Design Patterns represent the best practices used by  experienced  software developers.
Design patterns are solutions to general problems that software developers faced during software development. Structural patterns and behavioral patterns.

设计模式是有经验的软件工程师的最佳实践。设计模式是大部分软件工程师所面临的大部分问题的解决方案。


          1. Why do we need design pattern in our test suite?

Code reusability. It allowing the tester to enhance reliability. Helping us to create a structured code that eases our process of automation. It helps in improving communication.
使用设计模式可以让增加code 的复用性。它可以帮助tester来增加他的可靠性。帮助我们来创建一个结构性的code来降低我们的自动化成本.

        1. What are the different design patterns for automated tests?

      1. page object pattern
      2. facade design pattern
      3. singleton design pattern
      4. fluent page object pattern
      5. strategy design pattern

            1. What is page object model (or POM)?

  1. Page Object Model (POM) is a design pattern, popularly used in test automation that creates Object Repository for web UI elements. The advantage of the model is that it reduces code duplication and improves test maintenance.

    Under this model, for each web page in the application, there should be a corresponding Page Class. This Page class will identify the WebElements of that web page and also contains Page methods which perform operations on those WebElements.

POM 是一种设计模式,在测试自动化中普遍使用,为网络UI元素创建对象库。这种模式的优点就是降低了了代码的重复量和提高了测试维护。在这种模式下,每一个page都有对应的page class。这个page class 将用来识别页面中的元素。已经包括对页面的执行操作。



          1. What is "synchronization" problem in Selenium?

During automated testing of websites, issues may occur due to variations in time lag for loading web elements. wait commands help observe and troubleshoot these issues.
when a page loads on a browser, various web elements on it with may load at different time intervals. Wait commands direct a test script to pause for a certain time before throwing a Element not visible exception.

Impliciti wait directs the selenium webdriver to wait for the entire duration for which the browser is open. It's default setting is 0, and the specific wait time needs to be set by the following protocol. However ,implicit wait increase test script execution time. it makes each command wait for the defined time before resuming test execution.
然而,隐式等待增加了测试脚本的执行时间。它使每条命令在恢复测试执行之前都要等待规定的时间。
Explicit Wait: Explicit waits are very good to use when page loads dynamically. Explicit Wait tells the WebDriver to Wait until the specified condition is met or maximum time elapses before throwing NoSuchElement (or) ElementNotVisible Exceptions.

https://www.ecanarys.com/Blogs/ArticleID/326/What-is-Synchronization-Handling-Synchronization-in-Selenium-WebDriver-using-C





Comments

Popular posts from this blog