반응형
블로그 이미지
개발자로서 현장에서 일하면서 새로 접하는 기술들이나 알게된 정보 등을 정리하기 위한 블로그입니다. 운 좋게 미국에서 큰 회사들의 프로젝트에서 컬설턴트로 일하고 있어서 새로운 기술들을 접할 기회가 많이 있습니다. 미국의 IT 프로젝트에서 사용되는 툴들에 대해 많은 분들과 정보를 공유하고 싶습니다.
솔웅

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

카테고리


반응형

지난번 글에서 GoogleSearch 를 Page Object 를 사용해서 기능을 구현하기 위해 어떤 클래스들이 사용 됐는지 분석해 봤습니다.


PageBase.java

GoogleSearchPage.java

GoogleSearchResultPage.java

GoogleSearchSuggestPage.java

GoogleSearch_withPageObject.java


이렇게 5개의 클래스가 사용이 됐는데요.



가장 기본이 되는 PageBase.java 부터 분석해 보겠습니다.



/**
* Page Object base class. It provides the base structure
* and properties for a page object to extend.
*
* @author Chon Chung
*/
public class PageBase {
         /** Default URL */
         protected String URL;       
       
         /** This page's WebDriver */
         protected WebDriver driver;
       
         /** Expected Page Title. This will be used in isPageLoad()
         * to check if page is loaded. */
         protected String pageTitle;
       
       
         /** Constructor */
         public PageBase(WebDriver driver, String pageTitle) {
                 this.driver = driver;
                 this.pageTitle = pageTitle;
         }
       
         /**
         * Check if page is loaded by comparing
         * the expected page-title with an actual page-title.
         **/
         public boolean isPageLoad(){
                 return (driver.getTitle().contains(pageTitle));
         }
       
       
         /** Open the default page */
         public void open(){
                 driver.get(URL);
         }
       
       
         /** Returns the page title */
         public String getTitle() {
                 return pageTitle;
         }
       
         /** Returns the default URL */
         public String getURL() {
                return URL;
         }
       
         /**
         * Send text keys to the element that finds by cssSelector.
         * It shortens "driver.findElement(By.cssSelector()).sendKeys()".
         * @param cssSelector
         * @param text
         */
         protected void sendText(String cssSelector, String text) {
                        driver.findElement(By.cssSelector(cssSelector)).sendKeys(text);
         }
       
         /** Is the text present in page. */
         public boolean isTextPresent(String text){
                 return driver.getPageSource().contains(text);
         }
       
         /** Is the Element in page. */
         public boolean isElementPresent(By by) {
                        try {
                                driver.findElement(by);//if it does not find the element throw NoSuchElementException, thus returns false.
                                return true;
                        } catch (NoSuchElementException e) {
                                return false;
                        }
         }

         /**
         * Is the Element present in the DOM.
         *
         * @param _cssSelector                 element locater
         * @return                                        WebElement
         */
         public boolean isElementPresent(String _cssSelector){
                        try {
                                driver.findElement(By.cssSelector(_cssSelector));
                                return true;
                        } catch (NoSuchElementException e) {
                                return false;
                        }
         }
       

         /**
                * Checks if the elment is in the DOM and displayed.
                *
                * @param by - selector to find the element
                * @return true or false
                */
         public boolean isElementPresentAndDisplay(By by) {
                        try {                       
                                return driver.findElement(by).isDisplayed();
                        } catch (NoSuchElementException e) {
                                return false;
                        }
         }
       
         /**
         * Returns the first WebElement using the given method.        
         * It shortens "driver.findElement(By)".
         * @param by                 element locater.
         * @return                 the first WebElement
         */
         public WebElement getWebElement(By by){
                         return driver.findElement(by);                        
         }
}
/**
* Further reading:
* 1. Selenium webdriver page object:
*                 http://stackoverflow.com/questions/10315894/selenium-webdriver-page-object
* 2. Using Page Objects with Selenium and Web Driver 2.0
*                 http://www.summa-tech.com/blog/2011/10/10/using-page-objects-with-selenium-and-web-driver-20/
* 3. PageFactory
*                 http://code.google.com/p/selenium/wiki/PageFactory
*/



이 클래스에는 String 객체인 URL 과 pageTitle 그리고 WebDriver 객체인 driver 를 제일 먼저 초기화 합니다.

