conductor-framework / conductor Goto Github PK
View Code? Open in Web Editor NEWThe Selenium framework that takes you where you want to go
License: Apache License 2.0
The Selenium framework that takes you where you want to go
License: Apache License 2.0
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.
It would be useful to have a .refresh() method handy!
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!
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
Does this work with headless webdrivers?
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?
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)
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)
Getting this error java.lang.NoSuchMethodError: org.openqa.selenium.support.ui.FluentWait.until(Lcom/google/common/base/Function;)Ljava/lang/Object;
FF 63.0.1
Selenium 3.4.0 -- also tried with Selenium 3.141.5(latest)
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>
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?
resources
folder. This would allow the project to work when packed into a JARIf 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.
The chrome executable isn't available as 32 bit anymore you should consider upgrading it.
The test is unable to find the iedriver downloaded from the wiki.
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
16:27:06.480 [main] FATAL io.ddavison.conductor.Locomotive - iedriver not found. See https://github.com/ddavison/getting-started-with-selenium-framework/wiki/WebDriver-Executables for more information.
Process finished with exit code 1
Empty test suite.
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?
Hey,
I'm following yours tutorial from here: https://www.airpair.com/selenium/posts/selenium-tutorial-with-java
and have a question:
Does Conductor support running tests in maximized Chrome browser shown on top of other windows? I start test from IntelliJ, can see in OSX dock that browser is opened but it's not on top, so I can't see how test is going (would be nice to see it during test creation). How can I enable this?
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
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.
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.
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
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>
On the WebDrier-Executables Wiki Page, under ChromeDriver and Mac Installation, the download script is broken.
https://gist.githubusercontent.com/ddavison/936d843ad17140021fad/raw/Mac.sh
The script has name hardcoded to chromedriver_mac32.zip
instead of using the key
param of the latest build.
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:
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?
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 ?
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
.switchToFrame(int) and .switchToFrame(String) are there, but not the overload for WebElement
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.