Code Monkey home page Code Monkey logo

teasy's Introduction

Teasy

Maven Central

Test easy with Teasy - UI automation testing framework

Description

Teasy is a Java-based testing framework built on Selenium and TestNG. Its aim is to make your web testing easier by providing solutions to a lot of things that you will face during UI automation testing. Check out our wiki page for more details.

Quickstart

Extend your tests from SeleniumBaseTest and extend your Pages from BasePage. Detailed description will be added soon...

Usage

You will need to have the following soft installed before using teasy:

  • java 8+
  • maven 3+

and you will need to add the following dependency to your project's pom.xml file

Latest teasy

<dependency>
  <groupId>com.wiley</groupId>
  <artifactId>teasy</artifactId>
  <version>2.0.15</version>
</dependency>

Old spring-based teasy will be available in 1.x versions

<dependency>
  <groupId>com.wiley</groupId>
  <artifactId>teasy</artifactId>
  <version>1.1.5</version>
</dependency>

Contributing

We're just getting started here, but please post issues if you have any!

License

MIT

teasy's People

Contributors

alexanderpervachuk avatar alexplekhov avatar atyukavkin avatar bigbluehat avatar dstepkin-wiley avatar ereoo avatar estuold avatar fedvl avatar ishumov avatar kgalkin avatar moose0621 avatar mosadchiy avatar nankibykova avatar skopanirov avatar stumpkeeper avatar va1tra avatar vefimofff avatar vetanika avatar vnabatov 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

Watchers

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

teasy's Issues

Introduce Block concept

Replace AbstractWebContainer approach with "Block" concept. Pretty much the same idea - to have a way of introducing page objects (aka blocks)

Review and improve current Custom Component approach

Current components (button, textField, link) is more of a prototype that didn't get enough developed lately. However it's a great feature that has to be reworked with an extensibility in mind.

before starting to work with this issue please contact me

Different behaviour when using new SearchStrategy(), and when not using any strategy explicitely.

Version: 1.0.14

I observed following exception in the test.

org.openqa.selenium.NoSuchElementException: Unable to find element with locator 'By.id: cityId'
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.2.0', revision: '8c03df6b79', time: '2017-02-23 10:51:31 +0000'
System info: host: 'jenkins-as.tes-rus.net', ip: '192.168.108.166', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-514.21.2.el7.x86_64', java.version: '1.8.0_131'
Driver info: driver.version: unknown
at com.wiley.autotest.selenium.elements.upgrade.NullTeasyElement.noSuchElementException(NullTeasyElement.java:210)
at com.wiley.autotest.selenium.elements.upgrade.NullTeasyElement.clear(NullTeasyElement.java:75)
at com.wiley.autotest.selenium.extensions.internal.TextFieldImpl.clear(TextFieldImpl.java:46)
at com.wiley.autotest.selenium.extensions.internal.TextFieldImpl.clearAndType(TextFieldImpl.java:76)
at com.wiley.wat.blocks.AffiliationForm.inputCity(AffiliationForm.java:166)

It was inconsistent and reproduced only when bunch of tests was running on grid, even if most of them were unrelated to falling code. It never happened on local launches, and when total amount of tests was no big enough (~30 was not, but ~70 was enough).

Code that caused exception looked like this:

public class AffiliationForm extends AbstractWebContainer {
...
private final static By CITY_LOCATOR = By.id("cityId");
...
private TextField cityTextField() {
        return textField(CITY_LOCATOR);
}
...

But when I tried following workaround, error disappeared.

private TextField cityTextField() {
        return new WebElementWrapper(element(CITY_LOCATOR, new SearchStrategy())).getTextField();
}

Following examples was run on the 1.0.8 version, but I don't think version matters, because first two of them are reproduced on the last version.

Turns out, SearchStrategy was sufficient, and following still caused error.

private TextField cityTextField() {
        return new WebElementWrapper(element(CITY_LOCATOR)).getTextField();
}

It seems, that element call find visible element in one case, and don't in other. I can see the only difference between them: second call uses default element finder inside TeasyElementProvider, which has strategy created not by default constructor, but with constructor with timeout parameter, and it is instantiated with TeasyElementProvider.timeout value.

However, when I tried to figure out what the timeout is, following code

@Autowired
private AffiliationForm affiliationForm;
...
Field timeoutField = TeasyElementProvider.class.getDeclaredField("timeout");
timeoutField.setAccessible(true);
Long timeout = (Long) timeoutField.get(affiliationForm);
System.out.println(timeout);
System.out.println(SeleniumHolder.getTimeoutInSeconds());

prints 60 in both cases (second is used as a default timeout for SearchStrategy).

Moreover, it seems that element is not found for other reason then actual invisibility. I tried workaround and normal call together.

private TextField cityTextField() {
        element(CITY_LOCATOR, new SearchStrategy().frameStrategy(SearchStrategy.FrameStrategy.IN_ALL_FRAMES));
        return textField(CITY_LOCATOR);
}

First line passed, but second caused exception (at that point I assumed, that FrameStrategy might matter, but it seems not - later I removed it, and workaround worked, as I wrote above).

Error had been observed after we tried to introduce page blocks and moved some code to subclasses of AbstractWebContainer. When textField(CITY_LOCATOR) was in the page class, it worked in the same test and the same consequence of actions.

Tests for domElement()

Develop tests for method domElement(final By locator) from OurElementProvider.

Create .html file and tests running on this file to check that domElement() method works as expected.

