0
votes

What should I use if I want to test a warning message appears on the screen for an application? I need to perform a number of steps first to get the intended screen. Would it be best to use JMeter to do this and then when I get to the intended screen I can assert that the response contains the warning message? Or should it all be done using Selenium and it would be slower but at least it's going through the actual UI?

Any advice? Or integrate the 2? Use JMeter to perform all the steps to get to the actual screen that I want to test (so that my test runs quicker doing the steps that I'm not actually looking to test) then use Selenium to test that screen and the warning message?

Trying to get my head around the best one to use. I'm liking JMeter and I know it's meant for load testing but if i can use it to run the parts of my test that I'm not actually testing (via http calls) in order to get the part I want to actually test quicker then that makes more sense surely? If the warning message appears in the response in the JMeter http call then why use Selenium at all?

1
You use Selenium because it tests the app as the user would. If your error message is e.g. in some JSON from the backend it's all well and good testing the API, but you're not checking it's usefully displayed to the end user. - jonrsharpe
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it. - JeffC

1 Answers

0
votes

Depends on the message nature. If it is driven by JavaScript - you won't be use JMeter, go for Selenium or similar solutions(there are some headless browser implementations like PhantomJS or HtmlUnit)

If the message is conditionally present in DOM - go for JMeter as JMeter acts on protocol level therefore your test will be more robust and execute much faster. You can use Response Assertion to check desired text presence/absence. If you need to simulate real user as close as possible follow recommendations from How To Make JMeter Behave More Like A Real Browser guide, apart from executing client-side JavaScript and actually rendering the page JMeter can do everything what "normal" browser can do.