Giter Club home page Giter Club logo

conductor's People

Contributors

colatkinson avatar ddavison avatar dependabot[bot] avatar hazmeister avatar supernevi avatar

Stargazers

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

Watchers

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

conductor's Issues

Using Browser.SAFARI

Hello,

first of all: thanks for this smart Selenium hop on.
I tried to use your framework but stumbled over the following configuration

@config(browser = Browser.SAFARI, url = "THE URL")

When I tried to run the selenium test, I got the following error:

[main] FATAL io.ddavison.conductor.Locomotive - safaridriver not found. See https://github.com/ddavison/conductor/wiki/WebDriver-Executables for more information.

On the suggested page, only the Chrome WebDriver Executable is described.

=> Does this mean: Only Chrome is supported yet?
=> How to use any other browser, defined as constant within the class Browser, like Browser.SAFARI?

Thanks in advance for any hints and information.

add #refresh()

It would be useful to have a .refresh() method handy!

Long Press/Mouse Down

Hello! I was wondering if there is an equivalent to mouse up and mouse down? I am trying to simulate a long press of an item and find the simple click handler to not be sufficient. Thanks in advance for your time!

Chrome WebDriverException (Mac)

Hi! I am having a problem running the example code here is the error:

org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:40688 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'user.mackbook.local', ip: 'fd5d:12c9:2201:1:0:0:0:1f9', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_121'
Driver info: driver.version: RemoteWebDriver
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:91)
	at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
	at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:364)
	at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:945)
	at io.ddavison.conductor.Locomotive.<init>(Locomotive.java:188)
	at com.sonar.FrameworkTest.<init>(FrameworkTest.java:9)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:187)
	at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:40688 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
	at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:157)
	at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:87)
	at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:161)
	at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
	... 27 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
	... 40 more

PhantomJSTests all fail

What is the point of communication / support for conductor-framework?

I posted this issue: https://stackoverflow.com/questions/46583156/conductor-framework-3-0-1-does-not-support-phantomjs on Stackoverflow.

Conductor 3.0.1 refers to selenium 3.4.0 and phantomjs 1.2.1. For this version the PhantomJSTests fail because of this Selenium issue: SeleniumHQ/selenium#3534

Using the latest selenium 3.6.0 and phantomjs 1.4.0 does not pass them either because of this Selenium issue: SeleniumHQ/selenium#4781

I have had success with Selenium 3.5.3 and PhantomJS 1.4.0

Is PhantomJS supported by Conductor? If so why was 3.0.1. released with failing PhantomJS Tests?

static{} initializer block failing on Windows (or projects that don't have chromedriver)

java.lang.ExceptionInInitializerError
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
    at org.junit.runners.BlockJUnit4ClassRunner.createTest(BlockJUnit4ClassRunner.java:187)
    at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:211)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:459)
    at java.util.Properties.setProperty(Properties.java:166)
    at java.lang.System.setProperty(System.java:793)
    at io.ddavison.selenium.AutomationTest.<clinit>(AutomationTest.java:137)

Allow launch options as part of Config

I have been unable to find a way with the default Conductor setup to pass launch configurations to the browser with the Configs, like one would normally do with the Options classes.

My proposed solution may look something like:

@Config(browser = Browser.CHROME, url="http://ddavison.io/tests/getting-started-with-selenium.htm", options="--headless")

instead of the current solution of:

 ChromeOptions options = new ChromeOptions();
 options.addArguments("--headless");
 WebDriver driver = new ChromeDriver(options);

(I understand that there are already headless webdrivers, this is just a simple example. There are many other launch options that would be useful)

Missing dependency

Hi,
I think you should mention in the documentation that conductor requires xml-apis :)


<dependency>
    <groupId>xml-apis</groupId>
    <artifactId>xml-apis</artifactId>
    <version>1.4.01</version>
</dependency>

Install WebDrivers automatically

As of right now, the framework requires manual installation of platform-appropriate WebDrivers. There is a Maven plugin that handles this exact problem.

Would you consider any of the following as acceptable changes to the framework?

  1. Integrating with this plugin. As of right now, my solution to getting the two to work together involves some hacky bash scripting
  2. Loading the drivers from the resources folder. This would allow the project to work when packed into a JAR

If there are established solutions to these problems, I apologize, but I couldn't find any. I would be more than willing to work on a PR.

NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;

Hello,

i tried the following:

@Test public void testLanguageSelection() { click(Elements.LOC_LNK_SELECTLANGUAGE) .validatePresent(Elements.LOC_LNK_LANGUAGEMENUE) ; }

This does not work, a NoSuchMethodError Exception appears:

