Giter Site home page Giter Site logo

Comments (17)

github-actions avatar github-actions commented on June 9, 2024

@UnileverGithub, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

from selenium.

github-actions avatar github-actions commented on June 9, 2024

Hi, @UnileverGithub.
Please follow the issue template, we need more information to reproduce the issue.

Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.

Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.

Reply to this issue when all information is provided, thank you.

from selenium.

UnileverGithub avatar UnileverGithub commented on June 9, 2024

Hi @diemol ,
https://www.a-squad.in/collections/all this is the URL

<java.version>11.0.19</java.version>
selenium
4.11.0
cucumber-java
7.6.0
webdrivermanager
5.4.1

from selenium.

diemol avatar diemol commented on June 9, 2024

As the comment above says, we need a way to reproduce this. We cannot just build the code. Please provide the code so we can triage this issue.

from selenium.

UnileverGithub avatar UnileverGithub commented on June 9, 2024

Here is the code:

package com.qa.PBBUsteps;

import java.time.Duration;

import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class ClickIssue {
	
	
	public static ThreadLocal<WebDriver> tlDriver = new ThreadLocal<>();
	
	
	public static void main(String[] args) throws InterruptedException
	{
		System.setProperty("webdriver.chrome.driver",
				"C:\\Users\\HX957FH\\Downloads\\chromedriver-win64\\chromedriver.exe");
		ChromeOptions options = new ChromeOptions();
		options.addArguments("--remote-allow-origins=*");
		
		tlDriver.set(new ChromeDriver(options));
		
		getDriver().manage().deleteAllCookies();
		getDriver().manage().window().maximize();
		getDriver().get("https://www.a-squad.in/");
		getDriver().manage().timeouts().pageLoadTimeout(Duration.ofSeconds(50));
		
		WebElement lnk_MenuOption = getDriver().findElement(By.xpath("//nav[@class='header__menu']//a[contains(@class,'SHOP ALL')]"));
		waitTillElementIsClickable(lnk_MenuOption);
		Actions actions = new Actions(getDriver());
		actions.moveToElement(lnk_MenuOption).build().perform();;
		
		WebElement txt_cartSkuPrice = getDriver().findElement(By.xpath("//nav[@class='header__menu']//a[contains(@class,'SHOP ALL')]/following-sibling::div//div[@class='header__dropdown__inner_text']//div[contains(@class,'a-squad_nav')]//span/a[text()='View All']"));
		waitTillElementIsClickable(txt_cartSkuPrice);
		txt_cartSkuPrice.click();
		
		for(int i=0;i<4;i++)
		{
			JavascriptExecutor js = (JavascriptExecutor) getDriver();
			js.executeScript("window.scrollBy(0,500)", "");
			Thread.sleep(2000);
		}
		WebElement btn_addToBag = getDriver().findElement(By.xpath("//section[@class='collection collection-all']//div[@data-variant-id='46424522260753']//button[@data-collection-handle='all']"));
		Thread.sleep(10000);
		waitTillElementIsClickable(btn_addToBag);
		btn_addToBag.click();
		
		WebElement cartSlider = getDriver().findElement(By.xpath("//div[@id='cart-dropdown' and @class[contains(.,'is-open')]]"));
		cartSlider.isDisplayed();
	}
	
	public static void waitTillElementIsClickable(WebElement element)
	{
		WebDriverWait wait = new WebDriverWait(getDriver(), Duration.ofSeconds(20));
		wait.until(ExpectedConditions.elementToBeClickable(element));
	}
	
	public static synchronized WebDriver getDriver() {
		return tlDriver.get();
	}

}

Sorry for the delay.

from selenium.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.