Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8954067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:14:01+00:00 2026-06-15T14:14:01+00:00

I have a SeleniumElement that represents a couple of elements on the page, and

  • 0

I have a SeleniumElement that represents a couple of elements on the page, and I would like to filter it to only include ":visible" elements.

I might be able to refine the original constructor to only contain one elemnent, but I’m asking if I can do something different: given a particular element, create a new element that filters on this element’s selector.

Something like this:

public static SeleniumElement visible(SeleniumElement element) {
    // Locator.filter() doesn't really exist, the next line won't compile
    By locator = element.getElementLocator().filter(":visible"); 
    return new SeleniumElement(element.getName(), locator, element.getPage());
}

visible(myButton).click();

// Calling myButton.click() fails because there are multiple elements that match
// the selector. However, only one of them is visible right now
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:14:03+00:00Added an answer on June 15, 2026 at 2:14 pm

    if you want to filter the elements via their visibility then Using CSS Selector would be a good choice.

    I have added both css properties Display and Visibility. Hence you can use any one property/attribute by which you can find the target element. (C# Code)

    IWebElement Query = driver.FindElement(By.XPath("Element Xpath")).FindElement(By.CssSelector("[@style='display: block;Visibility: hidden']"));
    

    I hope this helps. All the Best 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a look at the menu link Produkter on http://marckmann.se/ I would like to
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
have 2 questions : A computer with 32-bit address uses 2-level page table (9
have been trying couple of hours now to make my iphone app universal. The
Have a look at one of my websites: moskah.com The problem is that it
Have a simple contact us XPage created. Have server side validation in place that
have some headers like: HTTP/1.1 100 Continue HTTP/1.1 302 Found HTTP/1.1 200 OK HTTP/1.1
have a php code like this,going to convert it in to C#. function isValid($n){
Have one Doubt In MVC Architecture we can able to pass data from Controller
Have a network location that shows paths in the 8.3 short format. I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.