그리고 PageBase() 메소드를 보면 WebDriver와 pageTitle을 파라미터로 전달받아 각각 위에서 만들었던 WebDriver와 pageTitle 객체에 할당합니다.


다음에 나오는 isPageLoad() 메소드는 driver로 열은 페이지의 title에 해당 pageTitle이 있는지 확인해서 그 결과를 True or False로 반환합니다.

원하는 페이지가 open 된 것인지 확인할 때 사용하는 것 같습니다.


그리고 open() 메소드는 아까 setting 됐던 URL을 get() 메소드를 사용해서 브라우저에 open 시키는 메소드 입니다.


getTitle() 메소드는 아까 할당됐든 pageTitle을 return 해주고 getURL()은 URL을 return 합니다.


sendText()는 cssSelector와 text라는 스트링 파라미터를 전달 받습니다.

그리고 cssSelector 인 곳을 찾아 거기에 sendKey()메소드를 사용해서 text를 입력해 줍니다.


다음에 있는 isTextPresent() 메소드는 페이지내에 전달받은 text가 있는제 체크해서 그 결과를 boolean 타입으로 return 합니다.


그리고 isElementPresent() 는 text가 아니라 By 타입을 받아서 해당 Element 가 있는지 체크하고 그 결과를 boolean 타입으로 return 하구요.

그 아래는 isElementPresent() 를 OverLoading 한 것이네요. By 타입이 아니라 String 타입의 파라미터가 전달됐을 경우 실행됩니다.

하는일은 똑 같이 해당 Element 가 있는지 체크하고 그 결과를 boolean 타입으로 return 합니다.


이어서 isElementPresentAndDisplay()를 볼까요.

By 타입의 파라미터를 받아서 해당 Element가 display 돼 있는지 여부를 체크해서 boolean type을 return 합니다.


마지막으로 getWebElement() 메소드는 By 타입을 파라미터로 받아서 해당 element가 있는지 여부를 체크해서 boolean 타입을 반환하구요.


PageBase 클래스에는 이런 기능들이 있네요.

가장 기본적인 기능은 WebDriver 객체를 세팅하고 해당 페이지를 open (get()) 하는 기능이 되겠죠.






반응형


반응형

지난 글에서 다룬 GoogleSearch 클래스를 Page Object 를 사용해서 만드는 방법을 알아보겠습니다.


이렇게 Page Object를 사용하는 방법으로 사용하려면 그 기능별로 여러 클래스를 만들어야 합니다.


지난 GoogleSearch 클래스는 한개의 클래스에서 모든 작업이 이루어 졌기 때문에 한개의 JAVA 파일만 보면 됐습니다.

그런데 Page Object를 사용하는 버전에서는 여러개의 클래스 즉 여러개의 JAVA 파일을 봐야합니다.


우선 Page Object 를 사용하는 GoogleSearch 에는 어떤 클래스들이 있는지 알아보겠습니다.



우선 처음에 볼 부분은 GoogleSearch_withPageObject.java 입니다.


/**
* Google search demo class. This class shows how to use page objects.
* Compare with "GoogleSearch.java" class, and see how to use page objects.
*
* @author Chon Chung
*
*/
public class GoogleSearch_withPageObject {

    public static void main(String[] args) {
            GoogleSearch.testGoogleSearch();
            try{
                    GoogleSearch.testGoogleSuggest();
            }catch(Exception e){
                    System.out.println("Unable to perform testGoogleSuggest() - " +
                                                            e.getMessage());
            }
    }
   
    public static void testGoogleSearch(){
            //Create a new instance of GoogleSearch page
            GoogleSearchPage googleSearchPage = new GoogleSearchPage(new HtmlUnitDriver());

        // go to Google ("http://www.google.com")
            googleSearchPage.open();

        // Enter something to search for
            googleSearchPage.enterSearchForm("Cheese!");

        // Now submit the form, and get the next page object
            GoogleSearchResultPage googleSearchResultPage = googleSearchPage.submitForm();
              

        // Verify: Check the title of the page        
        String pageTitle = googleSearchResultPage.getTitle();
        System.out.println("Page title is: " + pageTitle);
        assertTrue("Got title: " + pageTitle, pageTitle.contains("Cheese!"));
    }
   