  1. domElement returns first present element using given locator
  2. element waits for element to appear in dom(e.g. simulate situation when there is no element, then after 3 seconds it appears)
  3. domElement fails if nothing is found. (exception is thrown)
  4. there are 3 iframes and element is present in the second one.

Please feel free to add more tests on your taste.

Tests for elements()

Refer to #12 for the scenarios.
important note: elements() will return empty list if nothing is found.

Double throw NoSuchElementException in NullTeasyElement.

When we call beDisplayed on NullTeasyElement we throw NoSuchElementException, but in message we call element.getLocator().getLocator() which throw NoSuchElementException also.

Should we make element.getLocator() return Locator ?

getOptions() method returns something strange

getOptions method now working after fix 1.0.9. But it returns a collection of elements each of them containing all options. So getContentTypeSelectOptions().get(0).getText() returns all option values, but not the first.

Remove Cuanto lib sources from project.

Now sources of third-party lib Cuanto placed in project, it's historically from WAT project for resolve dependencies for developers outside wiley network.

No `master` branch?

I was confused when I cloned this project as there was no master branch and consequently no files were put into my working copy. Upon visiting GitHub again I realized that there was a single newway branch. Guessing that's to keep it out of the way of the internal master branch?

It is possible to using the Setting to config newway as the default branch--which should making cloning more intuitive. However, it's still probably best to make this the master branch as soon as that's workable for all involved.

Cheers!
🎩

Add Safari Technology Preview support

As Safari Technology Preview is the last version of Safari with built-in driver, it would be very useful to add support for it (Safari 10 has a lot of problems with driver)

Convert OurWebElement to WebElement

Hi all,

Is there any way to convert OurWebElement to classic WebElement?

There are some custom Selenium functions (Drag and Drop for example) that require WebElement as a parameter and as long as we have only OurWebElement, we can't use those functions.

Cannot get teasyElement or teasyElements for many same elements through appium for mobile App.

For getting TeasyElement through appium on mobile devices we have the next issue:
If page has many same elements (190 for example) then
element(MobileBy.AccessibilityId(“locator”)) and elements(MobileBy.AccessibilityId(“locator”)) don’t return element or elements.

In contrast of findElement() or findElements() directly from appium.java_client.
They have the behaviour presented below:

  1. SeleniumHolder.getAppiumDriver().findElement(MobileBy.AccessibilityId(“locator”))
    returns element immediately
  2. SeleniumHolder.getAppiumDriver().findElements(MobileBy.AccessibilityId(“locator”))
    takes a long time but in the long run returns list of elements. (approximately 5 minute)

Also additional info: to get one element, getElement from TeasyElement gets all elements on page and then get first of them. It's very long for mobile apps.

Cannot use getParent() in Mobile. It throws an exception.

I got an exception when using getParent such way:
element(MobileBy.AccessibilityId(articleTitle)).getParent();
Got the exception:
Unable to find element By.xpath: ./.., Exception - Locator Strategy 'tag name' is not supported for this session (WARNING: The server did not provide any stacktrace information)

StackTraceElement:
com.wiley.autotest.selenium.elements.upgrade.BaseTeasyElement.find(BaseTeasyElement.java:455)

OurWebElement and WebElement

Hi all!

Teasy uses OurWebElement class instead of classic Selenium WebElement class, but there are some functions in OurWebElement.class that still return classic Selenium WebElement:

public WebElement findElement(By by)
public List<WebElement> findElements(By by)

This approach causes some issues with incompatible types error. Will it be fixed?

java.lang.ClassCastException in longTap(OurWebElement webElement, int timeoutInMilSec)

I get java.lang.ClassCastException when trying to use longTap method for iOS testing.
See stack trace part below:
java.lang.ClassCastException: com.sun.proxy.$Proxy44 cannot be cast to org.openqa.selenium.internal.HasIdentity
at io.appium.java_client.TouchAction.press(TouchAction.java:52)
at com.wiley.wat.base.MobileBasePage.longTap(MobileBasePage.java:218)

Use soft asserts for lists.

In a case when we need to check a list of elements for some condition, it would better to use soft assertion. It will provide more information.
Here is an example:

SoftAssert soft = new SoftAssert();
elements(by).forEach(element -> soft.assertFalse(
      element.getText().isEmpty()), 
      "Element " + element.getLocator() + " without a text.");
soft.assertAll();

Imagine, that the list has 100500 elements, and 50 of them have empty text. In that case, we will not fail on the first error, we will collect all of them.

It would be very cool to implement such feature in the framework.

Fix logger related warnings

I remember we have some warning due to multiple versions of slf4j logger being used. Please correct this.

Tests for element()

Develop tests for method element(final By locator) from OurElementProvider.

Create .html file and tests running on this file to check that element() method works as expected.

