Posted in Selenium

SelectorsHUB : A New Reality to build your own XPath & cssSelector quickly

Selector

Recently Sanjay Kumar Conducted a Poll to know the preferable way to create/fetch the Xpath and found 79% of people love to create XPath by own. So in the market, most of tool provide you the XPath directly and sometimes its fails when the website is too dynamic in Nature. So now we have an innovative tool with us, i.e. SelectorsHub a free community browser plugin to create and verify custom XPath with some advanced feature.
Some feature of Selector hub

  1. Attribute Autosuggest
  2. SVG Support
  3. Shadow Dom and iFrame support
  4. Error message with the missing elements
  5. Secure plugin

How to Install Selectors hub in chrome browser

Click on below link to install Selectors hub in your Chrome browser

https://chrome.google.com/webstore/detail/selectorshub/ndgimibanhlabgdgjcpbbndiehljcpfh/

Click on add to chrome >Add Extension

The selectors hub is now ready to use.
Steps to use the tool-

  1. Open Dev Tools.
  2. On right side, the last sidebar tab is Selectors Hub. Click on it. If not visible, expand the sidebar.
  3. Here in the Selectors box start typing your selector XPath/CSS selector.
  4. Selectors Hub will automatically suggest tagName, all attributes and everything to complete Selectors quickly. Now you need not to copy and paste attribute values from DOM anymore. With SelectorsHub you can save a huge amount of time.
  5. After completing Selector just press enter and it will show the total number of matching elements.
  6. It will high light all matching node and list down them in the SelectorsHub tab.
  7. It will scroll the web element to viewable area if it is not in the viewable area.
  8. To copy selectors value, just double click anywhere in the box or click on XPath/CSS selector title box.

 

Now it support all the major browser like Chrome, Firefox, Edge, opera, Brave, Safari, chromium and Tor

For Detailed Workflow and complete tutorial please visit: https://www.selectorshub.com/what-is-selectorshub/

And for video Tutorial please visit: https://www.youtube.com/watch?v=NNTJyVb7P7U

Reference: https://www.selectorshub.com/what-is-selectorshub/

Keep Learning, Keep sharing..

Posted in Automation Testing Tool, Selenium

JUnit 4 vs JUnit 5:An Overview

Junit5

JUnit5, the Next Generation Junit. A Regression Testing Framework used by developers and tester to implement unit and functional testing in Java and Selenium, to accelerate programming speed and increase the quality of code. JUnit Framework can be easily integrated with either of the following –Eclipse, Ant, Maven. Junit5 introduces New Assert and Annotations to test your code more efficiently.

Junit5 requires Java 8 and above Java version and some useful annotations are:

@ParameterizedTest: Denotes that a method is a parameterized test. Such methods are inherited unless they are overridden.

 

@RepeatedTest: Denotes that a method is a test template for a repeated test. Such methods are inherited unless they are overridden.

@DisplayName: Declares a custom display name for the test class or test method. Such annotations are not inherited.

@BeforeEach: Denotes that the annotated method should be execute before each @Test,@RepeatedTest, @ParameteizedTest or @Test Factory method in the current class; analogous to JUnit 4’s @Before. Such methods are inherited unless they are overridden.

@AfterEach: Denotes that the annotated method should be executed after  @Test

@AfterAll:Denotes that the annotated method should be executed after @RepeatedTest@ParameterizedTest, and @TestFactory methods in the current class; analogous to JUnit 4’s @AfterClass. Such methods are inherited (unless they are hidden or overridden) and must be static (unless the “per-class” test instance lifecycle is used).

@Tag: Used to declare tags for filtering tests, either at the class or method level; analogous to test groups in TestNG or Categories in JUnit 4. Such annotations are inherited at the class level but not at the method level.

Screen Shot 2018-08-07 at 4.12.22 PM

Asserts in Junit:

Screen Shot 2018-08-07 at 4.13.42 PM

For More Information you may visit JUnit Official site Click here and For comparison with JUnit 4 you may visit click here

Reference:https://junit.org/junit5/docs/current/user-guide/