how to define mobile automation strategy

31
How to Define Mobile Test Automation Strategy Serhat BOLSU – Selin GUNGOR – Erol SELITEKTAY

Upload: mesut-guenes

Post on 27-Nov-2014

69 views

Category:

Software


1 download

DESCRIPTION

How to Define Mobile Automation Strategy

TRANSCRIPT

  • 1. How to Define Mobile TestAutomation StrategySerhat BOLSU Selin GUNGOR Erol SELITEKTAY

2. Selin GngrSoftware Test EngineeriekSepeti.com / Bright E-Ventures 3. Serhat BolsuService & QA ManagertmobReferences 4. Erol SelitektayQuality Assurance EngineerVNGRS 5. OutlineDecision to AutomateMobile ChallengesDemoMobile Automation ApproachesContinuous IntegrationA Fine Approach 6. Decision to AutomateAim of AutomationReduce Regression CostDevice SupportBetter QualityEarly Detection35003000250020001500100050001 2 3 4 5 6 7 8 9 10 11Android/iOSPlatform 2xPhones ManualAndroid/iOSPlatform 2xPhonesAutomated90080070060050040030020010001 2 3 4 5 6 7 8 9 10 11ThousandsManual 1PlatformAutomated MultiPlatform 7. Decision to AutomateWhat to AutomateStable VersionTest Types Regression Testing Smoke Test Performance & Load TestingRegression TestingPerformance & Load Testing Smoke Testing 8. Decision to AutomateProfiles 9. Mobile ChallengesDevice Diversity Multi Platform HardwareDependenciesNetwork1112. 8d6if3fe Dreisnttin Acnt dArnodidro viedr Dsioevnisc essu pbpyo 2r0te1d3 boyn Gthoeo mglea r ket. 10. Mobile ChallengesApp-Behaviour1 12 11. Easy to DebugIdeal CaseAutomationRequirementsSupport Integrationto Third Party LibrariesEasy to UseSustainableMaintainableHuman ReadableSupport CI Tools 12. Test automation is a software development process.Test automation projects often fail because of a lack ofdiscipline and project management. Many testers dont realizethat when they automate tests theyre actually developingsoftware.Lessons Learned in Software TestingAuthors: Cem Kaner, James Bach and Bret Pettichord 13. Automation is Software Developmentlogin();searchItem();addToBasket();buyWithMoneyOrder(); 14. Automation is Software Development//Logindriver.driver.get("get("http://http://somewebsite.somewebsite.com");com");WebElement WebElement signIn signIn = driver.= driver.findElement(findElement(By.linkText("By.SIGN linkText("IN").click();SIGN IN").click();WebElement email= driver.findElement(By.id("email")).sendKeys("[email protected]");WebElement WebElement password email= = driver.driver.findElement(findElement(By.id("By.password")).id("email")).sendKeys("sendKeys("somepassword");[email protected]");WebElement WebElement submitButton password = = driver.driver.findElement(findElement(By.id("By.submit_id("password")).form")).click();sendKeys("somepassword");WebElement Wait submitButton wait = new WebDriverWait(= driver.findElement(driver, 10);By.id("submit_form")).click();//WebElement Search resim Item=wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("img[alt='Dracena Massengena kili']")));WebElement city = wait.until(visibilityOfElementLocated(By.className("select2-choice"))).click();Wait dist = wait.wait until(= ExpectedConditions.new WebDriverWait(visibilityOfElementLocated(driver, 10);By.className("select2-default"))).click();WebElement WebElement distbox resim = driver.=wait.findElement(until(ExpectedConditions.By.className("select2-visibilityOfElementLocated(focused")).sendKeys("AKSARAY");By.cssSelector("img[alt='Dracena Massengena kili']")));WebElement cldist = driver.findElement(By.className("select2-result-label")).click(),//WebElement Add to picerd Basket= driver.findElement(By.id("prdatepicker")).click();WebElement WebElement selectd city = = driver.wait.until(findElement(visibilityOfElementLocated(By.linkText("30")).click();By.className("select2-choice"))).click();WebElement AddBasket=driver.findElement(By.id("addToBasket")).click();WebElement dist = wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("select2-default"))).click();WebElement SatinAl = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='Basket']/div[2]/div[2]/input"))).click();WebElement WebElement EkUrun distbox = wait.= until(driver.ExpectedConditions.findElement(By.visibilityOfElementLocated(className("select2-focused")).By.xpath("(//button[@sendKeys("type='AKSARAY");button'])[5]"))).click();WebElement cldist = driver.findElement(By.className("select2-result-label")).click(),WebElement picerd = driver.findElement(By.id("prdatepicker")).click();WebElement selectd = driver.findElement(By.linkText("30")).click();WebElement AddBasket=driver.findElement(By.id("addToBasket")).click();//Buy with Money OrderWebElement SatinAl = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//*[@id='Basket']/div[2]/div[2]/input"))).click();WebElement EkUrun = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("(//button[@type='button'])[5]"))).click();public LoginPage login(){driver.get("http://somewebsite.com");WebElement signIn = driver.findElement(By.linkText("SIGN IN").click();WebElement email= driver.findElement(By.id("email")).sendKeys("[email protected]");WebElement password = driver.findElement(By.id("password")).sendKeys("somepassword");WebElement submitButton = driver.findElement(By.id("submit_form")).click();return new HomePage(driver)}login();public SearchPage searchItem(){...searchItem();ilerle1=driver.findElement(By.cssSelector("button.goNext.sendAddition")).click();}public ProductDetailPage addBasket(){...}public OrderPage buyWithMoneyOrder(){...}WebElement UyeOlmaDevam= wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("ye olmadan devam et"))).click();WebElement AliciName= wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("OrderProducts_1__ReceiverModel_OrderReceiver_NameRec"))).sendKeys("SeleniumTest ");WebElement WebElement addToBasket();AliciTel=driver.findElement(By.xpath("//*[@id='OrderProducts_1__ReceiverModel_OrderReceiver_PhoneRec']")).sendKeys("11111111111111111111");AliciAdres = driver.findElement(By.id("OrderProducts_1__ReceiverModel_OrderReceiver_AddressLineRec")).sendKeys("Selenium Test Adress");WebElement ilerle2= driver.findElement(By.cssSelector("button.goNext.sendRec")).click();WebElement ilerle3 = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("button.goNext.sendCardMessage"))).click();WebElement FaturaAd = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("InvoiceInfoViewModel_Order_SenderName"))).sendKeys("Selenium Test Fatura Ad");WebElement FaturaTel ilerle1== driver.driver.findElement(findElement(By.id("By.InvoiceInfoViewModel_cssSelector("button.Order_goNext.SenderPhone")).sendAddition")).sendKeys("click();111111111111");WebElement buyWithMoneyOrder();FaturaEmail=driver.findElement(By.id("InvoiceInfoViewModel_Email")).sendKeys("[email protected]");WebElement OdemeSec= driver.findElement(By.cssSelector("p.billOther")).click();WebElement Havale = wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("Havale / EFT ile deme"))).click();WebElement BankaSec = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("span.selectBox-label"))).click();WebElement UyeOlmaDevam= wait.until(ExpectedConditions.visibilityOfElementLocated(By.linkText("ye olmadan devam et"))).click();WebElement AliciName= wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("OrderProducts_1__ReceiverModel_OrderReceiver_NameRec"))).sendKeys("SeleniumTest ");WebElement garanti AliciTel== driver.driver.findElement(findElement(By.xpath("By.html/xpath("//*[@body/ul/li[2]/id='a")).OrderProducts_click();1__ReceiverModel_OrderReceiver_PhoneRec']")).sendKeys("11111111111111111111");WebElement WebElement SiparisVer AliciAdres = driver.= driver.findElement(findElement(By.xpath("//By.input[@id("OrderProducts_value='Sipari Ver']")).1__click();ReceiverModel_OrderReceiver_AddressLineRec")).sendKeys("Selenium Test Adress");WebElement String sipNo=driver.ilerle2= findElement(driver.By.findElement(xpath("//*[@id='By.wrapper']/cssSelector("div[3]/div/button.div/div/div[goNext.1]/p[2]/sendRec")).span")).getText();click();System.out.println("Sipari Numaras: "+ sipNo);WebElement driver.quit();ilerle3 = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("button.goNext.sendCardMessage"))).click();WebElement FaturaAd = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("InvoiceInfoViewModel_Order_SenderName"))).sendKeys("Selenium Test Fatura Ad");WebElement FaturaTel = driver.findElement(By.id("InvoiceInfoViewModel_Order_SenderPhone")).sendKeys("111111111111");WebElement FaturaEmail=driver.findElement(By.id("InvoiceInfoViewModel_Email")).sendKeys("[email protected]"); 15. DemoDEMO TIMEhttp://youtu.be/fJxgWwAMwbM 16. http://youtu.be/fJxgWwAMwbM 17. Mobile Automation ApproachesRecord & PlayRecord -> Edit -> Play -> Edit -> Add Verify -> Edit and so on...Good for getting to know technologynone of these tests will be maintainablenone of these tests will be sustainable 18. Mobile Automation ApproachesBehaviour Driven Development#1 USER STORIES describe BUSINESS VALUE#2 SCENARIOS help describe ACCEPTANCE CRITERIA#3 SCENARIOS act as AUTOMATED TESTS 19. Mobile Automation ApproachesBehaviour Driven DevelopmentBDD is good for :BDD is not ideal for : 20. Mobile Automation ApproachesKeyword Driven Testingkeyword :1) A function or method that can be used to test one aspect of the SUT2) Can be defined by other keywordsHigher-level keywords:a concrete aspect of the business logicLower-level keywords:to keep the implementation of the higher-level keywords at a decent sizeTechnical keywords:provide the technical implementation to access and thus test the system.By codeCentric 21. Mobile Automation ApproachesBDD vs Keyword-Driven TestingRequirement: Allow customer to choose a round or square shaped pizzaBDD: Given the customer logged into the pizza build app.When the customer choose to build a square shaped pizza,Then customer should be able to get a square shaped pizza,When the customer choose to build a round shaped pizza,Then customer should be able to get a round shaped pizza.KDT: LoginBuild pizza | squareVerify pizza is builtBuild pizza | roundVerify pizza is builtby Jim Cornelius BDD presentation 22. ToolsTest tool is NOT A StrategyUsing the tool is NOT A Goal 23. Mobile Automation ApproachesTool TechnologyObject RecognitionHighest ROI in long perspective.Test cases developed are more reusable and flexible.Scope and coverage for functional testing will be very high compared to Image recognition.ex: WebElement AddToBasket=driver.findElement(By.id("btn_Basket"));Image RecognitionIdentify and control GUI components.Useful when there is no easy access to a GUI's internal or source code.Create Image Library.Text Recognition (OCR)Highest ROI in short perspective.No need object repository. 24. Mobile Automation ApproachesHow to Select Tool Application Type (native, hybrid, mobile-web) Operating System (Platform) Application Functionality (Business, communication, gaming etc.) Design Methodology (Keyword, DDT, BDD etc.) Support Real Device Testing 25. Continuous IntegrationContinuous Integration Builds ExecuteAutomated Regression TestsAutomated Regression TestsContinuous Integration Builds ExecuteAutomated Unit TestsAutomated Unit TestsTest Maturity ModelBuild Automation (.apk, .ipa)by Jim Cornelius BDD presentation 26. A Fine ApproachInput: Test Design Output: Test SuiteQA ResponsibilitiesTest Case DesignTest CaseMaintanenceDebuggingObject LibraryPlatform SupportiOSAndroidWindowsSource RepositoryCommit test cases/suitesObjects 27. Android PhoneiOSAndroid TabletiPadWindowsTabletA Fine Approachpull object librarypull test cases/suitesJenkinsServer3 Step ExecutionFull Suite ExecutionFailing case ExecutionReport/Mail ResultsInput: Test Design Output: Test SuiteSource RepositoryWindowsPhone 28. A Fine Approach: Abstraction LayersTest Suite 2 Test SuiteT nest Case nTest Case 1 Test Case n Test Case 1Higher Level KeywordsLower Level KeywordsObject LibraryWindows AgentiOS Agent Android AgentiPhone / iPadAndroid Phone /Android TabletThird-party LibrariesTest Suite 1Test Case n Test Case 1Windows Phone / TabletTest Case nStableVariableStableTechnical KeywordsTest Framework 29. Q&ASerhat [email protected] [email protected] [email protected]