I am curious about an issue in Coded UI Testing. For example I created a button named Button1. I did assertions and everything is fine. Then I changed this button's name to Button2. Now, do I have to write my assertions again or is Coded UI Test can suit in every different name change. Notice that I am not doing any input or parameter changes, I am just changing user interface. Thanks for your replies.
You should be able to change the test code easily to cope with a name change like that. Open the UI Map file in the UI Map editor; ie double-click on the uimap.uitest file in solution explorer. In the left hand pane expand the method and select the action that clicks the button. That should open the relevant control in the right hand pane. Alternatively just find the control for the button in the right pane. View the properties of the button and click on the ellipsis of the "(collection)" value of SearchProperties or the FilterProperties. One of the items shown should be the old name of the button, just rename it there.
Related
I am creating a vb.net program in visual studio 2019 community. I have created a form with several buttons and group boxes. Within the group boxes are radio buttons and or Check boxes. The form also uses 2 custom controls. 4 instances of Custom control "A" is on the form at design time. Two instances of Custom control "B" are added at runtime and more can be added by the user with a button click. Note that custom control "B" has within it 4 instances of custom control "A".
The problem is when I run the program and press the tab key I do not get the expected behavior of focus moving to the next control. Nothing happens when tab is pressed. Pressing the tab key does nothing regardless of which control I give focus to.
I have set tab stop to true on all the controls I want to stop on. I have set the tab index values in the order I want.
Thinking maybe it has something to do with the custom controls...
I tried removing the code that adds custom control "B" at runtime so that no custom control "B" is on the form. That did not help.
In addition to removing control B I disabled all Custom control A. That did not help either.
Is there a setting somewhere that enables the tab button to work as expected?
What else should I be looking at?
Ok so this appears to be unrelated to the form. I failed to mention this is an add in for another program (Autodesk Inventor). I also failed to consider that inventor may be handling the tab key, which appears to be the case...
https://adndevblog.typepad.com/manufacturing/2012/05/handling-tab-key-in-inventor-net-forms.html
I want to look at (a label name for example in) the properties box (shown by clicking the element in the interface window) and scroll through my code until I find what I'm looking for. The problem is that as soon as I click the code window, properties goes blank.
Is it possible to change this behavior?
It's annoying to copy and paste or (gasp) remember what I was just looking at.
the properties window is context-sensitive, so it shows properties for whatever it is you're looking at - in your case, code. now it just happens that code has no properties to show, which is why its blank.
I wouldn't want to change it - next thing you know, you'd be clicking on something and not seeing the properties for it! That would be bad.
Is there a quick way to jump to an action associated with a control.
Say there is a button on a XIB file that has an associated action. The way to find the code associated with this is rather tedious. Is there a short cut that can quickly jump to the code.
I am spoiled by Visual Studio - double click on a button and it takes you to it's handler
The fastest way I know to at least get quickly to the source file in which the action resides is the following:
select the button in the UI editor
hit ctrl+1 (this will open the “Related Files” drop down)
navigate to the “Sent Actions” sub-menu, e.g. via s, enter
select the relevant class (I think in this case there can only be one, so just hit enter again)
Once you are in the class, the action should be easy to find. If that's not the case, because your source file is so big, type ctrl+6 to open the “Document Items” drop down and start typing the name of the action. Once you see the action, select it via keyboard or mouse.
If you often don't know the name of the action, you will have to look it up before navigating to the class, e.g. by right clicking on the button.
I would advise to use ^+⎇+⌘+Enter to get to referenced code file. There you can search for #IBActions or #Outlets. If a UIButton has a segue attached, this method won't help to find it.
To review a list of actions, segues and outlets you can select an object on the storyboard and press ⎇+⌘+7 to open Connections Inspector on the right pane.
If you use the Visual FoxPro 9 Application Framework to create a desktop standalone application and add a database and form, the exported exe shows a Quick Start on load which shows the form to select.
If one wants to show up his own MAIN MENU form on the exe load, what's the way to do it? Using Set Main on the Menu Form does not work.
Here is a visual representation of the idea.
In its simplest steps then, aside from the "Wizards" you can use to build forms and bind to data environments, tables, grids, etc maybe this will help.
Create an empty project.
CREATE PROJECT MyApp
Go to the documents tab and add a new form. Put a few buttons as you've described on it. One of the buttons, allow to close the form, such as "Exit". Double click this exit button and put in the code
CLEAR EVENTS
THISFORM.RELEASE()
Since there are no "data entry" elements on this form, we need something to make it keep focus. Buttons alone don't just "do" that. Go to the properties sheet of the form and go down to "Window Type" and set it to "Modal" - meaning, keep this form up until its intentionally closed. (This also keeps as a baseline for you calling any OTHER forms from this one for your application.) Save the form, such as "MyMainForm".
Click on the "Code" tab of the project and do a new "Program". In its simplest context, put in
DO FORM MyMainForm
READ EVENTS
Save the program, such as MyStartupProgram. Once saved in the project, right-click on this program and select "Set Main" for this to be considered the single entry point to your entire application. Save, build the project and run it. You should be good to go.
I'm not sure if this is right, but I can't view the "code behind" in VB6. Everytime I click the "view code" for an object (for example a button), the code does not display.
Can you help me with this or any workaround for this? I need to do a breakpoint on this.
I ran into the same issue. Could not view the code or the designer.
Seems that VB6 lost track of where things should be displayed, whether offscreen or not I could not tell. Kept clicking View Code and View Object, and neither worked.
Found the solution:
Attempt to open the code or designer that doesn't show up. (It will get opened, just won't show)
Select Window from the menu, then select Cascade.
You should then see the code/designer show up on the screen. No re-install or remove/add needed.
You may need to do this each time, even after saving the .vbp (project) file, upon re-opening VB6 the files once again are not showing for me, but Cascade makes them visible again. (Anyone have any ideas on how to make this more permanent?)
Enjoy!
You may remove the form which is not showing the code in the project explorer window and add it again by right clicking on the project explorer window then select Add -> Form -> (instead of selecting in "New" tab navigate on the "Existing" tab then choose the form you have just remove and try viewing its code again). It will work 100% :D
Double click your controls and the source code will be shown.
Go to this link.
vb6 tutor