Skip to content

Commit 971a548

Browse files
committed
fluentize() added note
1 parent 67fc91b commit 971a548

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,25 @@ FileUtils.copyFile(src, new File(pathname));
361361

362362
As you can creenshots and any functions on the sub-classes of WebDriver are possible. There's no need to subclass FluentWebDriver to get access to WebDriver, you had it already.
363363

364+
### Turning a WebDriver WebElement into a FluentWebElement
365+
366+
```
367+
ChromeDriver driver = new ChromeDriver();
368+
369+
driver.get("http://seleniumhq.github.io/fluent-selenium/basic.html");
370+
371+
FluentWebDriver fwd = new FluentWebDriver(driver);
372+
373+
// Classic WebDriver
374+
WebElement div = driver.findElement(By.tagName("div"));
375+
376+
// carry on with FluentSelenium
377+
fwd.fluentize(div).span().getText().shouldBe("Hello");
378+
379+
driver.close();
380+
381+
```
382+
364383
## Fluently matching/filtering over multiple elements
365384

366385
Use a FluentMatcher instance (which is just a predicate)

java/src/test/java/org/seleniumhq/selenium/fluent/FluentizeTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ public class FluentizeTest {
1111
public void findElementViaWebDriverCanBeFluentized() {
1212
ChromeDriver driver = new ChromeDriver();
1313

14-
// fork of http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_eff_delay
1514
driver.get("http://seleniumhq.github.io/fluent-selenium/basic.html");
1615

1716
FluentWebDriver fwd = new FluentWebDriver(driver);

0 commit comments

Comments
 (0)