    public static void testGoogleSuggest() throws Exception {
               
        GoogleSearchSuggestPage googleSuggestPage = new GoogleSearchSuggestPage(new FirefoxDriver());
       
        // Go to the Google Suggest home page: "http://www.google.com/webhp?complete=1&hl=en"
        googleSuggestPage.open();
       
        // Enter the query string "Cheese", and get the list the suggestions
        List<WebElement> allSuggestions = googleSuggestPage.getSearchSuggestions("Cheese");
       
        for (WebElement suggestion : allSuggestions) {
            System.out.println(suggestion.getText());
        }
     }
}
/**
* Further reading:
* 1. Selenium webdriver page object:
*                 http://stackoverflow.com/questions/10315894/selenium-webdriver-page-object
* 2. Using Page Objects with Selenium and Web Driver 2.0
*                 http://www.summa-tech.com/blog/2011/10/10/using-page-objects-with-selenium-and-web-driver-20/
* 3. PageFactory
*                 http://code.google.com/p/selenium/wiki/PageFactory
* 4. Ben Burton's WebDriver Best Practices
*                 Video -- http://vimeo.com/44133409
* http://benburton.github.com/presentations/webdriver-best-practices/
*                
*/


main() 메소드는 이전의 GoogleSearch 클래스와 똑 같습니다.


testGoogleSearch() 메소드를 보면 GoogleSearch 에서는 먼저 WebDriver 객체를 만들고 그 객체를 사용해서 구글 페이지를 열었는데요.


이번에는 GoogleSearchPage 의 객체를 생성해서 사용합니다.


이 얘기는 GoogleSearchPage라는 클래스가 따로 있고 이 곳에서 WebDriver를 초기화 하는 작업을 한다는 얘기 입니다.



그러면 GoogleSearchPage.java를 볼까요?


/**
* Google Search Page Object.
* @author Chon Chung
*/
public class GoogleSearchPage extends PageBase{
       
        private final static String pageTitle = "Google";
       
        private final static String SEARCH_FIELD_NAME = "q";

        /** Constructor */
        public GoogleSearchPage(WebDriver driver){
                super(driver, pageTitle);

                // set the default URL
                URL = "http://www.google.com";
        }
       
        /** Returns the default URL */
        public String getURL(){
                return URL;
        }
       
        /** Enter the Search Text in the Search form field */
        public void enterSearchForm(String searchText){
                driver.findElement(By.name(SEARCH_FIELD_NAME)).sendKeys(searchText);                
        }
       
        /** Submit the form and return the next page object.
         * Seperate function should be in a seperate method. */
        public GoogleSearchResultPage submitForm(){
                driver.findElement(By.name(SEARCH_FIELD_NAME)).submit();
                return new GoogleSearchResultPage(driver);
        }
}


GoogleSearchPage()라는 생성자가 있죠? 여기에서 super 메소드를 사용합니다.

이 얘기는 이 클래스는 어떤 다른 클래스를 상속 받았다는 얘기입니다.

좀 위에 보니까 PageBase 클래스를 상속 받았네요.


소스 분석은 나중에 하고 오늘은 어떤 클래스들이 Page Object를 위해 사용됐는지 보기로 했으니까 다른 메소드들을 분석하는 것은 다음 글에서 하겠습니다.


그럼 PageBase 클래스를 보죠.


/**
* Page Object base class. It provides the base structure
* and properties for a page object to extend.
*
* @author Chon Chung
*/
public class PageBase {
         /** Default URL */
         protected String URL;       
       
         /** This page's WebDriver */
         protected WebDriver driver;
       
         /** Expected Page Title. This will be used in isPageLoad()
         * to check if page is loaded. */
         protected String pageTitle;
       
       
         /** Constructor */
         public PageBase(WebDriver driver, String pageTitle) {
                 this.driver = driver;
                 this.pageTitle = pageTitle;
         }
       
         /**
         * Check if page is loaded by comparing
         * the expected page-title with an actual page-title.
         **/
         public boolean isPageLoad(){
                 return (driver.getTitle().contains(pageTitle));
         }
       
       
         /** Open the default page */
         public void open(){
                 driver.get(URL);
         }
       
       
         /** Returns the page title */
         public String getTitle() {
                 return pageTitle;
         }
       
         /** Returns the default URL */
         public String getURL() {
                return URL;
         }
       
