Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stderr spam caused by ExpectedConditions and FluentWait #3552

Closed
rdicroce opened this issue Feb 21, 2017 · 0 comments
Closed

stderr spam caused by ExpectedConditions and FluentWait #3552

rdicroce opened this issue Feb 21, 2017 · 0 comments

Comments

@rdicroce
Copy link

Meta -

OS:
Windows 10
Selenium Version:
3.1.0
Browser:
Chrome
Browser Version:
56.0.2924.87

Expected Behavior -

ExpectedConditions should not spam stderr with warnings caused by exceptions that occur during a wait.

Actual Behavior -

ExpectedConditions spams stderr. This did not happen in 3.0.1.

Steps to reproduce -

Do something like

new WebDriverWait(driver, 10).until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(cssSelector)));

with an element that gets added to the page at some point after the first time Selenium polls the page.

An exception like this will be printed to stderr (or wherever your logging config for Selenium points to):

Feb 21, 2017 5:27:51 PM org.openqa.selenium.support.ui.ExpectedConditions findElement
WARNING: WebDriverException thrown by findElement(By.cssSelector: .toast.toasty-type-success)
org.openqa.selenium.NoSuchElementException: Cannot locate an element using By.cssSelector: .toast.toasty-type-success
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.1.0', revision: 'b94c902', time: '2017-02-16 12:21:31 -0800'
System info: host: 'GALACTICA', ip: '192.168.56.1', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
Driver info: driver.version: unknown
	at org.openqa.selenium.support.ui.ExpectedConditions.lambda$findElement$0(ExpectedConditions.java:896)
	at java.util.Optional.orElseThrow(Optional.java:290)
	at org.openqa.selenium.support.ui.ExpectedConditions.findElement(ExpectedConditions.java:895)
	at org.openqa.selenium.support.ui.ExpectedConditions.access$000(ExpectedConditions.java:41)
	at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:181)
	at org.openqa.selenium.support.ui.ExpectedConditions$6.apply(ExpectedConditions.java:178)
	at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:234)
	at com.lapis.flexrouter.router.testutil.UITestUtil.waitForToast(UITestUtil.java:33)
	at com.lapis.flexrouter.router.testutil.UITestUtil.waitForSuccessToast(UITestUtil.java:25)
	at com.lapis.flexrouter.router.selenium.function.WanConfigurationUITest.testTemporaryReprioritizeWithoutAutoResetToPermanent(WanConfigurationUITest.java:119)
	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.mockito.internal.junit.JUnitRule$1.evaluate(JUnitRule.java:16)
	at com.lapis.flexrouter.router.testutil.TakeScreenshotRule$1.evaluate(TakeScreenshotRule.java:29)
	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 com.lapis.flexrouter.router.testutil.UITestRule$1.evaluate(UITestRule.java:122)
	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
	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)

This issue is presumably caused by commit 9a2412b, which changed findElement to use findElements.

@shs96c shs96c closed this as completed in d2b1c51 Feb 22, 2017
@lock lock bot locked and limited conversation to collaborators Aug 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant