Research - Best Practices For Click Testing

Ranorex Spy, Recorder, and Studio.
lmcclendon
Posts: 5
Joined: Thu Nov 14, 2019 7:15 pm

Research - Best Practices For Click Testing

Post by lmcclendon » Mon Jan 13, 2020 10:25 pm

Good day all,

I hope all is well. I'm currently designing a click test suite that checks for a set of error messages being present after a click is performed. For example:

1. Clicks Create Account button on the home screen ---> (Create Account page loads)
ErrorCheckMethod()
{
Checks page for error A--
Checks page for error B--
Checks page for error C --
}
2. On create account screen click Help menu button --> (Help Page loads)
ErrorCheckMethod()

So on so forth.

I tried using the popup watcher and loading the entire DOM. It took more than 3 whole minutes and noted a failure in the setup region! And it's really not clear if the check is taking place again after a click. Then I figured I could use some validate user code statements that I currently have that can check for specified errors, but it seems now for what I'm trying to accomplish, I would have to go to each clicking recording module and add that validation statement code. On top of that, I will have to specify exactly where to look for the error messages. Does anyone have any suggestions on how I can best implement the search of the entire page generically and in a time-efficient manner ( 30 sec to 1 minute page search time)?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 5754
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Research - Best Practices For Click Testing

Post by odklizec » Tue Jan 14, 2020 8:46 am

Hi,

Unfortunately, it's pretty hard to suggest something reliable, without seeing the actual page (or an example page) and more details about the errors and exact (manual) test steps.

Generally speaking, I don't think it's a good idea to use popupwatcher for this kind of error check. The problem of popupwatcher is, that it runs in a separate thread and you can't easily control the main test thread from the popupwatcher. You can pause the main thread from popupwatcher, but even this pause is not performed immediately after the 'pause' action is invoked. Hence popup watcher should be used for handling random popups and maybe some random errors. But I would not reccommend it to use for handling 'expected' errors.

From the description you posted, I'm not entirely sure what kind of errors you are looking for, how they look like or if they can appear all together or always just one them? As mentioned, example page would be extremely helpful here.

In my opinion, typical approach would be running a validation check after page load action? So yes, it may be required to add the validation code at the end of every 'click' recording, where you want to perform the validation?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

lmcclendon
Posts: 5
Joined: Thu Nov 14, 2019 7:15 pm

Re: Research - Best Practices For Click Testing

Post by lmcclendon » Tue Jan 14, 2020 5:04 pm

In the attached image, the two highlighted errors are examples of what I would be looking for throughout the tests. They can display at random times throughout a tests' execution. The error messages themselves are repository/locator items that I have methods for that will check to see if they are on the page and return true/false. But as stated before, if done in the recording module, I would have to add the user code to every 'click' module and then specify the repository item/panel to check for that error message. I'm aiming to encapsulate all of the error message checking methods I have into a generic one (SearchForAllErrors) that will be invoked after every click that will search the entire page instead of one section/portion of the page after it loads. I hope this provides a little more clarity.

Example:

1. Open Drawer button is clicked --> Page loads
- "SearchForAllErrors" method executes
{
CheckForSystemError() --> returns true
CheckForProcessingError() -->returns true
...
...
...
...
}

2. Customer button in left nav is clicked -- customer screen loads
SearchForError() executes
...
...
...
Attachments
Error message.png
Error message.png (102.29 KiB) Viewed 876 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 5754
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Research - Best Practices For Click Testing

Post by odklizec » Wed Jan 15, 2020 8:44 am

Hi,

I think that the approach you described should work? Of course, the speed of validation (search of error messages) will highly depends on the quality and uniqueness of the specified repo xpaths. In case you don't need to know, which error exactly appeared, but simply that "any" error appeared, it should be possible to specify one global repo item for all errors. In other words, you may not need to create multiple repo elements. For an example of such xpath, I would need a Ranorex snapshot(s), displaying at least two errors. Eventually, two xpaths for two individual errors, as you have them in repo.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

lmcclendon
Posts: 5
Joined: Thu Nov 14, 2019 7:15 pm

Re: Research - Best Practices For Click Testing

Post by lmcclendon » Wed Jan 15, 2020 3:39 pm

See the attached error message repo and snapshot of the error message page.
Attachments
Error Messages Snapshot.rxsnp
(98.42 KiB) Downloaded 13 times
Error Message Repo.rxrep
(5.08 KiB) Downloaded 10 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 12042
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Research - Best Practices For Click Testing

Post by Support Team » Mon Jan 20, 2020 1:29 pm

Hi lmcclendon,

To have some kind of time-efficient search, you could possibly nest some "if"-queries. For example only if span "System Error" can be found, search for the sub-message, e.g.: "There has been an error processing".

Also, the DOM doesn't seem to be super deep, so the elements should be found quickly.

Sample RanoreXPath:
/dom[@domain='training.vergentlms.com']//div[#'Main']/div/span[@innertext='System Error']
Hope this helps,
Robert
.
Image

lmcclendon
Posts: 5
Joined: Thu Nov 14, 2019 7:15 pm

Re: Research - Best Practices For Click Testing

Post by lmcclendon » Mon Jan 20, 2020 3:20 pm

Hey Robert,

I hope that all is well. What I have attached isn't the complete repository. It's just the section that contains the error messages but thank you! I appreciate it!