         /**
         * Send text keys to the element that finds by cssSelector.
         * It shortens "driver.findElement(By.cssSelector()).sendKeys()".
         * @param cssSelector
         * @param text
         */
         protected void sendText(String cssSelector, String text) {
                        driver.findElement(By.cssSelector(cssSelector)).sendKeys(text);
         }
       
         /** Is the text present in page. */
         public boolean isTextPresent(String text){
                 return driver.getPageSource().contains(text);
         }
       
         /** Is the Element in page. */
         public boolean isElementPresent(By by) {
                        try {
                                driver.findElement(by);//if it does not find the element throw NoSuchElementException, thus returns false.
                                return true;
                        } catch (NoSuchElementException e) {
                                return false;
                        }
         }

         /**
         * Is the Element present in the DOM.
         *
         * @param _cssSelector                 element locater
         * @return                                        WebElement
         */
         public boolean isElementPresent(String _cssSelector){
                        try {
                                driver.findElement(By.cssSelector(_cssSelector));
                                return true;
                        } catch (NoSuchElementException e) {
                                return false;
                        }
         }
       

         /**
                * Checks if the elment is in the DOM and displayed.
                *
                * @param by - selector to find the element
                * @return true or false
                */
         public boolean isElementPresentAndDisplay(By by) {
                        try {                       
                                return driver.findElement(by).isDisplayed();
                        } catch (NoSuchElementException e) {
                                return false;
                        }
         }
       
         /**
         * Returns the first WebElement using the given method.        
         * It shortens "driver.findElement(By)".
         * @param by                 element locater.
         * @return                 the first WebElement
         */
         public WebElement getWebElement(By by){
                         return driver.findElement(by);                        
         }
}
/**
* Further reading:
* 1. Selenium webdriver page object:
*                 http://stackoverflow.com/questions/10315894/selenium-webdriver-page-object
* 2. Using Page Objects with Selenium and Web Driver 2.0
*                 http://www.summa-tech.com/blog/2011/10/10/using-page-objects-with-selenium-and-web-driver-20/
* 3. PageFactory
*                 http://code.google.com/p/selenium/wiki/PageFactory
*/


PageBase() 생성자를 보시면 WebDriver와 pageTitle을 세팅합니다.

이렇게 3개의 클래스만 사용되나요?

아까 봤던 GoogleSearch_withPageObject 클래스의 testGoogleSearch() 메소드를 다시 보겠습니다.


좀 아래로 내려가니까 GoogleSearchResultPage 객체를 만드는 부분이 있습니다.

이 클래스도 따로 있는 것 같습니다.


/**
* Google Search Result Page Object.
* @author Chon Chung
*
*/
public class GoogleSearchResultPage extends PageBase{
       
        private static final String resultStats_id = "resultStats";
        private final static String pageTitle = "Google Search";
       
       
        public GoogleSearchResultPage(WebDriver driver){
                super(driver, pageTitle);        
        }
        
        /** Returns the search ResultStat. */
        public String getSearchResultStat(){
                return driver.findElement(By.id(resultStats_id)).getText();
        }  
}


여기서도 PageBase 클래스를 상속하네요.

이 PageBase 클래스는 저 위에 있으니까 다시 볼 필요는 없습니다.


그러면 testGoogleSearch() 메소드는 다 봤고 이어서 testGoogleSuggest() 메소드를 보겠습니다.

여기에서는 GoogleSearchSuggestPage 클래스에 대한 객체를 생성하네요.

이 GoogleSearchSuggestPage.java 파일도 사용됐습니다.


public class GoogleSearchSuggestPage extends PageBase{
        private final static String pageTitle = "Google";

        private final static String SEARCH_FIELD_NAME = "q";
       
        /** Constructor */
        public GoogleSearchSuggestPage(WebDriver driver){
                super(driver, pageTitle);

                // set the default URL
                URL = "http://www.google.com/webhp?complete=1&hl=en";
        }

        /** Enter the Search Text in the Search form field */
        public void enterSearchForm(String searchText){
                driver.findElement(By.name(SEARCH_FIELD_NAME)).sendKeys(searchText);                
        }
       
        /** Submit the form and return the next page object.
         * Seperate function should be in a seperate method. */
        public GoogleSearchResultPage submitForm(){
                driver.findElement(By.name(SEARCH_FIELD_NAME)).submit();
                return new GoogleSearchResultPage(driver);
        }