  1. element returns first visible element using given locator
  2. element waits for element to become visible (e.g. simulate situation when there is no element, then after 3 seconds it appears)
  3. element fails if nothing is found. (exception is thrown)
  4. there are 3 iframes and visible element is present in the second one.

Please feel free to add more tests on your taste.

Use TeasyElement for OurScreenshot class on constructor

As for block concept we have faced issue when we have List of blocks, then the locator for this blocks are the same, so when we are taking screenshots - getting inccorect screenshot with all the lements in list instead just one.
So would be nice to have this approach to pass element to OurScreenshot class.

Chrome browser does not start

Running tests in chrome browser causes the following errors (chrome browser does not start):

14:00:31,315 ERROR SeleniumTestExecutionListener:178 - *****class java.lang.NoSuchMethodError occurred when initializing webdriver***** -- ERROR -- io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
14:00:36,315 ERROR SeleniumTestExecutionListener:182 - *****Try to wrap driver, count - 1 *****
14:00:36,315 ERROR SeleniumTestExecutionListener:178 - *****class java.lang.NoSuchMethodError occurred when initializing webdriver***** -- ERROR -- io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
14:00:41,297 ERROR SeleniumTestExecutionListener:182 - *****Try to wrap driver, count - 2 *****
14:00:41,297 ERROR SeleniumTestExecutionListener:178 - *****class java.lang.NoSuchMethodError occurred when initializing webdriver***** -- ERROR -- io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
14:00:46,297 ERROR SeleniumTestExecutionListener:182 - *****Try to wrap driver, count - 3 *****
14:00:46,297 ERROR SeleniumTestExecutionListener:178 - *****class java.lang.NoSuchMethodError occurred when initializing webdriver***** -- ERROR -- io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
14:00:51,299 ERROR SeleniumTestExecutionListener:182 - *****Try to wrap driver, count - 4 *****
14:00:51,300 ERROR SeleniumTestExecutionListener:178 - *****class java.lang.NoSuchMethodError occurred when initializing webdriver***** -- ERROR -- io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
14:00:51,302 ERROR TestContextManager:231 - Caught exception while allowing TestExecutionListener [com.wiley.autotest.spring.SeleniumTestExecutionListener@287f94b1] to prepare test instance [com.wiley.wcs.tests.functional.UI.UI.WCS_117_UI_AUTHORIZATION_1_SK@3745e5c6]
org.openqa.selenium.WebDriverException: *****Unable to wrap driver after 5 attempts!***** io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'WWL-20161128-I7', ip: '192.168.109.91', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_31'
Driver info: driver.version: unknown
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:185)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:183)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:183)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:183)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:183)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228)
	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance(AbstractTestNGSpringContextTests.java:149)
	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:483)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at org.testng.TestRunner.privateRun(TestRunner.java:782)
	at org.testng.TestRunner.run(TestRunner.java:632)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
	at org.testng.SuiteRunner.run(SuiteRunner.java:268)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
	at org.testng.TestNG.run(TestNG.java:1064)
	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127)
Caused by: java.lang.NoSuchMethodError: io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.chrome(SeleniumTestExecutionListener.java:684)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.initWebDriver(SeleniumTestExecutionListener.java:477)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:165)
	... 29 more

org.openqa.selenium.WebDriverException: *****Unable to wrap driver after 5 attempts!***** io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'WWL-20161128-I7', ip: '192.168.109.91', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_31'
Driver info: driver.version: unknown

	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:185)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:183)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:183)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:183)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:183)
	at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:228)
	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextPrepareTestInstance(AbstractTestNGSpringContextTests.java:149)
	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:483)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at org.testng.TestRunner.privateRun(TestRunner.java:782)
	at org.testng.TestRunner.run(TestRunner.java:632)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
	at org.testng.SuiteRunner.run(SuiteRunner.java:268)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
	at org.testng.TestNG.run(TestNG.java:1064)
	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127)
