coded ui tests : How to set folder path needed in an explorer browser for folder? - coded-ui-tests

I'm writting Coded UI tests for a desktop WPF application.
One of the inevitable steps of the scenarios is to select a folder with a windows folderbrowserdialog.
When I record this step with the automatic recorder, it appears that the engine create as many TreeItems as there are levels in the folder full path to be able to select the last TreeItem (which is the folder needed) and then click on OK button to let the application get the path of the selected folder.
I was wondering if there was an easier way or more elegant way to do this, like setting the full path in one go on any propertie of the browser window control?

When I met standard windows dialog such as 'Open File', 'Save File' etc I usualy typed full path of desired location in 'File Name' textfield and then clicked OK. Fast and simple.

Related

how i can change the default icon in the left of the window in Mac OS?

Now I want to design a simple game by using python, the step I want to do is to add an icon on the left of the window.
However, when I type
game_window.iconbitmap('favicon.ico')
game_window.mainloop()
the system just tell me Document Drag Error.
I am sure I save favicon and the both in the desktop and both of the path is correct.
I search this question in the internet but all of them are using window os.
If your icon is in the same folder as your file, the script will surely work...
I think that you're getting the error because you didn't save the file you're working on for the first time.
Try the following:
Save your file in the same folder another time (if you've already done it).
If it doesn't work, then write the full path of the icon

Glade GtkFileChooserDialog is selecting both folders and files

I'm using Glade and GTK3 to build my Python 3 UI, and am using a GtkFileChooserDialog to select a file. But this dialog, even though my Action is set to Open, is allowing me to select folders as well. If I double-click on a folder, it opens it and allows me to search further for my file. But if I have a folder selected and type Enter or click the OK button, it returns that folder name. I want it to ONLY be able to return a file with a particular extension.
I see other posts where they have a hard time allowing selection of either a file or a folder, and most solutions talk about adding another button. But here I'm getting that behavior but don't want it.
Before I transferred my program over to a Glade interface I got the desired behavior. So is there some setting in Glade that I need to tweak to NOT return folders from my chooser? I can't seem to find it.

Can I skip file validation when programmatically opening a workbook?

I have a roughly 100MB-large Excel file that I am opening with this code that runs when a UserForm button is pressed:
Public Sub SelectButton_Click()
fNameAndPath = Application.GetOpenFilename(Title:="Please Select a Report")
If fNameAndPath = False Then Exit Sub
End Sub
Because this file is so big, it takes a while to validate before opening, and this validation makes up about half the time my entire macro takes to complete (I'm working in Excel 2013 and this file is not opening from a network or shared drive). If I open the file manually, then I get the option to skip validation after three seconds of validating. The problem with this is that it opens the file in Protected View, where I can't work with it.
Using VBA, is there a way to "force skip" this time consuming validation while simultaneously avoiding Protected View?
When Excel is completely closed, this warning/guideline appears in the bottom left of the opening splash screen:
When Excel is already open, this warning/guideline appears in the bottom right:
So far there are two solutions that I've found to be useful for solving this problem, thanks to the comments above:
1. Disabling Office Validation for Excel files in the Registry settings for Windows:
I prefer to use early binding, so I would suggest in the VBA editor window, opening the Tools window, selecting 'References...', and then checking the box next to 'Windows Script Host Object Model', and clicking OK. This will enable IntelliSense as you are writing your VBA:
Dim wsh As New WshShell
wsh.RegWrite "HKCU\Software\Microsoft\Office\15.0\Excel\Security\FileValidate\DisableEditFromPV", 0, "REG_DWORD"
Set wsh = Nothing
This will work for Excel 2013. If you have a different version of Office or Excel, you will use something other than 15.0 in your file path.
However, this method has the glaring problem of removing validation of any Excel file on your computer, even those that might have malicious code in them or that might run from dangerous locations, such as your Temp or Downloads folder.
Additionally, writing to the Windows Registry might be disallowed depending on your current environment or permissions. For that reason, I recommend a different solution:
2. Setting the location of the Excel file to be a Trusted Location in Microsoft Excel:
It's possible to set a new Trusted Location in the Registry via VBA, but since this method is intended for use by those who can't access the registry, we won't get into that.
To add the file's location (let's say it's the "Excel Files" folder in C:\) as a Trusted Location, first click the File tab and then click Options at the bottom of the File Menu:
In the Excel Options window that opens up, click on Trust Center at the bottom of the side menu and then click the Trust Center Settings button that appears on the right:
Finally, click the Add new location... option and enter C:\Excel Files\ (or whatever your folder location is; you can even browse to it), and then click OK. You can also check the option to include subfolders if you want.

Unreal development kit export textures

I am not familiar wit UDK tool, bot I have complete source code (Binaries directory, Development directory, Engine directory and UDKGame directory) from one game and I want to export all textures from this project. How is it possible?
In the UDKGame directory of the game should be a directory called Content. Copy all files in that directory to the directory of the same name of an installed version of UDK e.g. C:\UDK\UDK-2013-07\UDKGame\Content.
Start the UDK editor, the easiest way is to use the shortcut in the start menu called "UDK Editor". Open the Content Browser. If it is not already open, click on the black t symbol in the menu bar of the editor. The window of the content browser might be reduced to a little bar.
In the lower left of the Content Browser window, under "Packages", search for the name of the *.upk files you copied to the Content directory earlier. They are like zip files containing the textures among the assets of the game. But only the UDK Editor can view and interact with them.
When you are inspecting a upk/package look for icons with Texture2D written on them, these are textures. Right click on a Texture2d, choose "Export to File...".
If a package appears to be empty right click it and choose "fully load", the UDK Editor might not have it loaded yet.

Add an already existing directory to a directory in Solution Explorer

I want to add an already existing directory to a directory in Solution Explorer, but whenever I right-click on the directory and select Add => Existing Item, I can only add individual files, but not directories.
How do I add an already existing directory to a directory inside a Project inside Solution Explorer?
Click the 'Show all files' button at the top of the Solution Explorer and right click the folder desired and select 'include in project'.
Drag and drop the folder from Windows Explorer onto your Visual Studio solution window :)
Source here
or simply copy & paste into solution explorer.
VS 2012 seems to distinguish between 'Solution Folders', which are only folders containing either other solution folders, or containing project folders. The drag-and-drop works (with my settings) only for the project folders, and no for the solution folders.
If I add a new solution folder, nothing happens on the machine. If I drag-and-drop a machine folder to the main Solution, it refuses to accept it. If I drag-and-drop the folder to a Solution Folder, I get an error message saying this cannot be done.
Some other answers are missing an important point: if the folder is not in a project in the solution it is impossible to add the folder
This is the solution:
1) Add a new folder to the sln - it does not care that the folder already exists on the disk because this a virtual folder in the sln
2) Add the file to the folder using "add existing files"
When dealing with a solution level folder that has been removed for some reason, and now needs to be added back, open the .sln file in a text editor like notepad++.
Find your "FolderName" in the section that looks like this...
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NewFolder1", "NewFolder1", "{73ED84FC-F250-4CCC-B267-34CEB67F2883}"
EndProject
Delete from "Project" to "EndProject" ONLY for the specific Project/Folder you're having trouble with.
You may get a message in VS2012 that says your solution has been modified by an external source. Choose the option to "Discard" your changes for the external changes. Lastly, add your solution level folder, and add your project(s) to that folder as existing items, drag/drop them, or copy and paste them, according to your preference.
For those who had a hunch it could be done but weren't able to do it, NOTE: Drag Folder or Files ONTO the name of the Project Name in Solution Explorer in the least
Expand the "Project" item in the menu bar and select "Show All Files". Then locate the folder you wish to add in the Solution Explorer (folders that are not currently included will be light grey with a dotted outline instead of the usual solid icon) right click the desired folder and select "Include in project"
Once finished select "Show All Files" from the Project menu again to return to the regular view.
(This is very similar to Radenko Zec's answer, but does not require the "Show All Files" button to already be present in a toolbar. I would just leave this as a response to his answer, but I don't currently have the reputation to leave comments.)

Resources