{"id":24902881,"url":"https://github.com/anik16298/book_house_web_automation_using_selenium_with_allure_report","last_synced_at":"2026-04-14T06:33:15.539Z","repository":{"id":275017968,"uuid":"924810046","full_name":"Anik16298/Book_house_web_automation_using_selenium_with_allure_report","owner":"Anik16298","description":"Bookhouse Web Automation automates end-to-end testing for the Bookhouse website, focusing on the add-to-cart flow and checkout process. Built with Java, Selenium, Maven, and TestNG, it ensures cross-browser compatibility and reliability through POM. Test results are visualized via Allure Report for efficient execution and fast issue identification.","archived":false,"fork":false,"pushed_at":"2025-01-31T10:00:05.000Z","size":1787,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T10:29:10.576Z","etag":null,"topics":["allure-report","java","manual-testing","maven","selenium","test-automation","testcasewriting","testing-tools","webautomationtesting"],"latest_commit_sha":null,"homepage":"https://bookhouse.com.bd/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Anik16298.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-01-30T17:33:51.000Z","updated_at":"2025-01-31T10:00:08.000Z","dependencies_parsed_at":"2025-01-31T10:29:47.340Z","dependency_job_id":null,"html_url":"https://github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report","commit_stats":null,"previous_names":["anik16298/book_house_web_automation_using_selenium_with_allure","anik16298/book_house_web_automation_using_selenium_with_allure_report"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anik16298%2FBook_house_web_automation_using_selenium_with_allure_report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anik16298%2FBook_house_web_automation_using_selenium_with_allure_report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anik16298%2FBook_house_web_automation_using_selenium_with_allure_report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Anik16298%2FBook_house_web_automation_using_selenium_with_allure_report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Anik16298","download_url":"https://codeload.github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236726282,"owners_count":19194889,"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":["allure-report","java","manual-testing","maven","selenium","test-automation","testcasewriting","testing-tools","webautomationtesting"],"created_at":"2025-02-01T22:17:38.859Z","updated_at":"2025-10-12T10:15:29.874Z","avatar_url":"https://github.com/Anik16298.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Book House Web Automation Usiong Selenium(Java) with Allure Report\n## Overview\nThis project automates the functionality of the BookHouse.com website using Java, Selenium WebDriver, and TestNG for test execution. The automation suite includes key operations such as login, searching for books, adding items to the cart, and completing checkout. All test results are reported using Allure, generating detailed and interactive reports for test analysis also created the report on surefire-report.\n\nThis project aims to ensure the website's smooth functionality by automating critical flows and validating the website’s behaviour under various scenarios based on only happy paths.\n\n## Features\n* **Automated Login** \u003cbr\u003e\n* **Search Functionalities** : Automated searching books based on the writer, title, genre, publishers etc. \u003cbr\u003e\n* **Shopping page Automated** : Simulates adding/removing books from the cart. \u003cbr\u003e\n* **Checkout Operation** : Automates the entire checkout process by following all steps like entering the number address delivery area delivery method etc. \u003cbr\u003e\n* **Automated Logout** \u003cbr\u003e\n* **Report Generate with Allure and Surefire** : Generates rich, visually appealing HTML reports of the test executions.\n\n## Website\n[Book House](https://bookhouse.com.bd/)\n\n## Manual TestCase\n[Test Case for Book House by Anik Chakraborty](https://docs.google.com/spreadsheets/d/1fprVjAqXRW_7NpZPudY8ja0rpoFY658I/edit?usp=sharing\u0026ouid=102409645167363931924\u0026rtpof=true\u0026sd=true)  \n\n## Pre-requisites\n* Java (it's better to use the latest and stable version)\n* Maven\n* Manual Test Cases\n* Testing Script(Manual Test cases converted into codes)\n* Webdriver\n* Allure Command Line\n* Surefire command line for run in terminal\n* IDE like IntelliJ IDEA, Eclipse, or Visual Studio Code\n\n## Project Structure\n````\n**bookhouse-automation-pom/**  \n|──**src/**  \n│   ├── **main/**  \n│   │   └── **java/**  \n│   │       └── **com/**  \n│   │           └── **bookhouse/**  \n│   │             \n│   └── **test/**  \n│   |   └── **java/**  \n│   |        └── **com/**  \n│   |            └── **bookhouse/**  \n│   │               ├── **pages/**                 **# Page Object Models (POM)**\n|   |                    ├── **BasePage.java**     **# Base class with common setup** \n│   |                    ├── **HomePage.java**\n|   |                    ├── **LoginPage.java**\n|   |                    ├── **WriterPage.java**\n|   |                    ├── **ShoppingCartPage.java**\n|   |                    ├── **CheckOutPage.java**\n│   |                    └── **LogoutPage.java**   \n│   │               ├── **utils/**                 **# Helper/Utility classes**\n|   |                    ├── **DataSet.java**\n│   |                    └── **DriverSetup.java**  \n|   |               └── **tests/**                 **# TestNG test cases**  \n│                        ├── **TestHomePage.java**\n|                        ├── **TestLoginPage.java**\n|                        ├── **TestWriterPage.java**\n|                        ├── **TestShoppingCartPage.java**\n|                        ├── **TestCheckoutPage.java**\n│                        └── **TestLogOutPage.java**   \n├── **pom.xml**                                    **# Maven dependencies and build configuration**  \n├── **allure-results/**                            **# Allure test execution results**\n├── **Testng.xml/**                                **# Project Html Documentation to run all test**\n└── **README.md**                                  **# Project documentation**  \n````\n## Installation\n**1. Clone the Repository**\nFirst, clone this repository to your local machine:\n````\nhttps://github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report\n````\n**2. Set Up Java and Maven**\nEnsure Java 8 or higher and Maven 3.x are installed on your machine.\n\nCheck your Java and Maven versions:\n````\njava -version\nmvn -version\n````\n**3. WebDriver Setup**\nSetup your webdriver properly.\n\n**4. Add Dependecies in (pom.xml)**\n- **selenium dependencies**\n````\n\n\u003c!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --\u003e\n\u003cdependency\u003e\n      \u003cgroupId\u003eorg.seleniumhq.selenium\u003c/groupId\u003e\n      \u003cartifactId\u003eselenium-java\u003c/artifactId\u003e\n      \u003cversion\u003e4.25.0\u003c/version\u003e\n\u003c/dependency\u003e\n````\n- **Testng dependencies**\n````\n\n\u003c!-- https://mvnrepository.com/artifact/org.testng/testng --\u003e\n\u003cdependency\u003e\n      \u003cgroupId\u003eorg.testng\u003c/groupId\u003e\n      \u003cartifactId\u003etestng\u003c/artifactId\u003e\n      \u003cversion\u003e7.10.2\u003c/version\u003e\n      \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n````\n- **Allure dependencies**\n````\n\n\u003c!-- https://mvnrepository.com/artifact/io.qameta.allure/allure-testng --\u003e\n\u003cdependency\u003e\n      \u003cgroupId\u003eio.qameta.allure\u003c/groupId\u003e\n      \u003cartifactId\u003eallure-testng\u003c/artifactId\u003e\n      \u003cversion\u003e2.29.0\u003c/version\u003e\n\u003c/dependency\u003e\n````\n**5. Maven Plugin**\n````\n\n\u003cplugins\u003e\n      \u003cplugin\u003e\n        \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n        \u003cartifactId\u003emaven-surefire-plugin\u003c/artifactId\u003e\n        \u003cversion\u003e3.5.2\u003c/version\u003e\n        \u003cconfiguration\u003e\n          \u003csuiteXmlFiles\u003e\n            \u003csuiteXmlFile\u003etestng.xml\u003c/suiteXmlFile\u003e\n          \u003c/suiteXmlFiles\u003e\n        \u003c/configuration\u003e\n      \u003c/plugin\u003e\n\u003c/plugins\u003e\n````\n## Example Test Code\n### Driver Setup\n````\n\npackage Utility;\n\nimport org.openqa.selenium.WebDriver;\nimport org.openqa.selenium.chrome.ChromeDriver;\nimport org.openqa.selenium.edge.EdgeDriver;\nimport org.openqa.selenium.firefox.FirefoxDriver;\nimport org.testng.annotations.AfterMethod;\nimport org.testng.annotations.BeforeMethod;\n\nimport java.time.Duration;\n\npublic class DriverSetup {\n\n    private static String browserName = System.getProperty(\"browser\", \"firefox\");\n    private static final ThreadLocal\u003cWebDriver\u003e LOCAL_DRIVER = new ThreadLocal\u003c\u003e();\n\n    public static void setDriver(WebDriver driver) {\n        DriverSetup.LOCAL_DRIVER.set(driver);\n    }\n\n    public static WebDriver getDriver() {\n        return LOCAL_DRIVER.get();\n    }\n\n    public WebDriver getBrowser(String browser_name) {\n        if (browser_name.equalsIgnoreCase(\"chrome\")) {\n            return new ChromeDriver();\n        } else if (browser_name.equalsIgnoreCase(\"firefox\")) {\n            return new FirefoxDriver();\n        } else if (browser_name.equalsIgnoreCase(\"edge\")) {\n            return new EdgeDriver();\n        }\n        else {\n            throw new RuntimeException(\"This Browser is not Available: \" +browser_name);\n        }\n    }\n\n    @BeforeMethod\n    public void OpenABrowser(){\n        WebDriver driver = getBrowser(browserName);\n        driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));\n        driver.manage().window().maximize();\n        setDriver(driver);\n    }\n\n    @AfterMethod\n    public void CloseBrowser(){\n        getDriver().quit();\n    }\n}\n````\n### BasePage Setup\n````\n\npackage Pages;\n\nimport io.qameta.allure.Allure;\nimport org.openqa.selenium.*;\nimport org.openqa.selenium.interactions.Actions;\nimport org.openqa.selenium.support.ui.ExpectedCondition;\nimport org.openqa.selenium.support.ui.ExpectedConditions;\nimport org.openqa.selenium.support.ui.Select;\nimport org.openqa.selenium.support.ui.WebDriverWait;\n\nimport java.io.ByteArrayInputStream;\nimport java.time.Duration;\n\nimport static Utility.DriverSetup.getDriver;\n\npublic class BasePage {\n\n    public void loadWebPage(String url){\n        getDriver().get(url);\n    }\n\n    public WebElement getElement(By locator){\n        return getDriver().findElement(locator);\n    }\n\n    public void clickOnElement(By locator){\n        getElement(locator).click();\n    }\n\n    public void writeOnElement(By locator, String text){\n        getElement(locator).click();\n        getElement(locator).clear();\n        getElement(locator).sendKeys(text);\n    }\n\n    public String getPageUrl(){\n        return getDriver().getCurrentUrl();\n    }\n\n    public String getPageTitle(){\n        return getDriver().getTitle();\n    }\n\n    public Boolean is_element_visible(By locator){\n        try {\n            return getElement(locator).isDisplayed();\n        }catch (Exception e){\n            return false;\n        }\n    }\n\n    public Boolean is_selected(By locator){\n        try {\n            return getElement(locator).isSelected();\n        }catch (Exception e){\n            return false;\n        }\n    }\n\n    public Boolean is_enabled(By locator){\n        try {\n            return getElement(locator).isEnabled();\n        }catch (Exception e){\n            return false;\n        }\n    }\n\n    public void GetText(By locator){\n        getElement(locator).getText();\n    }\n\n    public void HoverElement(By locator){\n        Actions actions = new Actions(getDriver());\n        actions.moveToElement(getElement(locator)).build().perform();\n        actions.click(getElement(locator)).build().perform();\n    }\n\n    public void ScrollElement(By locator){\n        JavascriptExecutor scroll = (JavascriptExecutor) getDriver();\n        WebElement next_page = getElement(locator);\n        scroll.executeScript(\"arguments[0].scrollIntoView()\", next_page);\n    }\n\n    public void HandleDropdown(By locator, String text) {\n        WebElement dropdown = getElement(locator);\n        dropdown.click();\n        for (WebElement option : dropdown.findElements(By.xpath(\"//li\"))) {\n            if (option.getText().equals(text)) {\n                option.click();\n                break;\n            }\n        }\n    }\n\n    public void webDriverWait(By locator){\n        WebDriverWait wait = new WebDriverWait(getDriver(), Duration.ofSeconds(15));\n        wait.until(ExpectedConditions.elementToBeClickable(locator));\n        wait.until(ExpectedConditions.visibilityOfElementLocated(locator));\n    }\n\n    public String getAttributeName(By locator){\n        return getElement(locator).getAttribute(\"Message\");\n    }\n\n    public void BrowserNavigate(){\n        getDriver().navigate().back();\n    }\n\n    public void addScreenshot() {\n        Allure.addAttachment(\"After Test\", new ByteArrayInputStream(((TakesScreenshot) getDriver()).getScreenshotAs(OutputType.BYTES)));\n    }\n}\n````\n### LoginTest \n````\n\npackage TestCases;\n\nimport Pages.HomePage;\nimport Pages.LoginPage;\nimport Utility.DataSet;\nimport Utility.DriverSetup;\nimport io.qameta.allure.Description;\nimport io.qameta.allure.Severity;\nimport io.qameta.allure.SeverityLevel;\nimport org.testng.Assert;\nimport org.testng.annotations.BeforeMethod;\nimport org.testng.annotations.Test;\n\npublic class TestLoginPage extends DriverSetup {\n\n    HomePage homePage = new HomePage();\n    LoginPage loginPage = new LoginPage();\n\n    @BeforeMethod\n    public void TestLoginBtn(){\n        loginPage.navigateToLoginPage();\n    }\n\n    @Test(dataProvider = \"validCredentials\", dataProviderClass = DataSet.class)\n    @Description(\"User Login With ValidCredentials\")\n    @Severity(SeverityLevel.BLOCKER)\n    public void loginWithValidData(String phone_number, String pass){\n        loginPage.doLogin(phone_number, pass);\n        homePage.HoverElement(homePage.sign_in_hover);\n        Assert.assertTrue(homePage.is_element_visible(homePage.logout_hover_btn));\n    }\n}\n````\n## Reporting\n### Allure Reporting\nMake Sure allure dependencies are added to the POM.xml file. Then, Create a TestNG.xml File and set up a run method with a Thread count. Finally, run the test.\nAfter Completing the run test go to the terminal and execute this code:- \n````\n\nallure generate ./allure-results/ --clean\n\nallure open ./allure-report\n````\n### Surefire Reporting\nGo through the terminal or cmd and run this given code based on your requirements: \n````\n\nmvn test\nmvn test -Dbrowser=Chrome\nmvn test -Dbrowser=Chrome -DsuitFileName=\"testng.xml\"\n````\n## Report Screenshots\n\u003cimg width=\"675\" alt=\"Allure_Report\" src=\"https://github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report/blob/02c3e581ddcdccd7b048d9547af26368ebfbdac3/screenshots/Result%20SS-1.png\"\u003e\n\u003cimg width=\"675\" alt=\"Allure_Report\" src=\"https://github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report/blob/02c3e581ddcdccd7b048d9547af26368ebfbdac3/screenshots/Result%20SS-2.png\"\u003e\n\u003cimg width=\"675\" alt=\"Allure_Report\" src=\"https://github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report/blob/02c3e581ddcdccd7b048d9547af26368ebfbdac3/screenshots/Result%20SS-3.png\"\u003e\n\u003cimg width=\"675\" alt=\"Allure_Report\" src=\"https://github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report/blob/02c3e581ddcdccd7b048d9547af26368ebfbdac3/screenshots/Result%20SS-4.png\"\u003e\n\u003cimg width=\"675\" alt=\"Allure_Report\" src=\"https://github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report/blob/02c3e581ddcdccd7b048d9547af26368ebfbdac3/screenshots/Result%20SS-5.png\"\u003e\n\u003cimg width=\"675\" alt=\"Allure_Report\" src=\"https://github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report/blob/02c3e581ddcdccd7b048d9547af26368ebfbdac3/screenshots/Result%20SS-6.png\"\u003e\n\u003cimg width=\"675\" alt=\"Allure_Report\" src=\"https://github.com/Anik16298/Book_house_web_automation_using_selenium_with_allure_report/blob/02c3e581ddcdccd7b048d9547af26368ebfbdac3/screenshots/Result%20SS-7.png\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanik16298%2Fbook_house_web_automation_using_selenium_with_allure_report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanik16298%2Fbook_house_web_automation_using_selenium_with_allure_report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanik16298%2Fbook_house_web_automation_using_selenium_with_allure_report/lists"}