0

I have the page object as below:

@FindBy (className = "all-time-menu-icon")
private FluentWebElement enrichmentOptions;

/**
 * @return  FluentWebElement for Enrichment options
 */
public FluentWebElement getEnrichmentOptions() {
    return enrichmentOptions;
}

Now I want to call the above FluentWebElement getEnrichmentOptions() from the testcase with some waiting expected condition?

Please help with respect to the above scenario. Thanks In Advance.

1 Answers1

1

use wait like below:

await().atMost(5, TimeUnit.SECONDS).until("ur locator -- id or classname").withText("myText").hasSize(3);

or

await().atMost(5, TimeUnit.SECONDS).until("ur locator").withText("myText").hasText("TextValue");

or

await().atMost(5, TimeUnit.SECONDS).until("ur locator").withText("myText").isPresent();

you can also use

isNotPresent(), hasId("myId"), hasName("myName"), containsText("myName"),areDisplayed(), areEnabled().

Check the docs as well https://fluentlenium.com/

hennr
  • 2,632
  • 2
  • 23
  • 26
noor
  • 2,954
  • 2
  • 16
  • 29
  • Instead of using "ur locator" I want to use the getEnrichmentOptions() method (returning the fluentwebelement. Any help about this? – Sumit Chakraborty May 02 '16 at 09:55
  • u can send the instance of elements there also like this: await().atMost(5, TimeUnit.SECONDS).until(getEnrichmentOptions()).withText("myText").hasSize(3); – noor May 02 '16 at 10:21
  • the parameter for 'until' is not taking the fluentwebelement!! It asks for predicate . Actually I am facing the issue with passing the fluentwebelement the until is not accepting the FluentWebElement. – Sumit Chakraborty May 02 '16 at 10:31
  • have u import this:: import com.google.common.base.Predicate; – noor May 02 '16 at 10:41
  • just import this and this will be ok – noor May 02 '16 at 10:42