Coded UI: How to automate the windows that are closing when crosshair tool is placed on them? - coded-ui-tests

I am using Coded UI Test Project(Universal Windows)for automating Universal Windows apps.During automation of Universal Windows apps,I made assertions through crosshair tool and tried below scenario:
Launched calculator app--> From more options,I selected "Date calculation"option--> Clicked on "From" or "To" calendar--> Related calendar window opens--> Tried to make assertions through crosshair tool for selecting From and To dates for calculation of dates.At this point on wards when crosshair tool is placed on opened calendar windows,calendar window is closing and I am unable to make assertions and automate.

It can be captured using WindowsLogo + I (Visual studio 2010), but it would not work if you are using Windows 10 os. Reference
For, Visual studio 2013,2015 Ctrl + I can be used.

Related

VBA Find What Default Text

How do you prevent Visual Basic from setting the default find (Ctrl+F) text to whatever iss selected?
For clarity: In Visual Basic for Applications if you bring up a Find box it automaticaly sets the "Find What:" text to whatever you have selected in the code window. Idealy, if I closed the find box it would reopen with the find text I had last used (like every other program).
Visual Basic for Applications 7.1
Microsoft Excel 365
I've checked all the standard menus, there's not many and I'm not sure where else an option like that could be stored.
While this is technically in the Visual Basic for Applications on an Excel file I've also observed the behavior in the other office applications.
Conclusions, you can't.
After looking further and feed back from others it appears you can't change the behavior of the Find What input box within Microsoft Visual Basic for Applications. However, if you're looking to repeat a search pressing F3 to Find Next while your cursor is in the code window accomplishes much of the same thing.
Thanks JohnM, I think this is as close to an answer as I'm likly to get.

Custom Pane In Excel

I am trying to create a custom static pane on the right side. so it shall be independent of zoom and scroll function in excel. please see the image for more. I tried the following. but no success.
I not sure whether the split-screen function in excel can help to achieve this.
Please note: I want to do it in page layout mode. as I was to set cell sizes in inch.
I tried the following.
ActiveSheet.Range("H1").Select
ActiveWindow.FreezePanes = True
ActiveSheet.Range("H1").zoom = False
I have no idea to make it work, as I am new to VBA. I need a user interface something like in the picture below. so I can scroll on the left but static part on right. in the static part, I would be able to add custom controls like Combobox, command button, TextBox, etc. Thanks
You have 2 solutions:
VSTO Taskpane add-in:
Custom task panes give you a way to create your own task pane and provide users with a familiar interface to access your solution's features. Custom task panes let you integrate your features into a familiar user interface. You can create a custom task pane quickly by using Visual Studio tools.
Document: https://learn.microsoft.com/en-us/visualstudio/vsto/custom-task-panes?redirectedfrom=MSDN&view=vs-2019
Office JS Taskpane add-in:
You can create an Office Add-in by using the Yeoman generator for Office Add-ins or Visual Studio. The Yeoman generator creates a Node.js project that can be managed with Visual Studio Code or any other editor, whereas Visual Studio creates a Visual Studio solution. Select the tab for the one you'd like to use and then follow the instructions to create your add-in and test it locally.
Document: https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-quickstart-jquery?tabs=yeomangenerator

Is there a way to keep Coded UI Test Builder tool from hiding Visual Studio?

One of the many "features" that annoy me about using CodedUI for test automation is that the Test Builder tool hides Visual Studio when you open it to try to spy an element. This is extraordinarily annoying when you're trying to maintain legacy scripts that aren't working correctly. How do I compare the existing location properties of an element to see if they are compatible with the current state of the application? Currently, I have take a snapshot of the CUITB window, close the tool and then paste the result into something else to compare.
This is especially infuriating because the properties found by the CUITB have little correlation with other spy tools like Inspect, Snoop, etc. rendering those tools unusable for hand coding Coded UI scripts.
Is there a way to configure VS or the test builder tool to NOT hide VS while spying on screen elements? If this is possible, I haven't been able to figure out how to do it.

Userform toolbox additional controls dialogue window not showing

While using MS Excel (Outlook, Word, or Power Point as well apparently) I create a userform. The toolbox shows up showing controls tab and 16 icons representing various controls. When I right click in some empty space in the tool box control area, a menu comes up listing "additional controls" at the top and two greyed out options below it. When I select "additional controls" a spinning blue circle appears briefly then disappears and nothing happens.
It is my understanding that a dialogue box should open at this point and I should be able to select some additional controls.
I noticed the problem while trying to follow a video on how to data scrape for my personal project which I asked for help here.
What I have tried
Creating a user form on another computer and then importing it to this one. No success.
Repairing MS Excel. This resulted in a full reinstall I believe as I had to re enter my product key. No success.
Resetting various registry keys as mentioned in this article. No success.
KB 369383 as mention as part of the process above. No success.
Issue described here but no solution, just a work around to something to what the person was trying to add.
Setting MS Excel to run in compatibility mode. There was no compatibility mode listed as an option under properties for the desktop icon.
Running as administrator even though my Windows account has admin rights. No change.
Cleaning the registry with both ccleaner and wise registry cleaner.
Running Excel in safe mode using excel.exe /s. Confirmed with (safe mode) in the title bar. No success.
My System
Windows 10
MS Office Professional 2013 - 32
(Note, no crystal reports added that I am aware of)
Additional Info
I tried another Windows 10 machine running same version of MS Office and it worked there, so it should not solely be a Windows 10 issue. My machine was an upgrade from Windows 7 - 64. The other machine was an upgrade from windows 8.
I created a new Windows user account and the dialogue box comes up for that account. At least now we know that its SOMETHING to do with my user account/profile.
I found a solution to 'my' problem after spending 2-3 nights over this. It turned out to be a very simple and not-so-intuitive fix.
My problem was that when I right-click on the Toolbox, I do not even get to see the "Additional Control" option in the menu.
Click on the userform, so that its selected.
Now go to Tools and Additional Controls is no longer greyed out. :)
Make sure the the Toolbox window is selected first then click on the Tools menu and Additional Controls should then be visible
In my case it was the toolbox that needed to be selected and not the userform.
When toolbox is selected, bam! the "Additional Controls" is no longer greyed out.

Shortcut to run a project in VS 2012

I'm working on a large Silverlight solution with 75+ projects. Instead of right clicking on the start up project and then selecting Debug | Start New Instance... I'd like to use a keyboard shortcut to run this specific project. Hitting F5 is a non-starter, even if I select the option to only build the start up project and it's dependencies. Takes too long.
Accomplishing this was easy with the macro functionality in VS 2010. I haven't been able to find a good way to replace this capability in VS2102. Note, I have tried the Visual Commander extension but it doesn't seem to be able to automate this kind of command sequence.
While you can't record it automatically, you can just paste this code as a VB command in Visual Commander with your project name:
DTE.Windows.Item(EnvDTE.Constants.vsWindowKindSolutionExplorer).Activate()
DTE.ActiveWindow.Object.GetItem("MySolution\MyProject").Select(vsUISelectionType.vsUISelectionTypeSelect)
DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Debug.Startnewinstance")

Resources