Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File/Open recent menu issues #5475

Open
asfimport opened this issue Dec 28, 2020 · 6 comments
Open

File/Open recent menu issues #5475

asfimport opened this issue Dec 28, 2020 · 6 comments
Milestone

Comments

@asfimport
Copy link
Collaborator

eR@SeR (Bug 65032):
Hello,

AFAIK, to remove jmx file from File/Open recent menu, the user must open the Registry Editor, navigate to Computer\HKEY_CURRENT_USER\Software\JavaSoft\Prefs\org\apache\jmeter\gui\action and find recent_file_x key to delete. There are few issues found:

Precondition: Close JMeter, Delete all recent_file_x keys (if any) using Registry Editor, start JMeter.

  1. Open test1, test2 and test3.jmx from attachment. There should be 3 files in Recent menu - test1, test2 and test3, but they are missing (same is in the registry). That was working fine in version 5.3.

Jmeter 5.4.1 38f8738
Microsoft Windows 10 Enterprise 64-bit
java version "14.0.1" 2020-04-14


Since issue 1 was not present in verion 5.3, I checked version 5.3 and found issues that might be reproducible in Jmeter 5.4.1 as well.

Precondition: Close JMeter, Delete all recent_file_x keys (if any) using Registry Editor, start JMeter.

  1. Open test1, test2 and test3 jmx from attachment. There should be 3 tests in Recent menu - test1, test2 and test3. Then do:

Delete recent_file_1 from registry
Restart JMeter
Click on file that is under 2nd line (3 underlined)

Actual:

Test is opened. However, there are 3 recent files but there should be two. File that is under 2nd line (3 underlined) is duplicated, as well in the registry. If clicked on 1st or 3rd line (3 underlined) in Open recent menu list, pop up error "Index: 8, Size: 8" is shown:

WARN o.a.j.g.a.Load: Unexpected error. java.lang.IndexOutOfBoundsException: Index: 8, Size: 8
java.lang.IndexOutOfBoundsException: Index: 8, Size: 8
at java.util.LinkedList.checkElementIndex(LinkedList.java:559) ~[?:?]
at java.util.LinkedList.get(LinkedList.java:480) ~[?:?]
at org.apache.jmeter.gui.action.LoadRecentProject.updateRecentFileMenuItems(LoadRecentProject.java:137) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.util.JMeterMenuBar.setProjectFileLoaded(JMeterMenuBar.java:145) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.MainFrame.setProjectFileLoaded(MainFrame.java:330) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.GuiPackage.setTestPlanFile(GuiPackage.java:732) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:136) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.action.Load.loadProjectFile(Load.java:101) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.action.LoadRecentProject.doActionAfterCheck(LoadRecentProject.java:66) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.action.AbstractActionWithNoRunningTest.doAction(AbstractActionWithNoRunningTest.java:44) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:87) ~[ApacheJMeter_core.jar:5.3]
at org.apache.jmeter.gui.action.ActionRouter.lambda$actionPerformed$0(ActionRouter.java:69) ~[ApacheJMeter_core.jar:5.3]
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:316) ~[?:?]
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) ~[?:?]
at java.awt.EventQueue$4.run(EventQueue.java:721) ~[?:?]
at java.awt.EventQueue$4.run(EventQueue.java:715) ~[?:?]
at java.security.AccessController.doPrivileged(AccessController.java:391) [?:?]
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) [?:?]
at java.awt.EventQueue.dispatchEvent(EventQueue.java:740) [?:?]
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) [?:?]
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) [?:?]
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) [?:?]
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) [?:?]
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) [?:?]

Check the images in the attachment.

Expected:

If recent_file_1 is deleted from registry and JMeter restarted, there should be two files, properly ordered (1, 2... etc.) as well in the registry. Both files can be opened.


  1. Open test1, test2 and test3 jmx from attachment. There should be 3 tests in Recent menu - test1, test2 and test3. Then do:

Rename, move or delete one of the test files.
Click on renamed, moved or deleted file.

Actual:

Pop up "C:\Users\NA\Desktop\test1.jmx (The system cannot find the file specified)" is shown.