Caused by: java.lang.NoSuchMethodError: io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.chrome(SeleniumTestExecutionListener.java:684)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.initWebDriver(SeleniumTestExecutionListener.java:477)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:165)
	... 29 more


java.lang.NullPointerException
	at com.wiley.autotest.selenium.AbstractSeleniumTest.initScreenshotWebDriverEventListener(AbstractSeleniumTest.java:92)
	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:483)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:178)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
	at org.testng.TestRunner.privateRun(TestRunner.java:782)
	at org.testng.TestRunner.run(TestRunner.java:632)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
	at org.testng.SuiteRunner.run(SuiteRunner.java:268)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
	at org.testng.TestNG.run(TestNG.java:1064)
	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127)

14:00:51,361 ERROR SeleniumTestExecutionListener:178 - *****class java.lang.NoSuchMethodError occurred when initializing webdriver***** -- ERROR -- io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
14:00:51,362  WARN TestContextManager:268 - Caught exception while allowing TestExecutionListener [com.wiley.autotest.spring.SeleniumTestExecutionListener@287f94b1] to process 'before' execution of test method [public void com.wiley.wcs.tests.functional.UI.UI.WCS_117_UI_AUTHORIZATION_1_SK.test_WCS_117_UI_AUTHORIZATION_1_SK()] for test instance [com.wiley.wcs.tests.functional.UI.UI.WCS_117_UI_AUTHORIZATION_1_SK@3745e5c6]
org.openqa.selenium.WebDriverException: *****Unable to wrap driver after 6 attempts!***** io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'WWL-20161128-I7', ip: '192.168.109.91', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_31'
Driver info: driver.version: unknown
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:185)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.beforeTestMethod(SeleniumTestExecutionListener.java:234)
	at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:265)
	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextBeforeTestMethod(AbstractTestNGSpringContextTests.java:162)
	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:483)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:589)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
	at org.testng.TestRunner.privateRun(TestRunner.java:782)
	at org.testng.TestRunner.run(TestRunner.java:632)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
	at org.testng.SuiteRunner.run(SuiteRunner.java:268)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
	at org.testng.TestNG.run(TestNG.java:1064)
	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127)
Caused by: java.lang.NoSuchMethodError: io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.chrome(SeleniumTestExecutionListener.java:684)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.initWebDriver(SeleniumTestExecutionListener.java:477)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:165)
	... 28 more

org.openqa.selenium.WebDriverException: *****Unable to wrap driver after 6 attempts!***** io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'WWL-20161128-I7', ip: '192.168.109.91', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_31'
Driver info: driver.version: unknown

	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:185)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.beforeTestMethod(SeleniumTestExecutionListener.java:234)
	at org.springframework.test.context.TestContextManager.beforeTestMethod(TestContextManager.java:265)
	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.springTestContextBeforeTestMethod(AbstractTestNGSpringContextTests.java:162)
	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:483)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:514)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:215)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:589)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
	at org.testng.TestRunner.privateRun(TestRunner.java:782)
	at org.testng.TestRunner.run(TestRunner.java:632)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
	at org.testng.SuiteRunner.run(SuiteRunner.java:268)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
	at org.testng.TestNG.run(TestNG.java:1064)
	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127)
Caused by: java.lang.NoSuchMethodError: io.github.bonigarcia.wdm.ChromeDriverManager.getInstance()Lio/github/bonigarcia/wdm/ChromeDriverManager;
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.chrome(SeleniumTestExecutionListener.java:684)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.initWebDriver(SeleniumTestExecutionListener.java:477)
	at com.wiley.autotest.spring.SeleniumTestExecutionListener.prepareTestInstance(SeleniumTestExecutionListener.java:165)
	... 28 more

Refresh workarounds for IE and Safari

Currently there are plenty of workarounds for old IE and Safari testing which are most likely not actual any longer according to our latest experiments. They simply need to be removed. They can be found by constructions like

if(isIE()) {
//some logic
}
if(isSafari()) {
//some logic
}

Throw assertion error in case Nullelement.should.beDisplayed() instead of NoSuchElement exception.

We found out that should.beDisplayed throws NoSuchElementException.
It makes tests "broken" in allure reports. Actually, we don't see difference in that case between "no element" and "element isn't displayed".

See public class NullShouldImmediately, the beDisplayed() method.

We suppose, that such methods must throw assertion error where it is possible. For example above, it would be good for us if implementation would be like:

  1. element found, but not displayed -> assertion error with a message "Element is not displayed, but should be. The failed.";
  2. element not found -> assertion error with a message like "Element is not displayed because it wasn't found, but should be. The failed."

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.