        /**
         * Enter the query string, and get the list of the suggestions
         * It use WaitTool to wait for the div (class=gsq_a).
         *
         * @param searchText the query string to search for
         * @return the list of the google search suggestions
         */
        public List<WebElement> getSearchSuggestions(String searchText){
        // Enter the query string "Cheese"
                driver.findElement(By.name(SEARCH_FIELD_NAME)).sendKeys(searchText);

        // Wait and get the list of suggestions
        List<WebElement> allSuggestions = WaitTool.waitForListElementsPresent(driver, By.className("gsq_a"), 5);
                return allSuggestions;
        }
}



여기서도 PageBase 클래스가 상속됐습니다. 다시 볼 필요는 없겠죠.

그 다음에 이 파일 안에서 다른 custom 클래스에 대한 객체를 만드는 부분은 없습니다.


다시 GoogleSearch_withPageObject 클래스로 돌아가죠.

testGoogleSuggest() 메소드를 보니까 다른 custom 클래스에 대한 객체를 생성하는 부분은 없습니다.


그러면 지금까지 살펴본 클래스들이 GoogleSearch.java 를 Page Object를 사용하는 버전으로 바꿨을 때 만든 클래스들 입니다.


PageBase.java

GoogleSearchPage.java

GoogleSearchResultPage.java

GoogleSearchSuggestPage.java

GoogleSearch_withPageObject.java


총 이렇게 5개의 파일이 사용됐습니다.


지난번 GoogleSearch.java에서는 단 한개의 파일만 사용했는데 똑 같은 일을 하는 Page Object를 만들기 위해 이렇게 파일을 5개로 쪼개서 기능을 부여 했네요.


다음 글에서는 각 클래스별로 어떤 일을 하고 전체적으로 어떻게 연관을 맺고 실행이 되는지를 알아보겠습니다.



반응형


반응형

지난 글 'Page Objects in Selenium 2 (Web Driver)' 맨 마지막에 아래와 같이 샘플 소스 코드들이 있었습니다.


이 샘플 코드들을 한번 분석해 보겠습니다.


* Here are the source codes


Project Home: https://github.com/ChonC/wtbox
wiki: https://github.com/ChonC/wtbox/wiki
PageBase source code
Page Objects test example


샘플을 보면 구글 페이지에서 검색하는 기능을 Selenium으로 테스트하는 소스들이 있습니다.


Page Objects를 사용하지 않은 버전과 Page Objects를 사용한 버전이 있습니다.


우선 Page Objects를 사용하지 않은 버전을 보겠습니다.



/**
* Testing Google search. This class does not use Page Object pattern.
* Compare it with “GoogleSearch_withPageObject.java” class, which uses Page Object pattern.
*
* This example is from
* "The 5 Minute Getting Started Guide
* (http://code.google.com/p/selenium/wiki/GettingStarted)."
*
*/
public class GoogleSearch {

         public static void main(String[] args) {
                 GoogleSearch.testGoogleSearch();
                 try{
                         GoogleSearch.testGoogleSuggest();
                 }catch(Exception e){
                         System.out.println("Unable to perform testGoogleSuggest() - " +
                                                                 e.getMessage());
                 }
         }
       
         public static void testGoogleSearch(){
         // Create a new instance of the html unit driver
         WebDriver driver = new HtmlUnitDriver();

         // And now use this to visit Google
         driver.get("http://www.google.com");

         // Find the text input element by its name
         WebElement element = driver.findElement(By.name("q"));

         // Enter something to search for
         element.sendKeys("Cheese!");

         // Now submit the form. WebDriver will find the form for us from the element
         element.submit();
       
         //*** return the next page object

         // Check the title of the page
         String pageTitle = driver.getTitle();
         System.out.println("Page title is: " + pageTitle);
         assertTrue("Got title: " + pageTitle, pageTitle.contains("Cheese!"));
         }
       
         public static void testGoogleSuggest() throws Exception {
                       
         // The Firefox driver supports javascript
         WebDriver driver = new FirefoxDriver();
       
         // Go to the Google Suggest home page
         driver.get("http://www.google.com/webhp?complete=1&hl=en");
       
         // Enter the query string "Cheese"
         WebElement query = driver.findElement(By.name("q"));
         query.sendKeys("Cheese");

         // Sleep until the div we want is visible or 5 seconds is over
         long end = System.currentTimeMillis() + 5000;
         while (System.currentTimeMillis() < end) {
         WebElement resultsDiv = driver.findElement(By.className("gsq_a"));

         // If results have been returned, the results are displayed in a drop down.
         if (resultsDiv.isDisplayed()) {
         break;
         }
         }

         // And now list the suggestions
         List<WebElement> allSuggestions = driver.findElements(By.className("gsq_a"));
       
         for (WebElement suggestion : allSuggestions) {
         System.out.println(suggestion.getText());
         }
         }
}