Expected:

Pop up "C:\Users\NA\Desktop\test1.jmx (The system cannot find the file specified). Would you like to remove the file from the recent list?" is shown, Yes/No buttons are offered.

Jmeter 5.3
Microsoft Windows 10 Enterprise 64-bit
java version "14.0.1" 2020-04-14

There might be a lot of tests in Open Recent menu that cannot be found on destination, so there might be no reason that they should be on that list. In order to remove it from the list, the user must open the Registry Editor, browse the registry location and delete it.

Is there any other way to remove tests from Open recent list that is not by deleting it from the registry? If no, such an option from File menu is welcomed.

Created attachment open recent.zip: Open recent menu files

Version: Nightly
Severity: normal
OS: All

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
First question, that comes to my mind, is: Why would you want to clear the list of recent files?

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
Can you try the next build from trunk or nightly?

commit a26ed2f
AuthorDate: Tue Dec 29 12:39:10 2020 +0100

When importing example test plan JMeter displays an NullPointerException

The fix has introduced a bug, where newly added files might be left as
duplicates in the menu.

https://github.com/apache/jmeter/issues/5443, 65032

.../jmeter/gui/action/LoadRecentProject.java | 44 ++++++++++------------
1 file changed, 20 insertions(+), 24 deletions(-)

@asfimport
Copy link
Collaborator Author

eR@SeR (migrated from Bugzilla):
Hi,

Issues under points 1 and 2 are fixed. Thank you.

(In reply to Felix Schumacher from comment 1)

First question, that comes to my mind, is: Why would you want to clear the
list of recent files?
The answer is under point 3 already. Why should we have tests in the list that do not exist in the pointed location? IMO, we should have JMeter option to remove them or at least to have the Expected result mentioned in point 3, not to browse the registry and have a risk to break something. I've found that someone had the same question here under point 2 http://www.jmeter-archive.org/Auto-Clear-non-existing-recent-Testplans-and-auto-load-certain-Testplan-td5593106.html

While checking point 3 (repeat same steps) I missed to mention in actual/expected results, that the currently opened test gets removed from the tree pane and then pop up is shown. Maybe it could be better to leave the current test opened unless the file location of the clicked test from Recent list is found?

BTW, the maximum shown tests in Recent list is 9. Is this intended?

Jmeter 5.4.1 a26ed2f
Microsoft Windows 10 Pro 64-bit
java version "1.8.0_251"

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
I think the number of 9 elements in the list is intentional, as they map to the keys 1 to 9 on the keyboard as shortcuts in the menu.

@asfimport
Copy link
Collaborator Author

@FSchumacher (migrated from Bugzilla):
@ALL, what do you think of auto-cleaning the recent files list. We could filter out those entries, that we can't read (while generating the menu entries)

That could be problematic, if users accessed files on network/removable drives, which would be removed if the path is not accessible at startup/loading/saving of files.

@asfimport
Copy link
Collaborator Author

eR@SeR (migrated from Bugzilla):
(In reply to Felix Schumacher from comment 4)

I think the number of 9 elements in the list is intentional, as they map to
the keys 1 to 9 on the keyboard as shortcuts in the menu.
Hi,

OK that makes sense.

(In reply to Felix Schumacher from comment 5)

@ALL, what do you think of auto-cleaning the recent files list. We could
filter out those entries, that we can't read (while generating the menu
entries)

That could be problematic, if users accessed files on network/removable
drives, which would be removed if the path is not accessible at
startup/loading/saving of files.
If auto-cleaning the recent files list might be problematic Pop up dialog could be an alternative and ask the user whether he wants to remove the non-accessible test or not.

Or when the user clicks on the test that is non-existing to show pop up:

(In reply to eR@SeR from comment 0)

Created attachment 37651 [details]
Open recent menu files

Pop up "C:\Users\NA\Desktop\test1.jmx (The system cannot find the file
specified). Would you like to remove the file from the recent list?" is
shown, Yes/No buttons are offered.
Any solution that avoids the Registry entries manipulation is good one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant