An implementation of darcy-web that uses Selenium WebDriver as the automation library backend.

Overview

darcy-webdriver

Build Status Coverage Status Stories in Ready

An implementation of darcy-ui and darcy-web that uses Selenium WebDriver as the automation library backend.

maven

<dependency>
    <groupId>com.redhat.darcy</groupId>
    <artifactId>darcy-webdriver</artifactId>
    <version>0.4.0-SNAPSHOT</version>
</dependency>

To use snapshot versions, you'll need Sonatype's snapshot repo in your pom or settings.xml.

<repositories>
    <repository>
        <id>central-snapshots</id>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        <releases><enabled>false</enabled></releases>
        <snapshots><enabled>true</enabled></snapshots>
    </repository>
</repositories>

getting started

Check out the darcy tutorials, which use darcy-webdriver as the implementation.

Comments
  • Cleanup WebDriver, WebElement, and Alert targetting

    Cleanup WebDriver, WebElement, and Alert targetting

    Issues I had:

    • TargetedWebDriverFactory was redundant with TargetLocator interface
    • WebDriverAlert worked differently than Browser and Elements (though you could argue it was simpler if only less consistent)
    • CachingTargetLocator did not cache an alert target.
    opened by alechenninger 8
  • Versioning when bumping Selenium WebDriver dependency

    Versioning when bumping Selenium WebDriver dependency

    Talking with @jvervaec this morning, the discussion of Selenium WebDriver version bumps came up. Occasionally there is a PR for bumping the version of WebDriver that gets merged in hopes of fixing some issues a particular consumer may be having with such things as what versions of Firefox a certain WebDriver build supports. Sometimes the most recent WebDriver version is backwards compatible with a certain number of Firefox versions but other times, WebDriver cuts support for older versions of Firefox that consumers may still be using reliably.

    The main issue here is that when the WebDriver dependency is bumped and merged, the darcy-webdriver version remains the same even though I can see that making some sense since it's SNAPSHOT'd. However, if someone was doing just fine on something like darcy-webdriver 0.3.2-SNAPSHOT that used selenium-webdriver 2.50.0 but then WebDriver was bumped and darcy-webdriver remained 0.3.2-SNAPSHOT they may run into issues when using the latest artifact.

    In my opinion, I think that there should be some sort of darcy-webdriver version bump as well when the WebDriver dependency is bumped so as to avoid consumers running into possible compatibility issues that may arise unknowingly. I was taking a look at semver.org to try and get an idea of what should be bumped and my guess would be either the MINOR or PATCH version. Either way, I believe there should be a bump in there somewhere.

    opened by dmcneil 5
  • Exception transitioning to view in new context

    Exception transitioning to view in new context

    Given Synq.after(someElement::click) .expect(transition().to(new View()).inNewContext())
    .waitUpTo(10, ChronoUnit.SECONDS);

    Throws com.redhat.darcy.ui.DarcyException: Cannot find contexts of type: interface com.redhat.darcy.ui.api.FindableElementContext at com.redhat.darcy.webdriver.internal.TargetedWebDriverParentContext.findByView(TargetedWebDriverParentContext.java:112) at com.redhat.darcy.webdriver.internal.DelegatingWebContext.findByView(DelegatingWebContext.java:356) at com.redhat.darcy.webdriver.WebDriverBrowser.lambda$29(WebDriverBrowser.java:317) at com.redhat.darcy.webdriver.WebDriverBrowser$$Lambda$64/1060042118.get(Unknown Source) at com.redhat.darcy.webdriver.WebDriverBrowser.attemptAndGet(WebDriverBrowser.java:342) at com.redhat.darcy.webdriver.WebDriverBrowser.findByView(WebDriverBrowser.java:317) at com.redhat.darcy.ui.By$ByView.find(By.java:520) at com.redhat.darcy.web.internal.AbstractWebSelection.contextOfType(AbstractWebSelection.java:43) at com.redhat.darcy.ui.api.ContextSelection.elementContext(ContextSelection.java:44) at com.redhat.darcy.ui.internal.NewContextTransitionEvent.(NewContextTransitionEvent.java:36) at com.redhat.darcy.ui.internal.SimpleTransitionEvent.inNewContext(SimpleTransitionEvent.java:57) at com.redhat.darcy.ui.internal.SimpleTransitionEvent.inNewContext(SimpleTransitionEvent.java:47)

    bug 
    opened by jvervaec 5
  • Use selenium 3.4.0

    Use selenium 3.4.0

    #72

    FYI, it looks a number of the BrowserDriver constructors have been deprecated in selenium 3. Probably should also deprecate those in the darcy browser factories, but let me know what you think.

    opened by jvervaec 3
  • Use selenium 2.53.1

    Use selenium 2.53.1

    This allows us to use FF47.

    The SessionNotFoundException I removed was changed to extend NoSuchSessionException and was deprecated. It's replacement NoSuchSessionException is a subclass of NotFoundException.

    opened by abocz 3
  • Synq MultiEvents might break WebDriver

    Synq MultiEvents might break WebDriver

    MultiEvents spin up separate threads for each event. WebDriver is not thread safe. This could be a big problem if both events are interacting with the driver.

    bug 
    opened by alechenninger 3
  • Handle StaleElementReferenceExceptions

    Handle StaleElementReferenceExceptions

    Because there is a lot of element caching going on in the webdriver module, it is conceivable that StaleElementReferenceExceptions could become an issue.

    We need to evaluate if it's an issue worth solving, and if so how best to solve it.

    enhancement 
    opened by alechenninger 3
  • Some class names are really verbose

    Some class names are really verbose

    Inspired from the Dart style guide,

    If you really find yourself wanting lines longer than 80 characters, our experience is that your code is likely too verbose and could be a little more compact. Do you really need to call that class AbstractWidgetFactoryManagerBuilder?

    refactor 
    opened by alechenninger 3
  • Add Selenium 3 support

    Add Selenium 3 support

    Selenium 3 has been out for awhile now. It appears to have lots of useful new features. Selenium 2 also seems to have stopped supporting Firefox versions greater than 47.

    Feel free to assign this one to me. Will open a PR shortly.

    opened by jvervaec 2
  • General code quality fix-1

    General code quality fix-1

    This pull request is focused on resolving occurrences of Sonar rules squid:S1155 - Collection.isEmpty() should be used to test for emptiness. squid:S2293 - The diamond operator ("<>") should be used. squid:S2259- Null pointers should not be dereferenced. You can find more information about the issue here: https://dev.eclipse.org/sonar/rules/show/squid:S1155 https://dev.eclipse.org/sonar/rules/show/squid:S2293 https://dev.eclipse.org/sonar/rules/show/squid:S2259

    Please let me know if you have any questions.

    Faisal Hameed

    opened by faisal-hameed 2
  • Code quality fix - The members of an interface declaration or class should appear in a pre-defined order.

    Code quality fix - The members of an interface declaration or class should appear in a pre-defined order.

    This pull request is focused on resolving occurrences of Sonar rule squid:S1213 - The members of an interface declaration or class should appear in a pre-defined order. You can find more information about the issue here: https://dev.eclipse.org/sonar/rules/show/squid:S1213

    Please let me know if you have any questions.

    Faisal Hameed

    opened by faisal-hameed 2
  • Code quality fix -

    Code quality fix - "equals(Object obj)" and "hashCode()" should be overridden in pairs.

    This pull request is focused on resolving occurrences of Sonar rule squid:S1206- "equals(Object obj)" and "hashCode()" should be overridden in pairs You can find more information about the issue here: https://dev.eclipse.org/sonar/rules/show/squid:S1206

    Please let me know if you have any questions.

    Faisal Hameed

    opened by faisal-hameed 2
  • Sample Project in PageObject

    Sample Project in PageObject

    Thank you for open sourcing such a awesome project. There is so much to learn from project,

    It would be great if you can add some sample project that anyone can follow along.

    Thank you and keep up the great work!

    Happy New Year!!

    ready 
    opened by sayems 1
  • Improve toString on elements

    Improve toString on elements

    The result can produce exceptions which are a little hairy to understand:

    FAILED: [REDACTED]
    com.redhat.darcy.ui.FindableNotPresentException: Can't interact with something if it is not present.
    Tried to interact with a A WebDriverLink backed by, An element found nested within another element.
    The parent element is a A WebDriverElement backed by, An element found nested within another element.
    The parent element is a A WebDriverElement backed by, An element found nested within another element.
    The parent element is a A WebDriverElement backed by, An element found via, By.xpath: //div[contains(concat(' ', normalize-space(@class), ' '),' bRelatedList ')][.//td[@class='pbTitle']//*[text() = '[REDACTED]']]
    in search context, com.redhat.darcy.webdriver.internal.ForwardingTargetedWebDriver@4729d1.
    The locator to find the child element is ByXPath: {xpath='.//div[@class='pbBody']/table'}.
    The locator to find the child element is ByXPath: {xpath='./tbody/tr[2]/td[1]'}.
    The locator to find the child element is ByLinkText: {linkText='Del'}
            at com.redhat.darcy.webdriver.elements.WebDriverElement.webElement(WebDriverElement.java:205)
            at com.redhat.darcy.webdriver.elements.WebDriverElement.attempt(WebDriverElement.java:158)
            at com.redhat.darcy.webdriver.elements.WebDriverElement.click(WebDriverElement.java:87)
            at com.redhat.darcy.salesforce.StandardActions$$Lambda$135/1517758613.run(Unknown Source)
            at com.redhat.synq.ActionEvent.waitUpTo(ActionEvent.java:42)
            at com.redhat.synq.ActionEvent.waitUpTo(ActionEvent.java:31)
            at com.redhat.synq.SequentialEvent.waitUpTo(SequentialEvent.java:48)
            at com.redhat.synq.Event.waitUpTo(Event.java:131)
            at com.redhat.darcy.salesforce.StandardActions.lambda$delete$1(StandardActions.java:45)
    
    enhancement ready 
    opened by alechenninger 0
  • Throw an error if invalid path is used with file selects

    Throw an error if invalid path is used with file selects

    FirefoxDriver won't type something into a file select box that isn't an absolute path. I'm not sure if other drivers work this way, but we should investigate and throw an appropriate exception in cases of unsupported input, instead of simply doing nothing (which is webdriver's default behavior).

    enhancement ready 
    opened by alechenninger 0
  • Functional tests

    Functional tests

    I'm not incredibly happy with the unit tests.

    Besides that many had to just be eliminated due to refactorings and have not yet been replaced, I think we need functional tests too. This can present edge cases more naturally and actually catch real bugs before they are found by real users.

    Need...

    • Decide on a WebDriver implementation to test against. Many of them? Firefox? PhantomJS? HTMLUnit?
    • Configuration to run real browsers - Travis can integrate with SauceLabs.
    • Test pages
    • Code abstractions for accessing these test resources, starting and closing browsers
    • The tests
    ready tests 
    opened by alechenninger 4
