New answers tagged

0

Remove the dependency to control the conditions. Modify the application so that when it is run in test mode it uses mock responses from test data or a proxy server instead of the actual database.


0

You could use a one-liner that asserts a span with the text "Active" is present. Assert.NotNull(driver.findElement(By.XPath("//span[text()='Active']")));


0

Your best option is to find the element containing the text - webdriver refers to the selenium driver object that you use to find your elements. The code could be something like this (accuracy is not guaranteed since I'm coding on the fly): // Find all the span elements List<IWebElement> spans = webdriver.FindElements(By.Tag("span")); // use ...


0

You can have the @before and @after hooks. where the @before hook initiates the application and the @after hook destroys the user every after a scenario is completed. And hence you should not find the user in the db each time a scenario is run. Refer to https://www.baeldung.com/java-cucumber-hooks e.g @After(RunTest.HOOK.SELENIUM_REGISTRATION) public void ...


0

Insert random variables in test data to run multiple times Whatever can create duplicates in your application , introduce random variables in your tests . For example each time a new user is registered its registered with new name and credentials using a random string function which returns a new unique name and credentials everytime. Refresh db daily ...


Top 50 recent answers are included