Git Product home page Git Product logo

findelementinframes's Introduction

FindElementInFrames

Run tests status

Coverage Status

MIT LicenseFree

Helper can find an element through all frames that represent on page

Dependency: Maven

<dependency>
  <groupId>com.github.nick318</groupId>
  <artifactId>findelement</artifactId>
  <version>2.0</version>
</dependency>

Gradle

implementation 'com.github.nick318:findelement:2.0'

Examples:

//setup once
SearchByFramesFactory searchFactory = new SearchByFramesFactory(driver);

//use in different places
SearchByFrames searchInFrame = searchFactory.search(locator);
Optional<WebElement> elem = searchInFrame.getElem();
elem.ifPresent(WebElement::click);

SearchByFrames searchInFrame = searchFactory.search(() -> driver.findElement(By.tagName("body")));
Optional<WebElement> elem = searchInFrame.getElem();

This library can be used with Selenide. All you need to do is to write a wrapper. Look for details in SelenideExamples.java

As you may noticed you can put a Supplier of WebElement as a constructor parameter, it will be invoked during search in frames.

All synchronization logic should not be placed here, it is responsibility of user.

More examples you can find in tests directory.

findelementinframes's People

Contributors

dependabot[bot] avatar

Stargazers

 avatar Vikas Vashisth avatar Mohit Saxena avatar rultor.com avatar

Watchers

James Cloos avatar Nikita avatar

Forkers

flashcsgroups

findelementinframes's Issues

It fails to search with selenide

Fails because selenide waits up to 4 seconds for each invoke of method. So we should make our's timeout for any invoke for #isExist() method

FindElementInFrames sendKeys

Hello,

I am new to GitHub - so please go easy. I have been having great issues interacting with BusinessObjects and iframes within it.

Using SearchByFramesFactory, I have been able to navigate as far as clearing the text from a text field within BusinessObjects;

SearchByFrames searchInFrame = searchFactory.search(By.xpath("//*[@id="D.IF1_txt"]"));
Optional elem = searchInFrame.getElem();
elem.ifPresent(WebElement::clear);

But now I want to input text via the same method that I have just used above to clear the text. How do I utilize the same above code to sendKeys?

Thanks in advance,

Graeme.

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.