I am working on a suite of automated Selenium tests. I have a bit a code that handles checking search filter's for our website (checking their validity, what is selected, etc.). This bit of code is running a lot slower than I had expected. I am developing the suite using the Page Object pattern, and during development, I would debug various bits out of a main method, then implement the test methods using JUnit once the Page Objects were functioning properly.
I noticed a significant time discrepancy between the execution times of constructing the object in Main vs. in JUnit. In Main, the object construction takes about 15 seconds. When I run it in through JUnit, however, object construction takes about 16 minutes. This is obviously a large enough difference that I am concerned about it and want to know how I can get the JUnit execution time closer to what I was observing when it was run through main. I'd appreciate any ideas, or a better understanding of why the delay was being caused. Thanks!
Here are the lines of code in question:
// Run in main
// getFilters() returns new Filters(webDriver);
Filters filters = resultsPage.getFilters();
// Run with JUnit (through IntelliJ)
filters = resultsPage.getFilters();
Well, it turns out it was a goof on my part. I had mis-configured my WebDriver in my test class which was throwing a
wait into more than I expected it to.