Unspecified error in JavaEdit.Set - automation

I have few issues working with QTP:
• I am setting 100 value to using a JavaEdit box.
• I have added the objects to the objects repository using object spy.
• I get an error “ Unspecified error” when I run my action and it takes more time to give this error.

Try JavaEdit.Type instead.
The difference between the two are that JavaEdit.set clears the edit box and sets the edit box to the value whereas JavaEdidt.type types each character into the edit box.
The only problem would be if the edit box already contains text but that may not be a problem for your test.
Also make sure you have the correct details in the Object Repository.

Related

Remove Attributes on Rubberduck VBA

I'm just getting into using Rubberduck for my VBA applications. I came across a great post on adding attributes here:
How to set the Attribute VB_PredeclaredId using RubberDuck '#PredeclaredID
However, what if I want to remove the attribute? It seems like the only way to do it is via code inspections. However, after you initially set the '#PredeclaredId, there's no longer any error that shows up. So the option to remove the attribute is no longer available.
I tried deleting the attribute, but the "Predeclared" annotation is still in my explorer:
I'm sure I can export, edit in the text editor, and then re-import again, but one purpose of rubberduck is to avoid doing that.
Thanks.
After deleting the attribute annotation there will be a new "attribute value out of sync" inspection with 2 options:
adjust attribute value
adjust annotation
You want to do the first option which will nuke the hidden attribute value.
Update
Another 2 alternatives:
indent the module ctrl+m
cut and paste the code ctrl-a ctrl-x ctrl-v
Both these options will wipe out the attribute values by forcing VBA to recompile the module without them. This is normally an annoyance (indenting my project wipes the attributes and I need to restore them with RD annotation inspections)
Final thing remember to refresh RD code explorer so it picks up the changes and the icon will change. This often happens automatically though.

In VS2022 when debugging: Unable to set the next statement. Class not registered

I am debugging a .NET C# solution in VS2022. Whenever I attempt to set the next statement I get the error message
Unable to set the next statement. Class not registered.
I am also not able to hot-reload either when I make a change. If I make the slightest change (even just adding some whitespace) and the click on the hot reload button I get the message
This source file has changed. It no longer matches the version of the
file used to build the application being debugged.
I appreciate that the second statement is more common but I thought the point of hot-reload was that it recognised that the file had changed and would reload it!
I have found links for the first message but never in combination with the class not being registered.

Netbeans IDE 8.1 warning for Class Length

I'm using Netbeans IDE 8.1 version for MVC (Codeigniter). In Model i'm getting warning like Class Length is 251 Lines (200 allowed).
What is exact meaning of this warning and if not resolved, then what exactly will happen ?
First, this warning is nothing to do with CodeIgniter. NetBeans is simply giving you a friendly advisory warning that your PHP class is more than 200 lines long (251 lines in your case).
Nothing bad will happen if you get that message, but you may or may not appreciate it. Either way, it can be configured as follows:
The message can be suppressed entirely if it is considered unhelpful.
Alternatively, the message can be shown as an "Info", "Warning" or "Error" message. By default it is a warning message.
The number of lines allowed before the message is displayed can be adjusted up or down as desired. The default is 200 lines.
Configure the message as follows:
Tools menu -> Options -> click the Editor icon -> click the Hints tab.
Select PHP from the Language drop list.
Select the Too Many Lines node from the list of message categories, and expand it.
Simply uncheck Class Declaration if you don't want to see the message at all.
Otherwise, select the severity of the message from the Show As drop list, and adjust the default line threshold of 200 if appropriate.
Here's the configuration screen:
Finally, note that these configuration settings are global. I don't believe it is possible to customize the message individually for each PHP project.

Unable to add the parameter field in crystal report

