How do I find the control to test against with CodedUI in VS 2015? - coded-ui-tests

I'm using VS 2015 Enterprise. I'm new to CodedUI testing. I've added a CodedUI test project to my solution. I've created a simple test, clicked on a button, selected a radio button, etc.
I've been following a Pluralsight course titled "Test Automation with CodedUI". I want to find a control on the WPF form, but once I select the control finder in the test builder and move the mouse off to the running application, it is no longer a bulls eye. I don't understand why its different than what's shown in the Pluralsight course. I think the instructor used VS 2012. Could that be the reason?

There are subtle changes between versions. After clicking the assertion builder button in the Coded UI recorder then, as you move the mouse pointer around the screen (do not move it too fast or you will confuse yourself), you should see a blue rectangle drawn around parts of the screen. As you move the mouse pointer carefully you should be able to select larger or smaller sections, corresponding to higher or lower items within the hierarchy of controls on the screen. Click on a control of interest. You should then see a window showing the properties of the selected control. There are four arrows (up, down, left and right) in the new window. Click on these to navigate around the control hierarchy. Note that and 'up' followed by a 'down' will seldom return to the same control. The 'up' moves the parent control and the 'down' moves to the first child.

My suggestion here would be to use the keyboard shortcut to enable the control finder. When you hover over it with your mouse you should see it - if I recall correctly it's "Alt + H". Basically you'll move your mouse to the control you want to identify, then do the keyboard shortcut, then click. It should identify the control correctly at that point.

Related

Xcode 10 - how to pin UI element library window?

I'm laying out UI on a storyboard using the new, controversial library button which has been moved up.
This is driving me crazy - I want to be able to "PIN" this window to a secondary monitor so I can always see available components as opposing to having to click that button every single time I need an element. Currently it disappears, even on secondary monitor once I shift focus to the view controller on screen.
How do I pin the UI Elements library to be able to always see it ?
You can press the option button in keyboard and click in the library window, it's will hold
Picture of library windown

How do I reset my Visual Basic Editor Layout?

Something has gone terribly wrong with my VBE layout. I originally closed my Project explorer and was trying to figure out how to restore it when I made some changes under the window tab of the ribbon.
I've restored the Project explorer but I can't for the life of me reset my code window to display only the current module I'm working on. The resulting layout is hideous, truly atrocious, and difficult to work with.
disgusting VBE display
I've already tried resetting my registry key for VBA as recommended here to no avail. I believe I clicked on either Cascade or Tile Vertically to make the code block appear this way.
Any help would be greatly appreciated.
You've never hit 'Restore Down' before on the Windows controls? Click it again (it will now be called Maximise) to put things right.
Click the square box of any of the windows in the upper right corner for it to fill the window, and then you can navigate using the project folder structure to the left, or the Window menu at top. Windows can be dragged and "docked" at different positions. For step by step instructions on how to dock windows in the VBE, including video see this site, for example
Try setting the code windows in your layout to how you like them. Then add a module to your project, then exit Access. It seems to save the layout at that point.
You can then delete the empty module.

In gnome 3, how to let a window get focus but not on the top?

Windows get focus is meaning that you can type in something in that. But at the same time, I hope that windows not to cover some others. How to config gnome 3 to implement that?
Leaving a window in focus though not on top of the screen is quite easy in Gnome. It is possible to give each and every window a special attribut which will shift their priority on the screen.
First, right click the titlebar of the application which should always be on top. A small menu should pop up. Now just select the option "Always on top" and you are done. This option may be parsed to multiple windows. Independently of which window is in focus, the application with this attribute will always cover it.
By the way the so called "Titlebar Actions" can be configured through the gnome-tweak-tool. Under the "Windows" tab you may define what should happen on a double click, a middle click or a secondary/right-mouse click.

Why is Excel / Word 2013 starting invisible?

Our Company recently upgraded to Office 2013 since we want to use SharePoint 2013.
We had several issues with the new Office Version but Microsoft has already solved some of them.
Anyways, one thing sitll grinds my gears:
Excel or Word sometimes starts invisible. It is visible in the Taskbar but the window doesnt pop up. I can click on the Icon in the taskbar but it doesn't change anything. The only way i figured out to show the window, is to use [Windows] + [Arrow Keys].
I can't tell the constellation why this is happening but most of the time it is if there isn't already another instance of the program running.
I don't have Office 2013 at home to reconstruct this but I have seen this on different Computers at our Office.
Now does anybody know about this issue?
What can I do about it?
Is it known to Microsoft?
Any help is appreciated.
I don't think that it's invisible, it's just starting off screen somewhere. Perhaps on a second monitor that is no longer there (or moved virtually to the other side). The [Windows] + [Arrows Keys] just moves the window onscreen where you can see it.
Alternatively, you could hover the mouse over the icon on the task bar, right click on the preview window and then select Move (if Move is grayed out, select restore and repeat). Then, hit any [Arrow Key] (this will attach your mouse to the window caption bar) then move your mouse (without clicking anything) until the window shows up on screen.
By doing this you can figure out what side of the screen the application is opening up (not that knowing helps much). Excel should just show up where ever you had it last, but it will not remember it's location if you snap it to the sides or top of the screen (which is what you were doing); It will only remember the Normal View size and position of the window.
My workaround for this bug is to click the Taskbar icon for the new (invisible) window while it's active, which minimizes the window, then click it again to restore it. Then it becomes visible.
I have the same issue, and it's definitely an invisible window, not off-screen (see workaround below).
It only happens in specific circumstances: when opening a second word doc from a sharepoint/office 365 location, the second doc gets a taskbar icon, but no visible content, so the first doc is still visible (but the second doc is invisibly in front of it).
The workaround is to click the minimise button on the first doc. Nothing will appear to happen because it's the invisible second doc window that receives the click event. Then select the icon on the task bar to make it reappear, properly visible.

System wide right click context hook

**Hello..
i am creating English To Gujarati Dictionary WinForm Application.
I need to set a system wide hook to the right click context menu on for text selection.
it means when this application is running,and if user selects word from any program and right click on it gujarati meaning of that word should be displayed as menu item.
How to do this?
or any other options like Registery Programming,shell extentions etc...?
i have to do this,even if you say its not possible.
so please help me.**
Hooking the mouse activity is the easy part. See SetWindowsHookEx, and lots of questions regarding hooking in SO. This way, you can tell when the mouse is right-clicked.
Getting the selected text is the harder part. See WindowFromPoint, for starters. You'd have to recognize the control, and if appropriate get the selected text from it. This will not always be possible using simple Win32 functions, if the control is complex.
Adding the translation to the right-click menu is probably the impossible part. Adding stuff to explorer context menu is not a problem, because explorer provides that possibility. But various applications will have various right-click menus, without a way to extend them. They might not even use Win32 for the menus, for whatever reason. A better option, IMO, would be one of the following:
Forget about changing the right-click menu. Open a window next to the point of selection with whatever content you want, and let the application show its own right-click menu.
If the user right-clicks while, say, pressing shift, show your own right-click menu, and don't pass the message to the application. So the user will see only one menu, which is yours. The user must of course be aware of this combination.

Resources