2 minutes read Why do we need to mock APIs ? A lot of times when you develop integration tests there is a need to mock different APIs to test for negative cases to check how the rest of the platform behaves in that case and it is not feasible to change the API to return errors. This… Read more »
Posts Categorized: JAVA
Structuring integration tests using JUnit categories by features, API or type of tests
2 minutes read Why structure your integration tests ? When the number of integration tests grow is a good practice to separate the tests based on the feature/api that they are testing. The advantages of doing this are: easier to maitain as the tests for a specific feature/API are grouped in a specific category easier to run the… Read more »
How to Click a Link by Text in Selenium WebDriver Java
< 1 minute read Here is how to click a link by text with Selenium WebDriver in Java using the built in WebDriver helper methods or by XPath: Click link by full text using Selenium WebDriver WebElement linkByText = driver.findElement(By.linkText(“My Link”)); linkByText.click();
How to Use the DataProvider in TestNG with a JAVA Example
2 minutes read We are going to show how to use the DataProvider in your test cases created with the TestNG unit testing framework. DataProvider are used in order to create data-driven tests. Basically, it will help you to run the same test case, but with different data sets. Examples of DataProviders We are going to use the… Read more »