{"id":21375709,"url":"https://github.com/qaf-tm/qaf-step-by-step-tutorial","last_synced_at":"2025-07-13T09:33:37.302Z","repository":{"id":95775366,"uuid":"72403989","full_name":"qaf-tm/qaf-step-by-step-tutorial","owner":"qaf-tm","description":"qaf getting started tutorial provides step by step exercise for automation using selenium webdriver and appium","archived":false,"fork":false,"pushed_at":"2016-11-09T12:05:25.000Z","size":1075,"stargazers_count":12,"open_issues_count":1,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-07T08:51:34.472Z","etag":null,"topics":["appium","bdd","getting-started","java","qaf","selenium","tutorial","webdriver"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qaf-tm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-31T05:21:44.000Z","updated_at":"2024-12-05T22:30:32.000Z","dependencies_parsed_at":"2023-03-24T19:47:44.603Z","dependency_job_id":null,"html_url":"https://github.com/qaf-tm/qaf-step-by-step-tutorial","commit_stats":null,"previous_names":["qaf-tm/qaf-step-by-step-tutorial","qmetry/qaf-step-by-step-tutorial"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/qaf-tm/qaf-step-by-step-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaf-tm%2Fqaf-step-by-step-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaf-tm%2Fqaf-step-by-step-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaf-tm%2Fqaf-step-by-step-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaf-tm%2Fqaf-step-by-step-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qaf-tm","download_url":"https://codeload.github.com/qaf-tm/qaf-step-by-step-tutorial/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaf-tm%2Fqaf-step-by-step-tutorial/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265120629,"owners_count":23714493,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appium","bdd","getting-started","java","qaf","selenium","tutorial","webdriver"],"created_at":"2024-11-22T09:12:24.492Z","updated_at":"2025-07-13T09:33:37.297Z","avatar_url":"https://github.com/qaf-tm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# qaf-step-by-step-tutorial\nqaf getting started tutorial provides step by step exercise \n\nThis repository provides a step by step guide to start using QAF.\n\n# Exercise-2\n\n##### Table of contents\n\n 1. [Create locator repository](#create-locator-repository)\n 2. [Create your first Test case in BDD](#create-your-first-test-case-in-bdd)\n 3. [Create your first Test case in Java](#create-your-first-test-case-in-java)\n 4. [References](#references)\n\n____\n\nAfter completion of [Exercise-1](https://github.com/qmetry/qaf-step-by-step-tutorial/tree/Exercise-1) you will have your local enviroment ready with project skeleton in eclipse. Now you are ready to create your first automated test. \n\nIn this exercise we will create sample test case to automate google serach.\nConisder following test case:\n```\nOpen Google search page\nSearch for Git reporsitory QMetry Automation Framework\nVerify that Git repository link present \n```\n## Create locator repository\nTo start with first of all you need to identify element locators and place into locator repositoiry.\nQAS user can use object-spy featuer and non QAS users can use firebug with firepath.\n\nCreate new locator repository named `home.properties` and provide locators for serach box, and search button. \n``` properties\ntxt.searchbox = name=q\nbtn.search = name=btnG\n```\n\n## Create your first Test case in BDD\n\n 1. Create new BDD file named `suite-1.bdd` in scenarios dir\n 2. Open this file in BDD editor\n 3. Create new Scenario with name 'SampleTest', Description 'Sample Test Scenario' and group 'SMOKE'.\n    * if you are using QAS create new scenario following new scenario wizard\n    * if you are using eclipse with QAF bdd editor press ctrl+space and select Scenario snnipet\n 4. You will have scenario skeleton ready as below:\n   ``` javascript\n    SCENARIO: SampleTest\n    META-DATA: {\"description\":\"Sample Test Scenario\",\"groups\":[\"SMOKE\"]}\n\n    END\n   ```\n 5. Call teststeps in your Scenario. To start with for this example of google you can call predefined steps avialable with QAF-Support jar (Make sure that ivy has QAF-Support dependency added). Call steps as bellow \n \n    ``` javascript\n    SCENARIO: SampleTest\n    META-DATA: {\"description\":\"Sample Test Scenario\",\"groups\":[\"SMOKE\"]}\n\t    Given get '/'\n\t    When sendkeys 'Git reporsitory QAF' to 'txt.searchbox'\n\t    And click on 'btn.search'\n\t    Then verify link with partial text 'qaf' is present \n    END\n    ```\n\n## Create your first Test case in Java \n\n 1. Create new Java Class `Suite1.java` extending 'com.qmetry.qaf.automation.ui.WebDriverTestCase' under package `qaf.example.tests` in src dir. Refer [Creating a Java class](http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2FgettingStarted%2Fqs-9.htm) for help. Your class should look like:\n \n ``` java\npackage qaf.example.tests;\n\nimport org.testng.annotations.Test;\nimport com.qmetry.qaf.automation.ui.WebDriverTestCase;\n\npublic class Suite1 extends WebDriverTestCase {\n\n}\n ```\n 2. create new test method `SampleTest`, add import statement `import org.testng.annotations.Test;`, provide `@Test` annotation, set decription and groups\n \n ```java\n \t@Test(description=\"Sample Test Scenario\", groups={\"SMOKE\"})\n\tpublic void testGoogleSearch() {\n\t\n\t}\n ```\n \n 3. add import statement `import static com.qmetry.qaf.automation.step.CommonStep.*;`. Use content assist (ctrl + SPACE) to refer available methods. Call steps in test method as bellow:\n \n ```java\n \t   get(\"/\");\n\t   sendKeys(\"Git reporsitory QAF\", \"txt.searchbox\");\n\t   click(\"btn.search\");\n\t   verifyLinkWithPartialTextPresent(\"qaf\");\n ```\n \n your complete class with testcase will look like\n \n ``` Java\npackage qaf.example.tests;\n\nimport org.testng.annotations.Test;\nimport com.qmetry.qaf.automation.ui.WebDriverTestCase;\n\npublic class Suite1 extends WebDriverTestCase {\n\n\t@Test(description=\"Sample Test Scenario\", groups={\"SMOKE\"})\n\tpublic void testGoogleSearch() {\n\t   get(\"/\");\n\t   sendKeys(\"Git reporsitory QAF\", \"txt.searchbox\");\n\t   click(\"btn.search\");\n\t   verifyLinkWithPartialTextPresent(\"qaf\");\n\t}\n}\n ```\n\n### References\n 1. \u003ca href=\"https://qmetry.github.io/qaf/latest/understand_dirstructure.html\" target=\"_blank\"\u003eUnderstating Directory Structure:link:\u003c/a\u003e\n 2. \u003ca href=\"https://qmetry.github.io/qaf/latest/locator_repository.html\" target=\"_blank\"\u003eLocator Repository:link:\u003c/a\u003e\n 3. \u003ca href=\"https://qmetry.github.io/qaf/latest/scenario.html\" target=\"_blank\"\u003eTest Authoring in BDD:link:\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaf-tm%2Fqaf-step-by-step-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqaf-tm%2Fqaf-step-by-step-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaf-tm%2Fqaf-step-by-step-tutorial/lists"}