Skip to content

Add actual values of web element in SeleniumWebDriver error message#11153

Merged
dmytro-ndp merged 1 commit intomasterfrom
che-11149
Sep 11, 2018
Merged

Add actual values of web element in SeleniumWebDriver error message#11153
dmytro-ndp merged 1 commit intomasterfrom
che-11149

Conversation

@dmytro-ndp
Copy link
Copy Markdown
Contributor

@dmytro-ndp dmytro-ndp commented Sep 10, 2018

What does this PR do?

It adds actual values into error messages which are produced by those methods of SeleniumWebDriverHelper class which are waiting on certain text of web element.
To have correct error messages we need to stop sharing WebDriverWait instances by WebDriverWaitFactory class with the same timeout.

Examples of error message:

org.openqa.selenium.TimeoutException: 
Expected condition failed: 
expected:
'HelloWorld'
but was:
''
 (tried for 10 second(s) with 500 MILLISECONDS interval)
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'slave2.codenvycorp.com', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-862.11.6.el7.x86_64', java.version: '1.8.0_144'
Driver info: org.eclipse.che.selenium.core.SeleniumWebDriver
	at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:80)
	at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:265)
	at org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper.waitTextEqualsTo(SeleniumWebDriverHelper.java:734)
	at org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper.waitTextEqualsTo(SeleniumWebDriverHelper.java:750)
	at org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper.setText(SeleniumWebDriverHelper.java:126)
	at org.eclipse.che.selenium.pageobject.CodenvyEditor.doRenamingByLanguageServerField(CodenvyEditor.java:2248)
	at org.eclipse.che.selenium.languageserver.csharp.CSharpClassRenamingTest.checkRenaming(CSharpClassRenamingTest.java:83)
	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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:696)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:882)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1189)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
[ERROR] checkoutReferenceByHashCommit(org.eclipse.che.selenium.git.CheckoutReferenceTest)  Time elapsed: 103.65 s  <<< FAILURE!
org.openqa.selenium.TimeoutException: 
Expected condition failed: 
actual value:
'Change file app.js'
didn't contain:
'test message /n some /n'
 (tried for 10 second(s) with 500 MILLISECONDS interval)
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'unused.ua.codenvy-dev.com', ip: '172.19.20.137', os.name: 'Linux', os.arch: 'amd64', os.version: '4.17.9-200.fc28.x86_64', java.version: '1.8.0_111'
Driver info: org.eclipse.che.selenium.core.SeleniumWebDriver
	at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:80)
	at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:265)
	at org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper.waitValueContains(SeleniumWebDriverHelper.java:644)
	at org.eclipse.che.selenium.core.webdriver.SeleniumWebDriverHelper.waitValueContains(SeleniumWebDriverHelper.java:661)
	at org.eclipse.che.selenium.pageobject.git.GitHistory.waitContentIntoHistoryEditor(GitHistory.java:105)
	at org.eclipse.che.selenium.pageobject.git.Git.waitContentInHistoryEditor(Git.java:304)
	at org.eclipse.che.selenium.git.CheckoutReferenceTest.checkoutReferenceByHashCommit(CheckoutReferenceTest.java:166)
	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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:696)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:882)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1189)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:124)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
2018-09-11 04:30:14,738[pool-2-thread-2]  [ERROR] [.e.c.s.c.i.SeleniumTestHandler 355]  - Test CSharpClassRenamingTest.checkRenaming failed. Error: Expected condition failed: 
expected:
'HelloWorld'
but was:
''
 (tried for 10 second(s) with 500 MILLISECONDS interval)
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'slave2.codenvycorp.com', ip: '127.0.0.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-862.11.6.el7.x86_64', java.version: '1.8.0_144'
Driver info: org.eclipse.che.selenium.core.SeleniumWebDriver

Many thanks to @tsmaeder for an idea and example of implementation.

What issues does this PR fix or reference?

#11149

Signed-off-by: Dmytro Nochevnov <dnochevnov@codenvy.com>
@dmytro-ndp dmytro-ndp added status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community. team/che-qe labels Sep 10, 2018
@dmytro-ndp
Copy link
Copy Markdown
Contributor Author

ci-test

@benoitf benoitf added the kind/task Internal things, technical debt, and to-do tasks to be performed. label Sep 10, 2018
@riuvshin
Copy link
Copy Markdown
Contributor

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:11153
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@dmytro-ndp
Copy link
Copy Markdown
Contributor Author

ci-test-docker-single

@riuvshin
Copy link
Copy Markdown
Contributor

ci-test build report:
Build details
Test report
selenium tests report data
docker image: eclipseche/che-server:11153
https://github.com/orgs/eclipse/teams/eclipse-che-qa please check this report.

@dmytro-ndp dmytro-ndp merged commit 15072ae into master Sep 11, 2018
@dmytro-ndp dmytro-ndp deleted the che-11149 branch September 11, 2018 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/task Internal things, technical debt, and to-do tasks to be performed. status/code-review This issue has a pull request posted for it and is awaiting code review completion by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants