Frameworkium / frameworkium-core

Framework for writing maintainable Selenium and REST API tests in Java.
https://frameworkium.github.io/
Apache License 2.0
160 stars 82 forks source link

Click on non-visible links by default #356

Closed sridharaiyer closed 2 years ago

sridharaiyer commented 2 years ago

Description I am automating a web app where there are a lot of links that are visible when you scroll down. I want frameworkium to click on these links without having to use the forceVisible and executeJS block every time for this.

To Reproduce Steps to reproduce the behavior:

  1. Launch a web app where there a lot of links at the bottom only visible when you scroll down
  2. Use .click()
  3. See error: Link not clickable

Workaround You need to keep using this block to make the element and then click or perform any action on it -

        WebElement somelink = driver.findElement(By.linkText("some link"));
        forceVisible(somelink);
        executeJS("arguments[0].scrollIntoView(true);", somelink);
        somelink.click();

Expected Behaviour Should click on the link (or do any other action on an element) wherever it is located in the app (as long as it is enabled)

Screenshots If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

Mjl33 commented 2 years ago

It sounds like you need to wait for the links to be clickable. This is a Selenium related question, please post your question here https://groups.google.com/g/selenium-users

Note, forceVisible is only used when elements are permanently invisible