java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.WebDriverWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object; at io.ddavison.conductor.Locomotive.waitForCondition(Locomotive.java:279) at io.ddavison.conductor.Locomotive.waitForCondition(Locomotive.java:274) at io.ddavison.conductor.Locomotive.waitForCondition(Locomotive.java:264) at io.ddavison.conductor.Locomotive.click(Locomotive.java:288) at io.ddavison.conductor.Locomotive.click(Locomotive.java:284) at test.SideTest.testLanguageSelection(SideTest.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

I tried other links, the error stays the same. Is it not possible to click a link? Or is it a bug?

Change back to Java to 1.6

We are using server with Java 6. I think until the linux server is upgrade, we will have to stick with it for a while

README.md and Wiki driver instructions conflict

The readme says to place drivers in resources folder, the wiki says to put them in project root.

When the driver is missing, a nondescript error comes up with a wiki link, but the exception is swallowed and the 'file not found' information is lost.

stale element crashes

I regularly get errors like:

[INFO ] 2017-11-17 14:14:59.927 [pool-4-thread-2] QueryWorker - stale element reference: element is not attached to the page document
  (Session info: headless chrome=62.0.3202.94)
  (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/stale_element_reference.html

do you recognize them? Any ideas how to approach them?

Currently I just restart the thread and try again, eventually I am able to scrape the data off the target website but I have the feeling I use the wrong approach.

add selectOptionByIndex

Hello,

selectOptionByIndex would be a very useful addition. The drawback with "selectOptionByText" is that one needs to know the exact text to choose. "selectOptionByIndex(1)" could be copy / pasted, which is quite handy.

Cheers from Germany

PS: Also there is a typo on this page: http://conductor.ddavison.io/get-started/ : "At it’s heart" should be "At its heart". And the maven version on this page is not the latest

FATAL error.

I continue to receive this error:
16:08:40.164 [main] FATAL io.ddavison.conductor.Locomotive - Also see https://github.com/conductor-framework/conductor/wiki/WebDriver-Executables

Process finished with exit code 1

I have my dependencies as follows
<dependencies> <dependency> <groupId>io.ddavison</groupId> <artifactId>conductor</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.0.1</version> </dependency>

Chromedriver causes Entry Point Not Found error

I am trying to use this package on Windows Server 2003. This is also why I use version 1.1 of this package.

The problem I am having is that it can't find the google chrome driver as it errors on opening.
See screenshot:
afbeelding

But I am not able to find a Chromedriver that also works on Windows Server 2003 or how to fix this error.
Do you know how to fix this?

HTMLUnit Driver

I see the HTMLUNIT value in the Browser enum, but it seems the switch statement in Locomotive is missing a case for it.

It shows in the README.md that HtmlUnit is supported,

How might one use HtmlUnit ?

Locomotive with PageObject pattern?

Hi,

I am currently learning about writing Selenium Integration Tests, and came across the PageObject design pattern (https://github.com/SeleniumHQ/selenium/wiki/PageObjects). I like the idea of extracting individual page behaviour and build a PageObject class extending Locomotive. My colleagues have voices concerns that your library is meant to extend the test class, rather than objects within it. For context, I am only a trainee at the moment, so please feel free to point out obvious mistakes in my reasoning.

I find your library incredibly convenient to use, but am now unsure whether I should use it with this pattern. Can you provide some guidance on this?

Much Appreciated,
Alex

While instaling on Linux Mint (Ubuntu/Debian) I have following error

Archive: /tmp/chromedriver_linux32.zip
inflating: ./chromedriver
sh: 15: Syntax error: "}" unexpected

More detailed console output looks like that:
root@MyComp ~/repos $ \curl -k https://gist.githubusercontent.com/ddavison/936d843ad17140021fad/raw/ff4029d8e3874dc4e3d635bc1904a77d65032ce7/Linux32.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 532 100 532 0 0 1304 0 --:--:-- --:--:-- --:--:-- 1307
sh: 6: function: not found
rm: can not be deleted '/tmp/chromedriver_linux32.zip': There is no such file or directory
--2017-11-13 08:44:49-- http://chromedriver.storage.googleapis.com/2.9/chromedriver_linux32.zip
Translacja chromedriver.storage.googleapis.com (chromedriver.storage.googleapis.com)... 172.217.20.176, 2a00:1450:401b:802::2010
Łączenie się z chromedriver.storage.googleapis.com (chromedriver.storage.googleapis.com)|172.217.20.176|:80... connected.
Żądanie HTTP wysłano, oczekiwanie na odpowiedź... 200 OK
Długość: 2405487 (2,3M) [application/zip]
Zapis do: `/tmp/chromedriver_linux32.zip'

chromedriver_linux32.zip 100%[=========================================================================================================================================>] 2,29M 1,54MB/s in 1,5s

2017-11-13 08:44:51 (1,54 MB/s) - zapisano `/tmp/chromedriver_linux32.zip' [2405487/2405487]

Archive: /tmp/chromedriver_linux32.zip
inflating: ./chromedriver
sh: 15: Syntax error: "}" unexpected

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.