Owner
darcy framework
Darcy is an open source Java 8 framework for modeling user interfaces as page objects with a declarative, automation-library-agnostic DSL.
darcy framework
Automated driver management for Selenium WebDriver

WebDriverManager is a library which allows to automate the management of the drivers (e.g. chromedriver, geckodriver, etc.) required by Selenium WebDr

Boni García 2.2k Dec 30, 2022
This is public repository for Selenium Learners at TestLeaf

Selenium WebDriver Course for March 2021 Online Learners This is public repository for Selenium Learners at TestLeaf. Week1 - Core Java Basics How Jav

TestLeaf 86 Dec 29, 2022
Open Source Web Crawler for Java

crawler4j crawler4j is an open source web crawler for Java which provides a simple interface for crawling the Web. Using it, you can setup a multi-thr

Yasser Ganjisaffar 4.3k Jan 3, 2023
A scalable web crawler framework for Java.

Readme in Chinese A scalable crawler framework. It covers the whole lifecycle of crawler: downloading, url management, content extraction and persiste

Yihua Huang 10.7k Jan 5, 2023
Apache Nutch is an extensible and scalable web crawler

Apache Nutch README For the latest information about Nutch, please visit our website at: https://nutch.apache.org/ and our wiki, at: https://cwiki.apa

The Apache Software Foundation 2.5k Dec 31, 2022
Ready-to-use UI Test Automation Architecture using Java and Selenium WebDriver.

Selenium Test Automation Boilerplate Ready-to-use UI Test Automation Architecture using Java and Selenium WebDriver. Languages and Frameworks The proj

Tahanima Chowdhury 133 Dec 26, 2022
A sample repo to help you handle basic auth for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to handle basic auth for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - htt

null 12 Jul 13, 2022
A sample repo to help you run automation test in incognito mode in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to run automation test in incognito mode in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - htt

null 12 Jul 13, 2022
A sample repo to help you handle cookies for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to handle cookies for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - https:

null 13 Jul 13, 2022
A sample repo to help you set geolocation for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to set geolocation for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows - https

null 12 Jul 13, 2022
A sample repo to help you capture JavaScript exception for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to capture JavaScript exception for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Wi

null 12 Jul 13, 2022
A sample repo to help you find an element by text for automation test in Java-selenium on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to find an element by text for automation test in Java-selenium on LambdaTest Prerequisites Install and set environment variable for java. Windows

null 12 Jul 13, 2022
A sample repo to help you emulate network conditions in Java-selenium automation test on LambdaTest. Run your Java Selenium tests on LambdaTest platform.

How to emulate network conditions in Java-selenium automation test on LambdaTest Prerequisites Install and set environment variable for java. Windows

null 12 Jul 13, 2022
jQuery-like cross-driver interface in Java for Selenium WebDriver

seleniumQuery Feature-rich jQuery-like Java interface for Selenium WebDriver seleniumQuery is a feature-rich cross-driver Java library that brings a j

null 69 Nov 27, 2022
Automated driver management for Selenium WebDriver

WebDriverManager is a library which allows to automate the management of the drivers (e.g. chromedriver, geckodriver, etc.) required by Selenium WebDr

Boni García 2.2k Dec 30, 2022
A collection of bite size examples for using chrome DevTools protocol commands with Selenium Webdriver v4.

selenium-devtools-guide A collection of bite size examples for using chrome DevTools protocol commands with Selenium Webdriver v4. Chrome Devtools Pro

Sudharsan Selvaraj 4 Aug 12, 2021
This repository contains example codes which will help you to know how to use selenium webdriver.

❓ What is this Repository about? This repo has example codes with Selenium 4 features. Websites used for testing are: automationpractice.com, saucedem

Mohammad Faisal Khatri 86 Dec 30, 2022
Selenium Webdriver: Page Object Model (POM) With Page Factory

Prepare Web Testing Instance or Environment Selenium Webdriver: Page Object Model (POM) With Page Factory Prerequisite software Download & Install JDK

Hiro Mia 14 Oct 18, 2022
Ghost Driver is an implementation of the Remote WebDriver Wire protocol, using PhantomJS as back-end

Ghost Driver is an implementation of the Remote WebDriver Wire protocol, using PhantomJS as back-end

Ivan De Marino 1.9k Dec 15, 2022
Lightweight installer written in java, made for minecraft mods, The installer uses JPanel and uses a URL to install to the specific area (Discord URL's work the best i've seen)

InstallerForJava Lightweight installer written in java, made for minecraft mods, The installer uses JPanel and uses a URL to install to the specific a

null 18 Dec 9, 2022