/**
* References:
* 1. http://stackoverflow.com/questions/10315894/selenium-webdriver-page-object
*/

맨 먼저 main() 메소드를 봐야 합니다.


가장 먼저 하는 일은 GoogleSearch에 있는 testGoogleSearch() 메소드를 호출하는 겁니다.

GoogleSearch는 이 클래스 이름이니까 이 클래스 내에 있는 testGoogleSearch() 메소드를 가장 먼저 시작하는 겁니다.


testGoogleSearch() 메소드를 보죠.


먼저 WebDriver로 HtmlUnitDreiver() 를 초기화를 하고 get() 메소드를 사용해서 http://www.google.com 으로 갑니다.

그리고 name 이 q 인 element를 찾아서 element 라는 WebElement 객체를 만들구요. 

이 element 객체에 Cheese!라고 입력을 합니다.

그리고 이 form 에 대한 submit() 을 실행합니다.


그러면 Cheese!로 검색한 페이지로 가게 되겠죠.

이 페이지의 title을 pageTitle이라는 String 객체에 담습니다.


그리고 이 pageTitle을 콘솔에 출력합니다.


그러면 콘솔에 아래와 같이 출력 됩니다.




출력하고 난 다음에는 assertTrue라는 jUnit 메소드를 사용해서 해당 페이지에 Cheese!라는 글자가 포함돼 있는지 테스트 합니다.


여기까지 하면 한가지 테스트가 완료 됐네요.


다시 main()메소드를 보면 그 다음에 testGoogleSuggest() 라는 메소드를 또 호출하는 것을 볼 수 있습니다.


이제 이 메소드가 실행될 텐데요. 한번 보겠습니다.


여기서는 WebDriver 에 FirefoxDriver() 를 세팅합니다.

여기까지 실행하면 Firefox가 오픈됩니다. (화면은 비어있구요.)

get() 메소드를 사용해서 http://www.google.com/webhp?complete=1&hl=en 로 이동합니다.



그리고 name이 q 인 Element를 찾아서 query라는 객체에 이 WebElement를 담습니다.

그리고 이 query 에 Cheese 를 입력합니다.


그러면 여기까지 진행이 됩니다.


그 다음에는 현재 시간 + 5초를 해서 end 라는 long 객체에 담네요.

그리고 while 문을 사용해서 이 5초동안 기다리게 하고 나서 className이 gsq_a 인 WebElement를 resultsDiv라는 객체에 담습니다.


이건 아마 원격으로 처리되다 보면 Ajax call 로 Auto Complete 기능을 실행하는데 시간이 걸리니까 이렇게 했나 봅니다.

이 while 문 안쪽을 보니까 resultsDiv 가 display 되면은 더이상 while 문을 돌지 않고 빠져 나가도록 break를 했네요.


그 다음을 보면 다시 className이 gsq_a 인 Element들을 List 객체인 allSuggestions 에 담습니다.

위 페이지를 Firebugs로 보면은 Auto complete으로 나온 cheesecake factory, cheesecake factory san diego, cheesecake recipe, cheese 이런 것들이 gsq_a 라는 클래스에 속해 있는걸 보실 수 있을 겁니다.




다음에는 이 allSuggestions List 객체에 대해서 for 문을 돌려서 콘솔에 출력하네요.



그러면 아래와 같이 Auto Complete 에 있었던 Suggestion들이 콘솔에 출력 됩니다.


여기까지가 GoogleSearch 클래스가 하는 일 입니다.


샘플 소스를 보면은 이 작업을 Page Objects를 사용해서 만든 샘플도 있습니다.

이름이 GoogleSearch_withPageObject 라는 클래스인데요.

위 GoogleSearch 클래스를 Page Object를 사용해서 어떻게 만드는지 잘 보여주고 있습니다.


이 클래스는 다음 글에서 정리 하겠습니다.


반응형