{"id":24184513,"url":"https://github.com/lailasumiyakhan/automation_testing_selenium","last_synced_at":"2026-04-24T21:33:40.637Z","repository":{"id":271982179,"uuid":"911061319","full_name":"LailaSumiyaKhan/Automation_Testing_Selenium","owner":"LailaSumiyaKhan","description":"This project demonstrates automation of an e-commerce website using Selenium WebDriver with Node.js.","archived":false,"fork":false,"pushed_at":"2025-02-02T04:43:32.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T05:24:19.691Z","etag":null,"topics":["automation","selenium","selenium-webdriver"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/LailaSumiyaKhan.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-02T06:42:13.000Z","updated_at":"2025-02-02T04:43:36.000Z","dependencies_parsed_at":"2025-01-18T03:32:29.505Z","dependency_job_id":null,"html_url":"https://github.com/LailaSumiyaKhan/Automation_Testing_Selenium","commit_stats":null,"previous_names":["lailasumiyakhan/automation_testing_selenium"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LailaSumiyaKhan%2FAutomation_Testing_Selenium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LailaSumiyaKhan%2FAutomation_Testing_Selenium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LailaSumiyaKhan%2FAutomation_Testing_Selenium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LailaSumiyaKhan%2FAutomation_Testing_Selenium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LailaSumiyaKhan","download_url":"https://codeload.github.com/LailaSumiyaKhan/Automation_Testing_Selenium/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241584254,"owners_count":19986110,"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":["automation","selenium","selenium-webdriver"],"created_at":"2025-01-13T10:15:28.408Z","updated_at":"2026-04-24T21:33:40.608Z","avatar_url":"https://github.com/LailaSumiyaKhan.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Selenium E-Commerce Automation\n\nThis project demonstrates automation of an e-commerce website using Selenium WebDriver with Node.js. The script performs the following steps:\n\n## Features\n\n1. **Navigate to the website**: Opens the demo e-commerce website.\n2. **Search for a product**: Searches for the product `Nike react phantom` using the search bar.\n3. **Retrieve product price**: Extracts the price of the product.\n4. **Interact with product options**:\n   -  Selects size (`X`).\n   -  Selects color (`Black`).\n5. **Modify quantity**: Clears the quantity input and sets it to `3`.\n6. **Add to cart**: Adds the product to the cart.\n7. **Navigate to cart and checkout**: Opens the cart and proceeds to checkout.\n\n### Project Preview\n\n1. **Execution** - [Watch the video](https://youtu.be/nsmIfG_ex7I)\n\n## Prerequisites\n\nBefore running the project, ensure the following are installed:\n\n1. **Node.js**: [Download and install Node.js](https://nodejs.org/).\n2. **Google Chrome**: Install the latest version of Chrome.\n3. **ChromeDriver**: Ensure ChromeDriver is installed and matches your Chrome version. It can be installed via `npm`:\n   ```bash\n   npm install chromedriver\n   ```\n4. **Selenium WebDriver**: Install Selenium for Node.js:\n   ```bash\n   npm install selenium-webdriver\n   ```\n\n## Installation\n\n1. Clone this repository:\n   ```bash\n   git clone https://github.com/LailaSumiyaKhan/Automation_Testing_Selenium.git\n   cd \u003crepository-folder\u003e\n   ```\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n## Usage\n\n1. Save the script as `automation.js` in the project directory.\n2. Run the script using Node.js:\n   ```bash\n   node automation.js\n   ```\n3. Observe the automated browser actions.\n\n## Script Details\n\n### Steps Performed\n\n1. **Open the Website**\n\n   -  Opens the demo e-commerce website using Selenium WebDriver.\n\n   ```javascript\n   await driver.get(\"https://demo.evershop.io/\");\n   ```\n\n2. **Search for a Product**\n\n   -  Clicks the search icon and searches for `Nike react phantom`.\n\n   ```javascript\n   await driver.findElement(By.className(\"search-icon\")).click();\n   await driver\n      .findElement(By.xpath(\"//input[@placeholder='Search']\"))\n      .sendKeys(\"Nike react phantom\", Key.RETURN);\n   ```\n\n3. **Retrieve Product Price**\n\n   -  Extracts the product price using XPath.\n\n   ```javascript\n   const price = await driver\n      .findElement(\n         By.xpath(\n            \"//div[contains(. , 'Nike react phantom run flyknit 2')]/following-sibling::div/div/span\"\n         )\n      )\n      .getText();\n   console.log(\"price is: \", price);\n   ```\n\n4. **Interact with Product Options**\n\n   -  Selects size and color options.\n\n   ```javascript\n   await driver.findElement(By.xpath(\"//a[text()='X']\")).click();\n   await driver.sleep(3000);\n   await driver.findElement(By.xpath(\"//a[text()='Black']\")).click();\n   ```\n\n5. **Modify Quantity and Add to Cart**\n\n   -  Clears the quantity input, sets it to `3`, and clicks the \"Add to Cart\" button.\n\n   ```javascript\n   await driver.findElement(By.xpath(\"//input[@name='qty']\")).clear();\n   await driver.findElement(By.xpath(\"//input[@name='qty']\")).sendKeys(\"3\");\n   const button = await driver.findElement(\n      By.xpath(\n         \"//button[contains(@class, 'primary') and span[text()='ADD TO CART']]\"\n      )\n   );\n   await button.click();\n   ```\n\n6. **Navigate to Cart and Checkout**\n   -  Opens the cart and proceeds to checkout.\n   ```javascript\n   await driver\n      .findElement(By.xpath(\"//a[contains(text(), 'VIEW CART (1)')]\"))\n      .click();\n   await driver\n      .findElement(By.xpath(\"//span[contains(text(), 'CHECKOUT')]\"))\n      .click();\n   ```\n\n## Notes\n\n-  The script uses explicit sleeps (`await driver.sleep()`) to allow for UI updates. For better performance, replace these with WebDriver explicit waits where applicable.\n-  Ensure that the demo website is accessible and its structure matches the XPath locators used.\n\n## Dependencies\n\n-  [Selenium WebDriver](https://www.npmjs.com/package/selenium-webdriver)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flailasumiyakhan%2Fautomation_testing_selenium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flailasumiyakhan%2Fautomation_testing_selenium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flailasumiyakhan%2Fautomation_testing_selenium/lists"}