1

I have tried many codes but none worked for me.The site is built in Angular.

WebElement columnElement = driver.findElement(By.id("i301Indv"));
((JavascriptExecutor)getDriver()).executeScript(
    "arguments[0].scrollIntoView(true);", columnElement);


WebElement columnElement = driver.findElement(By.id("i301Indv"));
((JavascriptExecutor)getDriver()).executeScript(
    "arguments[0].scrollIntoView();", columnElement);


WebElement columnElement = driver.findElement(By.id("i301Indv"));
((JavascriptExecutor) driver).executeScript(
    "arguments[0].scrollLeft = arguments[0].offsetWidth", columnElement);

1 Answer 1

1

Try this:

Actions actions = new Actions(Webdriver);
actions.moveToElement(webElement).click().build().perform();

This will find the element, move to that element and perform the click operation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.