I am developing a windows application and am using crystal reports in it.
I am trying to add the parameter field in it, however, when I click on the OK button, it is just not working.
Am I missing anything out?
I have Uninstalled and Installed Crystal Reports, its working fine now...
There could be 2 possiblities.
1) Just checked on my PC, just be Right Clicking Parameters -> Add -> Leaving everything as is (defaults) I am able to create a parameter. You must have changed some setting inside. Use defaults to confirm that you are able to create one.
2) You are missing the Value Field. This field specifies CR which database field to work upon when the parameter is used.
The drop-down will list all the database fields available for use.
Besides, here are few tutorials that explain how to use parameters that might guide you.
Good tutorial on parameters in CR
Video Tutorial for the same

Clicking and draggging a user control in VB .NET creates object reference error message

Failed to create component 'User Control 1'. the error message follows:
'System.NullReferenceException : Object reference not set to an instance of an object.
at System.ComponentModel.ReflectPropertyDescriptor.SetValue(Object Component, Object Value)
.............. etc..........
What should I do to fix this error?
When a User Control won't load into the Visual Studio designer here is what you need to do. These instruction are for vb.net project but c# should be similar. Also, before doing this close all open windows (or at least the source and designer files of the control you are working on.)
One last thing. The FIRST thing you should do is ensure that restarting visual studio doesn't fix the problem. If not you can try the steps that follow. These instructions assume that the errant user controls are in control library project in visual studio. If not you should be able to adjust the directions a bit to get it to work but it is much easier when the control is in its own project.
Do the following:
Make the control library your startup project.
Open the properties for the control library project and click on the debug tab.
Under Start Action click the Start external program option and browse to the Visual Studio executable.
NOTE: what this means is that when you run your solution it will fire up another instance of Visual Studio instead of actually running your solution. The First Instance of Visual Studion (INSTANCE_1) will "host" a second instance of visual studio (INSTANCE_2) when you run it.
Run your solution. INSTANCE_2 will load.
Switch back to INSTANCE_1.
In INSTANCE_1 hit CTRL-ALT-E. This will open up the exceptions dialog box. Check On the THROWN column checkbox next to Common Language Runtime Exceptions.
NOTE: This will ensure that INSTANCE_1 will BREAK at ANY runtime error even if it is hit in a try block.
Switch to INSTANCE_2. In Solution Explorer double-click to open the errant user control.
You should find that INSTANCE_1 OF Visual Studio should have stopped at the line of code that caused the designer to not load the control. Fix the code (which usually means testing for IsNot Nothing before references an object properties...but could mean other things.)
Also, sometimes I find that the control WILL load in INSTANCE_2 instead of breaking on an error in INSTANCE_1. In that case just stop debugging...close INSTANCE_2. Save/Restart INSTANCE_1 and your problem will often have gone away.
The lesson is this. User Control MUST be able to load/reference all objects and their members in order to load it into the designer. So for User Controls that will be placed onto other containers I will usually design events to notify the parent rather than trying to push objects into the child control.
Hope this helps for future reference on this old question.
Seth
Instead of the error occurring when you open up a form for editing, it sounds like this is occurring when you are already editing a form and adding new user controls. A CodeProject article that was previously mentioned shows what to do in the case of a form not loading correctly, rather than a specific user control.
Does your user control have any properties that map to custom objects (i.e. not Integer or String)? If so, the Form Designer will attempt to load your properties into the Property Editor. If showing the properties generates an error, the Form Designer will show that to you. I think this is what is happening with your user control.
If you could edit the question and add more information about the nature of the error (more of the error text), it would assist others in helping you better. Alternatively, see if you can find the property that might be causing the error (e.g. whether any property relies on a non-null value being set). You can also take a look at this MSDN article for tips on how to limit the control for just run-time.
Thanks, Seth, for this post! Your solution helped me nail down the error. The only thing I would add to this is that when "INSTANCE_2" loads, you may need to actually load the project file in INSTANCE_2. I needed to because I wasn't dealing with a control library, but instead had custom User Controls defined in the same project that the forms were located in. Once I loaded the project in INSTANCE_2, I opened the erring form and that caused INSTANCE_1 to pop up to the line of offending code in the User Control.
I have found that this error often occurs when control dlls are not building properly. 95% of the time this is remedied by simply restarting Visual Studio.