Giter VIP home page Giter VIP logo

1c-company / fxdriver Goto Github PK

View Code? Open in Web Editor NEW
16.0 4.0 9.0 31 KB

FxDriver is a driver for Selenium WebDriver project for testing JavaFX desktop applications. This project allows you to write system tests for a whole application, finds controls inside application windows and interacts with them. The project is a single jar file and you can attach it to your JavaFX application as a java agent.

License: Apache License 2.0

Java 100.00%
javafx selenium-webdriver selenium-java test-automation

fxdriver's Introduction

FxDriver - Selenium based JavaFX testing framework

Description

FxDriver is a driver for Selenium WebDriver project for testing JavaFX desktop applications. This project allows you to write system tests for a whole application, finds controls inside application windows and interacts with them. The project is a single jar file and you can attach it to your JavaFX application as a java agent.

Usage

  • Run your application with option: -javaagent:/path/to/fxagent.jar
  • This agent runs selenium server inside your application using port 4444 (you can change this: -javaagent:/path/to/fxagent.jar=port=5500)
  • Use RemoteWebDriver instance to connect to this server. Provide port number and browserName parameters. Example:
new RemoteWebDriver(new URL("http://localhost:4444/wd/hub/"), new DesiredCapabilities("javafx", "", Platform.ANY));
  • Use standard WebDriver methods for writing tests.

Features

  • Id and class name selectors are supported. css selector exists in experimental mode.
  • You can find element inside another element.
  • Mouse and keyboard interactions. Class "Actions" works as expected.
  • getAttributes returns a lot of useful properties:
    • Any JavaFX properties available by their names.
    • For any node tooltip property exists with the tooltip text
    • There is a progress property for the Progress Bar node. This property contains progress value. Integer value between 0 and 100. Progress -1 means infinite progress bar.
    • selected property available for CheckBox node. Two values are supported: true and false.
  • getWindowHandle() returns PID (Process ID) of application under test.
  • Works on both Java 8 and Java 9.

Classloading

As we know, Java loads agent classes using bootstrap classloader. That behaviour produces problems, because selenium server uses many classes from well known libraries, like guava. They will conflict with classes used in AUT. To avoid this problem, we use separate classloader. After application starts with agent parameter, it loads only one agent class using bootstrap classloader. Agent creates new class loader with fxdriver classes and sets parent classloader to bootstrap classloader. This is important, because application classloader contains AUT classes and we want to avoid conflicts.

fxdriver's People

Contributors

1c-company avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fxdriver's Issues

There is trouble with understand how to start using RxDriver

Hello, guys.

I try to use that driver but can't understand how.
So I added dependency for JavaFx (pom.xml) and all their modules and finally generated jar. So after that, I have a problem with start to use it. I have a web application that is written via JavaFx.
Could explain what should I do on that step?:

Run your application with option: -javaagent:/path/to/fxagent.jar

Would be helpful if you could explain the code more properly

Hello Everyone,
I have developed a JavaFx application which has a WebView component for logging in to the application which I want to automate. I'd used an existing solution where I had to call WebViewObject.getEngine().executeScript() and manually add the username and password from the HTML Class tags of the login page and then hit the login button, but this would never happen in sequential order, meaning the compiler always used to hit login button first and then the tried the enter username and password, which is definitely wrong.
Hence, Selenium popped up in my head and I just Googled it since I'm pretty much new to it and found this repository. I'll list some of my doubts and it would be helpful if anybody could help me.

  1. I want to automate the logging process which is WebView
  2. How would I make my existing project interact with this code?

Combobox values fetch set and scroll page

Hello
Facing issues in combo box reading and setting values .
Another issue we are facing application page has 50 fields and agent couldn't find elements after 18, will it scroll automatically and search elements with id or we have to do some actions..

I am struck here not confident with this driver till we move to next page.

Regards
Neeharika

Cannot start the agent because of ClassNotFoundException

Hi,

First, thank you for your work.

But I got some problems to start your java agent with my java fx jar.

When i start it, i got this error :

Exception in thread "Thread-1" java.lang.NoClassDefFoundError: org/openqa/grid/internal/utils/configuration/StandaloneConfiguration
at com._1c.qa.selenium.fxdriver.FxServer.lambda$start$0(FxServer.java:28)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.openqa.grid.internal.utils.configuration.StandaloneConfiguration
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 2 more

I checked the shaded jar and, for me, everything is fine, the class is here.

Do you have any idea why do i get this problem?

Thank you for your time.

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.