ãã®èšäºã§ã¯ãSelenium WebDriverããã³PageObjectsãã¿ãŒã³ãšãšãã«ãCïŒèªåãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãã¹ããã¬ãŒã ã¯ãŒã¯ã®ã»ããã¢ããæ¹æ³ã説æããŸãã
ãªãŒãã³ãœãŒã¹ã®ã¹ã¿ãŒã¿ãŒããã-SWD.Starter-ã¯ã10åã§æåã®ãã¹ããèšè¿°ããŠå®è¡ããã®ã«åœ¹ç«ã¡ãŸãã ããã«ãåªãããã¹ãèªååãã©ã¯ãã£ã¹ã«åºã¥ãããã¬ãŒã ã¯ãŒã¯ã¢ãŒããã¯ãã£ãæäŸããŸãã
ãã¹ãŠã®SWD.Starterã³ãŒãã¯ãããŒãºã«åãããŠå®å šã«ã«ã¹ã¿ãã€ãºã§ããŸãã
SWD.Starterãšã¯äœã§ããïŒ
SWD.Starterã¯ããã¹ãèªååãã¬ãŒã ã¯ãŒã¯ã®ã¹ã¿ãŒã¿ãŒãããã§ãã ãã¹ãŠã®ãœãŒã¹ã³ãŒãã¯GitHubã§å ¥æã§ããŸãïŒ dzhariy / SWD.Starter ããããžã§ã¯ãã©ã€ã»ã³ã¹ïŒã©ã€ã»ã³ã¹ãªãïŒã䜿çšãããšããœãŒã¹ã³ãŒãã奜ããªããã«äœ¿çšã§ããå°ãªããšã販売ã§ããŸãã
SWD.Starterã¯ãSelenium WebDriverãä»ããŠãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãã¹ãã®äœæãšå®è¡ãéå§ããããã«å¿ èŠãªãã¹ãŠã®ã€ã³ãã©ã¹ãã©ã¯ãã£ã³ãŒããå«ãæ¢ã«æ§æããããããžã§ã¯ãã§ãã
SWD.Starterã¯ãPageObjectsãã¿ãŒã³ã®äœ¿çšã匷ããå§ãããŸãã ãŸãããã®ãã¿ãŒã³ã䜿çšããå ŽåãçŸããã¢ãŒããã¯ãã£ãšã³ãŒãã®å¯èªæ§ãç¶æããªãããæ°ããèªåãã¹ãã³ãŒããéåžžã«é«éã«äœæã§ããŸãã
å§ããããã«å¿ èŠãªãã®
ãããžã§ã¯ããéå§ããã«ã¯ã次ã®ãœãããŠã§ã¢ãå¿ èŠã§ãã
- Visual Studio Express 2013 Desktop EditionïŒçè«çã«ã¯ãVS2010ãšVS2012ããµããŒããããŠããŸãïŒ
- Githubãããããžã§ã¯ãããã³ãã³ã°ããããã®Git
- ãããžã§ã¯ãã®å ¬åŒããŒãžããããŠã³ããŒãã§ããè¿œå ã®ãã©ãŠã¶ãŒãã©ã€ããŒSelenium WebDriver
ãœãããŠã§ã¢ããã°ãã䟿å©ã«ã€ã³ã¹ããŒã«ããããã«ãWindowsçšã®ããã±ãŒãžãããŒãžã£ãŒ-Chocolateyã®äœ¿çšããå§ãããŸãã
ã¡ã€ã³ããŒãžã®æ瀺ã«åŸã£ãŠãcmd.exeãéããã³ã³ãœãŒã«ãŠã£ã³ããŠã§æ¬¡ã®ã³ãŒããå®è¡ããŸãã
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
次ã«ãåãã³ã³ãœãŒã«ãŠã£ã³ããŠã§ã次ã®ã³ãã³ããå®è¡ããŸãã
- cinst VisualStudioExpress2013WindowsDesktop
- cinst git
次ã«ãã³ã³ãœãŒã«ãŠã£ã³ããŠïŒcmd.exeãFar Managerãªã©ïŒã§ãSWD.Starterã®ã¯ããŒã³ãäœæãããã©ã«ããŒãéžæããã³ãã³ããå®è¡ããŸãã
git clone https://github.com/dzhariy/SWD.Starter.git
ããã¯å¿ é ã®æé ã§ãããã以å€ã®å Žåããããžã§ã¯ãã¯ã³ã³ãã€ã«ãããŸããã
chromedriver.exeãšIEDriverServer.exeããã©ã«ããŒSWD.Starter \ webdriversã«ã³ããŒããŸã
ãããŠãããã¯ã¯ãªãŒã³ãªä»®æ³ãã·ã³ ïŒ modern.ieããããŠã³ããŒããããã® ïŒãžã®å®å šã€ã³ã¹ããŒã«ã®ãããªã§ã
ãã³ã¯ã®ãã±ã¢ã³ãããªããã©ããŒããŠãã ããïŒ
念ã®ããããããªã§ã¯ãä»®æ³ãã·ã³äžã®Windowsã®ã¢ã¯ãã£ããŒã·ã§ã³ãå¿ èŠã§ããããšã瀺ããŠããŸãã
modern.ieã®ã©ã€ã»ã³ã¹æ¡ä»¶ã«ãããšãç§ã¯ãã®ãããªç»åããã¹ãç®çã§åæ³çã«äœ¿çšããæš©å©ããããŸãã ãŠãŒã¶ãŒåææžã§ã¯ããã®å Žåã¯Windowsãã©ã€ã»ã³ã¹èªèšŒããªãã§ãã ããã
念ã®ããããããªã§ã¯ãä»®æ³ãã·ã³äžã®Windowsã®ã¢ã¯ãã£ããŒã·ã§ã³ãå¿ èŠã§ããããšã瀺ããŠããŸãã
modern.ieã®ã©ã€ã»ã³ã¹æ¡ä»¶ã«ãããšãç§ã¯ãã®ãããªç»åããã¹ãç®çã§åæ³çã«äœ¿çšããæš©å©ããããŸãã ãŠãŒã¶ãŒåææžã§ã¯ããã®å Žåã¯Windowsãã©ã€ã»ã³ã¹èªèšŒããªãã§ãã ããã
PageObjectsãšã¯äœã§ããããªãéèŠãªã®ã§ããïŒ
ç°¡åã«èšãã°ãPageObjectsã䜿çšããèªåãã¹ãã®ã¢ãããŒãã§ã¯ãããŒãžãæäœããããã®ãã¹ãŠã®äœã¬ãã«ã³ãŒãïŒããšãã°ãèŠçŽ ã®å ¥åãšã¯ãªãã¯ïŒãåå¥ã®ã¯ã©ã¹ã«é 眮ããã ãã§ãã
ããã§ããã¹ãã¯ããŒãžã§çŽæ¥åäœãããWebDriverã®äœã¬ãã«ã¡ãœãããåŒã³åºããŸãããåããŒãžã«åºæã®é«ã¬ãã«æäœã䜿çšããŸãã
ããã«ããããã¹ãã®ã³ãŒãè¡æ°ãæžããã³ãŒããèªã¿ããããç解ãããããä¿¡é Œæ§ãé«ããªããŸãã
PageObjectsã¢ãããŒãã¯ããããã¹ã¿ã€ã«ã«ä»£ãããã®ã§ãããWebDriverã¡ãœããããã¹ãããçŽæ¥åŒã³åºããŸãã
æåã¯ããããã¹ã¿ã€ã«ã¯PageObjectsã䜿çšãããããã·ã³ãã«ã§ç解ããããããã§ãã ããããããã¯èªååãããžã§ã¯ãã厩å£ããå¯èœæ§ã®ãã倧ããªèª€è§£ã§ãã
ãããã¹ã¿ã€ã«ã䜿çšããå Žåãæéã®çµéãšãšãã«ãã¹ãã®æ°ãå¢ãããšããã¹ãã®ãµããŒãã«ãŸããŸãå€ãã®æéãè²»ããããšã«ãªããŸãã çµæãšããŠãèªååãã¬ãŒã ã¯ãŒã¯ã®ãµããŒãã¯çµæžçã«å®è¡å¯èœã§ã¯ãªãããããžã§ã¯ã管çè ã¯æåãã¹ãã«æ»ãããšã決å®ããŸãã ãŸãããã§ã«äœæãããã³ãŒãã¯ãå®éã®ãã¹ãã¢ããªã±ãŒã·ã§ã³ã«å¯Ÿå¿ããªããªããããç Žæ£ãããã ãã§ãã
ãããã¹ã¿ã€ã«ã®ãã¹ãã¯ã䞊ã¹æ¿ããããŠããªã巚倧ãªæ¬ã®å±±ã®ãããªãã®ã§ãã ãããŒããã10åã®æ¬ã ãã§æ§æãããŠããå Žåãããã»ã©å°é£ãªãææ¡ã§ããŸãã
ããããæ¬ã®æ°ã100ã«å¢ãããšããäœãããªããåŸ ã£ãŠããŸããïŒ ç§ãä¿¡ããŠãç§ã¯ããªããããããŸããã¯ããŸããã 圌èªèº«ããã§ã«ãããçµéšãããããšãã£ãŠã
äžæ¹ãPageObjectsã䜿çšããå Žåããã¹ãŠã®æ¬ãæ£ã«äžŠã¹æ¿ããããšãã§ããŸãã æžåºãå庫ã«ã¯ãèšå€§ãªæ°ã®æ¬ãå«ãŸããŠããŸãã ãã ãã売ãæã¯å¿ èŠãªãã®ãããã«èŠã€ããããšãã§ããŸãã
PageObjectã¯ã©ã¹ã¯ãWebããŒãžãæäœããããã®ã³ãŒãã䟿å©ã«æŽçã§ããæ¬æ£ã§ãã ãŸããäžè¬çãªããã°ã©ãã³ã°èšèªãšIDEã¯ããªããžã§ã¯ãæåããã°ã©ãã³ã°ã䜿çšããå Žåã«ãããå€ãã®æ©èœãæäŸããŸãã
ãããã¹ã¿ã€ã«ã®ãã¹ã
ãããã¹ã¿ã€ã«ã®ãã¹ãã®äž»ãªå©ç¹ã¯ãSelenium IDEãSelenium Builderãªã©ã®ããŒã«ã䜿çšããŠããããã°ã©ãã³ã°èšèªãç¥ããªããŠããã¹ããäœæã§ãããããšã§ãã
ãã®çµæã次ã®ãããªçµæã«ãªãå¯èœæ§ããããŸãã
次ã®ãããªéåžžã«é·ãã³ãŒãã·ãŒãïŒdriver.FindElementïŒBy.IdïŒConfirmPasswordïŒïŒãSendKeysïŒpassïŒ;
class BrittleTest { [Test] public void Can_buy_an_Album_when_registered() { var driver = Host.Instance.Application.Browser; driver.Navigate().GoToUrl(driver.Url); driver.FindElement(By.LinkText("Admin")).Click(); driver.FindElement(By.LinkText("Register")).Click(); driver.FindElement(By.Id("UserName")).Clear(); driver.FindElement(By.Id("UserName")).SendKeys("HJSimpson"); driver.FindElement(By.Id("Password")).Clear(); driver.FindElement(By.Id("Password")).SendKeys("!2345Qwert"); driver.FindElement(By.Id("ConfirmPassword")).Clear(); driver.FindElement(By.Id("ConfirmPassword")).SendKeys("!2345Qwert"); driver.FindElement(By.CssSelector("input[type=\"submit\"]")).Click(); driver.FindElement(By.LinkText("Disco")).Click(); driver.FindElement(By.CssSelector("img[alt=\"Le Freak\"]")).Click(); driver.FindElement(By.LinkText("Add to cart")).Click(); driver.FindElement(By.LinkText("Checkout >>")).Click(); driver.FindElement(By.Id("FirstName")).Clear(); driver.FindElement(By.Id("FirstName")).SendKeys("Homer"); driver.FindElement(By.Id("LastName")).Clear(); driver.FindElement(By.Id("LastName")).SendKeys("Simpson"); driver.FindElement(By.Id("Address")).Clear(); driver.FindElement(By.Id("Address")).SendKeys("742 Evergreen Terrace"); driver.FindElement(By.Id("City")).Clear(); driver.FindElement(By.Id("City")).SendKeys("Springfield"); driver.FindElement(By.Id("State")).Clear(); driver.FindElement(By.Id("State")).SendKeys("Kentucky"); driver.FindElement(By.Id("PostalCode")).Clear(); driver.FindElement(By.Id("PostalCode")).SendKeys("123456"); driver.FindElement(By.Id("Country")).Clear(); driver.FindElement(By.Id("Country")).SendKeys("United States"); driver.FindElement(By.Id("Phone")).Clear(); driver.FindElement(By.Id("Phone")).SendKeys("2341231241"); driver.FindElement(By.Id("Email")).Clear(); driver.FindElement(By.Id("Email")).SendKeys("chunkylover53@aol.com<script type="text/javascript"> /* <![CDATA[ */ (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName("script");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})(); /* ]]> */ </script>"); driver.FindElement(By.Id("PromoCode")).Clear(); driver.FindElement(By.Id("PromoCode")).SendKeys("FREE"); driver.FindElement(By.CssSelector("input[type=\"submit\"]")).Click(); Assert.IsTrue(driver.PageSource.Contains("Checkout Complete")); } }
ãã®ã¢ãããŒãã¯ã1åéãã®ã¿ã¹ã¯ãå®è¡ãããšãã«æ£åœåã§ããŸãã ããšãã°ãã¢ããªã±ãŒã·ã§ã³ã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšããŠ1000人ã®ãŠãŒã¶ãŒãäœæããå¿ èŠãããå Žåã¯ãäœæãããŠãŒã¶ãŒãã¡ã¢ããæå°éã®å€æŽã§ã³ãŒããã«ãŒãã«ããŸãã
é·æçã«ãã¹ãã®èªååãæãã§ããå Žåããã®ã¢ãããŒãã¯æ害ã§ãã
次ã«ã1ã€ã®å°ããªäŸã瀺ããŸãã
1ã€ã®è£œåããŒãžãžã®ã¢ã¯ã»ã¹ã30ã®ãã¹ãããå®è¡ããããšããŸãã ããæŽããæ¥ãããã°ã©ããŒã¯ããŒãžã¬ã€ã¢ãŠããå€æŽããããšã«ããŸããã
çŸåšãèŠçŽ ã®åŒã³åºãæ¹æ³ã¯ç°ãªãããã¯ãªãã¯ã®è«çãã¯å€åããŠããŸãã
ãã®å Žåã1ã€ã®ã¯ã©ã¹ã§è¡ãã®ã§ã¯ãªãã30åã®ãã¹ããå€æŽããå¿ èŠããããŸãã
ãã®èå³æ·±ãä»äºã«ã©ããããããããšæããŸããïŒ
PageObjectã¯ã©ã¹ã䜿çšãããã¹ã
ã³ãŒãã®äžéšãåãåºããŠããã¹ãŠãè€æ°ã®PageObjectã¯ã©ã¹ã®åœ¢åŒã§æŽçãããšããã¹ãã³ãŒãã§çŽ æŽãããå€æãè¡ãããŸãïŒç解ãããããªããã³ããŒã¢ã³ãããŒã¹ãWebDriveråŒã³åºãã®ä»£ããã«ä»ã®ãã¹ãã§åå©çšã§ããã¢ã¯ã·ã§ã³ããããŸãã
ãã¹ãã³ãŒãã«ã¯ããã«è¡ãããããšã«æ³šæããŠãã ãã...ããããããã¯ããã®èšäºã®ãã¢ã§ã¯éèŠã§ããããå®éã®ã³ãŒãã§ã¯äžèŠãªã³ã¡ã³ããšæ確åã®ããã§ãã
ãã¹ãŠã®ã³ã¡ã³ããšç©ºã®è¡ãåé€ããŸã-ã³ãŒãã¯èªã¿ããããªããè¡æ°ãæžããŸãã
class PageObjectTest { [Test] public void Can_buy_an_Album_when_registered() { // , PageObject . // . var registerUserPage = new RegisterUserPage(); // , , // registerUserPage.Invoke(); // . // « », â var newUserFromData = new UserFromDataData() { UserName = "HJSimpson", Password = "!2345Qwert", }; // registerUserPage.FillForm(newUserFromData); registerUserPage.Submit(); // , // . var showCasePage = new ShowCasePage(); showCasePage.Goto("Disco"); showCasePage.SelectProduct("showCasePage"); showCasePage.AddToCard(); showCasePage.Checkout(); var checkOutForm = new CheckOutForm(); // .DefaultValues . // - â . var checkoutFromData = UserCheckoutFromData.DefaultValues; // ! JavaScript ! checkoutFromData.Email = @"chunkylover53@aol.com<script type=""text/javascript""> /* <![CDATA[ */ (function(){try{var s,a,i,j,r,c,l,b=document.getElementsByTagName(""script"");l=b[b.length-1].previousSibling;a=l.getAttribute('data-cfemail');if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})(); /* ]]> */ </script>"; CheckoutCompletePage checkoutCompletePage = checkOutForm.Submit(); Assert.IsTrue(checkoutCompletePage.GetPageTitle().Contains("Checkout Complete")); } }
ãŸãäœïŒ PageObjectã䜿çšããŠãã¹ããäœæãããã§ããïŒ
SWD.Starterã§ã®æåã®ç ãã¹ã
ããªããçåã«æã£ãŠããå ŽåïŒèªååã®ãã¹ããã©ãããå§ããŸããïŒ ããã¯ã99ïŒ ã®ã±ãŒã¹ã«é©ããéåžžã«ç°¡åãªçãã§ãã
ã¢ããªã±ãŒã·ã§ã³ã®åããŒãžã®smokãã¹ãããå§ããŸãã
ã¬ã·ãïŒ
- ãã¹ãã¬ãã«ã®ããŒãžãååŸãã
- ããŒãžãéã
- ãã¹ãŠã®éèŠãªèŠçŽ ãããŒãžã«ååšããããšã確èªããŠãã ããã
ãã®çµæã軜éãã¹ããè¡ââãããæåããå Žåã¯æ¬¡ã®ããã«ãªããŸãã
åäžããŒãžã®ãã¹ãŠã®éèŠãªèŠçŽ ããŸã å€æŽãããŠããªãããš
PageObjectã¯ã©ã¹ãçŸåšã®ããŒãžãšäžèŽããŠããããš
ãã¡ãããã¢ããªã±ãŒã·ã§ã³ãŠãŒã¶ãŒã«ãšã£ãŠã¯ããã€ã³ãA.ïŒã¡ã€ã³ããŒãžïŒãããã€ã³ãB.ïŒä»ã®ããŒãžïŒãžã®ãã¹ãå¯èœã§ãããšããäºå®ã§ãã
ãããŠãããã¯ãã¹ãŠç°ãªããã©ãŠã¶ãŒã§æ©èœããŸãã
ãããŠãæ°ããHabrahabrãŠãŒã¶ãŒã®ç»é²ããŒãžã®æåã®ãã¹ããäœæããŸãããã
ã¢ããªã±ãŒã·ã§ã³ã®ãã¹ãŠã®ããŒãžããã®ãããªãã¹ãã§ã«ããŒããã®ã§ãé©ãã§ããããã«ãã¬ããžã¡ããªãã¯ã¯50ïŒ ä»¥äžã®ã«ãã¬ããžã瀺ããŸãã ãã¡ãããã³ãŒãã«ãã¬ããžã®ã¡ããªãã¯ã¯æãåºæ¬çãªãã®ã§ã¯ãªãããšãç解ããŠããŸãããããã¯è¯ãçµæã§ããããšãèªããªããã°ãªããŸããã
ããã«ã SwdBrowser.csã«ã¯HandleJavaScriptErrorsïŒïŒã¡ãœããããããŸãã ãã®å®è£ ã§ã¯ãããšãã°ãå.InvokeïŒïŒã§ããé »ç¹ã«åŒã³åºãã ãã§ãã ãããŠããã®ã¡ãœããã¯ãäºæããªãJavaScriptãšã©ãŒã®å¯èœæ§ããã£ããã§ããŸãã
ãããªãèŠãŠãããšãã«ãé¢çœãããšã«æ°ã¥ããããšãé¡ã£ãŠããŸããïŒ
ããšãã°ããããžã§ã¯ãã¯PageObjectã¯ã©ã¹ã®ã¹ã¢ãŒã¯ãã¹ãã®æºåãã§ããŠããŸããïŒ..
ãããŠããã¹ããè¿œå ããã«ã¯ãæžãçããŠã³ãŒããçæããã ãã§ãçæãããã³ãŒãã®æ瀺ã«åŸãã ãã§ãã
ãããŠæåã«ã次ã®ã³ãŒãè¡ããããŸãã
[TestMethod] public void S01_First_Step_Run_WebDriver_with_Firefox() { SwdBrowser.Driver.Url = "http://swd-tools.com"; }
whichïŒãã©ãŠã¶ãéããç®çã®URLã«ç§»åããŠããã©ãŠã¶ãéããŸãã
ããã¯1è¡ã§ããããã§ããïŒ
ãŸããFireFoxãéãããçç±ãããã³Internet Explorerãå¿ èŠãªå Žåã¯ã©ããªããŸããïŒ
ããããã³ãã®ä»ã«ã€ããŠ-以äžã
ãã¹ãèªååã®ã°ãããã©ã¯ãã£ã¹
ãã©ã¯ãã£ã¹ãããã¹ãããšåŒã¶ã®ã¯å±éºã§ãã®ã§ãåã«ãè¯ãããŸãŸã«ããŠãããŸãããã
æã ãç¹å®ã®è§£æ±ºçã瀺ãå°ããªã¡ã¢ã®åœ¢ã§ãã®ãããªæ £è¡ã説æããŸãããæ®å¿µãªãããå šäœåã瀺ããŠããŸããã
åªãããã©ã¯ãã£ã¹ãã©ã®ããã«é£æºãããã瀺ãããã«ãç§ã¯SWD.Starterã®äœæ¥ãéå§ããŸããã
ããã§ã¯ãããšãã°ãèšäºã ãã©ãŠã¶ã®èªåäœæãšPageObjectã®åæåãã§ãSwdBrowserãå®è£ ãããŸããã ãŸããCorePageããç¶æ¿ããPageObjectã¯ã©ã¹-WebèŠçŽ ãåå¥ã«åæåã§ããŸãã
ãŸãã WebDriverWaitãšPageObjectã®ã¡ã¢ã§ãéåžžã®èŠçŽ ã®WebDriverWaitãšåæ§ã«ãPageObjectã®ãã¹ããŒããèŠçŽ åŸ æ©ã¡ãœãããè¿œå ããæ¹æ³ã«ã€ããŠèª¬æããŸãã
ãããã¯ãã¹ãŠSWD.Starterã«ãã§ã«å«ãŸããŠããŸãã ãŸããç¹å®ã®åé¡ã®è§£æ±ºã«èå³ãããå Žåã¯ãã³ãŒããèŠãŠãã ãããããããã°ãæéãçµãŠã°ç解ãããããªããŸãã ãã§ã«ãããã€ãã®ã¯ã©ã¹ã¯ããææžåãããŠããŸããäŸãã°-Swd.Core.Configuration.Config Class ã ãŸããäžéšã®ã¯ã©ã¹ã®ã³ã¡ã³ãã¯ãã§ã«ã³ãŒãã«å«ãŸããŠããŸããããŸã Doxygenã«ç§»è¡ãããŠããŸããã
ãããžã§ã¯ãæ§é SWD.Starter
SWD.Starterã®ã³ã¢ã¯Swd.Coreã§ãã 次ã®ãããªèå³æ·±ããã®ãå«ãŸããŠããŸãã
- Swd.Core.Configurationã¯ã©ã¹âConfigãå€éšã®Config.configãã¡ã€ã«ãããã¬ãŒã ã¯ãŒã¯èšå®ãèªã¿åããŸãã ãã®ãã¡ã€ã«å ã§ãèµ·åãããã©ãŠã¶ãŒãéžæããããèšå®ãè¿œå ãããã§ããŸãã
- ã¯ã©ã¹Swd.Core.WebDriver-> SwdBrowser-ã¯ãã§ã«èšåãããŠããŸãã ãã©ãŠã¶ã®å¯¿åœãå¶åŸ¡ããŸãã ãŸããåãåå空éå ã®è¿ãã«ã¯ããã©ãŠã¶ã§ã®äœæ¥ãç°¡çŽ åãã䟿å©ãªã¡ãœãããšã¯ã©ã¹ããããŸãã
- Swd.Core.Pagesåå空éã§ã¯ãPageObjectsã®åºæ¬ã¯ã©ã¹ãåç¶ããŸãã
Swd.Coreã«ã¯å ±éã³ãŒãã®ã¿ãé 眮ãããŠãããå°æ¥çã«ã¯è£å©çãªãã¹ããããžã§ã¯ãã§æ¡åŒµã§ããŸãã
ãã®ãããªãã¹ããããžã§ã¯ãã®äŸã¯ãDemoProjectã§ãã
ãã¹ããããžã§ã¯ãã¯ã2ã€ã®ã¡ã€ã³ãµããããžã§ã¯ãã§æ§æãããŠããŸãã
- Demo.TestModel-PageObjectã¯ã©ã¹ãã«ã¹ã¿ãã€ãºãããåºæ¬ã¯ã©ã¹ãå¿
èŠãªããŒã¿ãã¢ããªã±ãŒã·ã§ã³ããžãã¯ã®æçãããã³ãã¹ã察象ã®ç¹å®ã®ã¢ããªã±ãŒã·ã§ã³ã«åºæã®ä»ã®ã©ã€ãã©ãªé¢æ°ã®å®£èšãå«ãŸããŸãã
éåžžããã¹ã察象ã®åäžã®ã¢ããªã±ãŒã·ã§ã³ã«ã¯ãã¢ãã«ã©ã€ãã©ãªã1ã€ã ãååšããå¿ èŠããããŸãã - Demo.TestProjectã¯ããã¹ãã¹ã€ãŒããå«ããããžã§ã¯ãã§ãã ãã®ãããªãã¹ããããžã§ã¯ããããã€ãããå ŽåããããŸãã ããšãã°ãDemo.Tutorialããã¹ãä»ãã®ãããžã§ã¯ãã§ãããDemo.TestProjectãªã©ã®ã¢ãã«ã©ã€ãã©ãªïŒDemo.TestModelïŒã䜿çšããŸãã
- Demo.Tutorial-Swd.Starterãæäœããããã®ã¬ã€ããäœæããè©Šã¿ã ãŸã å®äºããŠããŸããããä»ãããã¡ã€ã«ãCh 00 Introduction.csããèªãã§ãã¹ããå®è¡ããŠã¿ãŠãã ããã
ãã£ãŒãããã¯ãã©ã€ã»ã³ã¹ãã³ã©ãã¬ãŒã·ã§ã³
ãããžã§ã¯ãã©ã€ã»ã³ã¹ã§ã¯ããããžã§ã¯ãã³ãŒãã䜿çšããŠä»»æã®ã¢ã¯ã·ã§ã³ãå®è¡ã§ããŸãããããã¯æ³ååã«ãã£ãŠã®ã¿å¶éã§ããŸãã ïŒhttp://unlicense.org/ïŒ
å¿ èŠã«å¿ããŠãã³ãŒããå€æŽããããåçšç®çã§äœ¿çšãããããã¬ã³ãããã€ãã³ã°ãããã³ã€ã³ã䜿çšãããã§ããŸãã
ããããããªããããã£ãŒãããã¯ãåŸãã®ã¯éåžžã«äŸ¿å©ã§ãã ãããšGithubã®ãããžã§ã¯ãããŒãžã®äž¡æ¹ã«ã³ã¡ã³ããæ®ãããšãã§ããŸãã
ãããŠäœããããæ¬åœã«æ確ãªåäŸã®ãã«ãªã¯ãšã¹ããgithubãªããžããªã«éä¿¡ããå Žåã
ãã ããã³ãŒãã®ååãåã·ã§ãã«åãããšãã倧ããªå€æŽã«ãªãå Žåã¯ãæåã«è°è«ããã®ãããã§ãããã
äœã«åãçµãããšãã§ããŸããïŒ -çã¯ã»ãšãã©èãããŠããŸããïŒ
- ããã¥ã¡ã³ã
- ãã¥ãŒããªã¢ã«
- å®éã®åé¡ã解決ããæ°ãã䟿å©ãªã³ãŒã
- æ°ãããã¢ãããžã§ã¯ã
- 説ææž
ãã®ä»ã 2014幎2æ28æ¥ãããšãã§ã Selenium Camp 2014ã«ã³ãã¡ã¬ã³ã¹ã§ãã¬ãŒã³ããŒã·ã§ã³ãè¡ãäºå®ã§ãã ã¬ããŒãã¯SWD Page Recorderãããžã§ã¯ãã«å°å¿µããŸãããSWD.Starterãããžã§ã¯ãã«å°å¿µããŸãã ãã®åŸãã¬ããŒãã®èšé²ã¯äŒè°ã®3ã4ãæåŸã«è³æã®ã¢ãŒã«ã€ãã®ã»ã¯ã·ã§ã³ã«è¡šç€ºãããŸãã
ç§ã¯2æ¥éãã¹ãŠå©çšå¯èœã«ãªããã¬ããŒãã®åŸãšäŒè°äžã®äž¡æ¹ã§ãã©ã€ãããã£ãããè¡ãæºåãã§ããŸãã
䟿å©ãªè³æ
- #SeleniumCamp 2014ã§ã®ç§ã®ã¬ããŒãïŒSWDããŒãžã¬ã³ãŒããŒïŒã®è³æãšãã®ä»ã®äºå®
- SWDããŒã« -ããŒãžããŒãžã¬ã³ãŒããŒããã³ã¹ã¿ãŒã¿ãŒã ãããžã§ã¯ãã«å¿ èŠãªãã¹ãŠã®ãªã³ã¯ãå«ãïŒãŸãã¯å«ãïŒ
- Github SWDã¹ã¿ãŒã¿ãŒ
- GitHub SWDããŒãžã¬ã³ãŒããŒ
- SWDããŒãžã¬ã³ãŒããŒïŒSelenium WebDriverã®PageObjectã¯ã©ã¹ãèšè¿°-Habrahabrã®SWDããŒãžã¬ã³ãŒããŒã®ã¬ãã¥ãŒ
- ãŠã§ãããŒïŒSelenium WebDriverã§ããŒãžãªããžã§ã¯ããã¿ãŒã³ã䜿çšããåºæ¬
- ãã¹ãèªååã«é¢ããæè¿ã®ã¡ã¢ãšèšäºã®éžæ -ãã¹ãèªååã®ãã³ãã«èå³ãããå Žå
- #atdaysã§ã®ã¬ããŒãã®ã¹ã©ã€ã/ãããªïŒPageObjectã®å€éš
- ä¿å®å¯èœãªèªååãããUIãã¹ã - ãã¹ãèªååã®ææ°ã®å€èŠ³ãæã€åªããèšäº
èªååã«æåããŸããã
PSïŒ SWDã¯S elenium W eb D riverã®ç¥ã§ã