How to upload and sync PAF scripts to ALM - ipaf

What are the steps to Sync/Upload PAF Scripts to execute test cases in ALM from IDE?

PAF Scripts can be uploaded to ALM from IDE.
To Upload the scripts, click on the dropdown next to the Run button
on the IDE and select “Run Configurations…”
On the “Run Configurations” window, select “ALM Sync” → Select tab
“Arguments” → Enter the flow id and flow xml path in following
format. createTestCase flow_id flow_xml_path
Click on “Run” button and the Test Script should be uploaded to ALM.

Related

Intellij PyCharm/Idea/etc: how to add a toolbar button that runs a shell script?

In Intellij IDE's such as PyCharm or Idea there is an option to customize the menu and toolbar by right-clicking the toolbar and picking Customize menus and toolbars. While it is possible to select almost any IDE action there doesn't seem to be a way to add a button that runs a custom shell script. The only way to run a shell script seems to be by adding a Run Configuration of type Shell Script and then invoking it via the Run button, but is there a way to have multiple clickable buttons on the toolbar that would run arbitrary shell commands? (no need for an actual console)
In Jetbrains jargon this is called an external tool and is configured under Preferences -> Tools -> External Tools.
Once you added the commands you need as external tools you can add them as toolbar buttons by right-clicking the toolbar and picking Customize menus and toolbars, expand the node under the Main Toolbar, click ➕ to add an item and then type external in the search box to select your "external tools" and optionally set custom icons for them.

Open a folder in vscode through Finder in macOS?

On my windows pc, I would just double click a folder and click "Open in VS Code" to a open a folder, which saved time for me when looking through lots of code online. With Mac, however, I do not have this option. I have to directly open vscode and click "Open" to open a new folder. How do I directly open a file in vscode through finder in macOS?
2023 Update - Use Native Method
Open the Command Palette (Cmd+Shift+P) and type shell command to find the Shell Command: Install 'code' command in PATH command.
Restart all terminal sessions for the new $PATH value to take effect.
You'll be able to type code . in any folder to start editing files in that folder.
If you want to do it in Finder, you can write an Automator script to do it (it's easier than it sounds, AND shows you the power of the OS).
Launch Automator
Create New Document
Create a new Quick Action
Add the Action... (New Method - 10.13+)
Workflow receives current files or folders from Finder.
Add a new "Open Finder Items" action to the workflow. (drag the "Open Finder Items" object, highlighted in the screenshot, to the empty window on the right)
Select "Visual Studio Code" from the list.
Add the Action... (Old Method)
Workflow receives current files or folders from Finder.
Add a new Run Shell Script action to the workflow. (drag the "Run Shell Script" object, highlighted in the screenshot, to the empty window on the right)
Configure the Workflow (Old Method)
Set the Pass Input to be as arguments
Paste the following in the input box:
open -n -b "com.microsoft.VSCode" --args "$*"
Save the action using a name like Open in Visual Studio Code.
You may now right-click on the folder and find your newly created task under Quick Actions.
The simplest solution is to create a Quick Action with Open Finder Items:
This way you don't need a shell script that might break with an OS update or VS Code update
Launch Automator and select Quick Action or File > New > Quick Action If Automator is already open.
Set Quick Action receives selected to files or folders and in to Finder.
Choose an Image (icon) select Choose.. and double click Visual Studio Code in the window that pops up, this will set your quick action icon to the same as VS Code
Add Open Finder Items, Choose open with as Other.. select Visual Studio Code and save your Quick Action as Open in VSCode optionally choose an Image for your Quick Action job done.
Finally just hit Cmd+S to save and name it Open with VSCode
Well you need to understand. macOS has different ways to do things than windows and initially it might be a challenge. For starters you start to make use of Terminal. its beautiful.
Now answering your question.
Open your VS code and then, press CMD + SHIFT + P, type shell command and select Install code command in path. Afterwards, navigate to any project from the terminal and type code . from the directory to launch the project using VS Code.
Using the new shortcuts app.
Download:https://github.com/gluedpixel/shortcuts
Or create it by yourself
Open Shortcuts app > Quick Actions
Change from receive any to Files and Folders
Add run shell script action
Paste the code open -n -b "com.microsoft.VSCode" --args "$*"
Change input to Shortcut input
Click on Shortcut input and set type to "Folder" & Get to File Path
There are some ways suggested here in the VS Code GitHub Issues tracker, but I would go with the first option of dragging the folder onto the app icon if you have VS Code icon in your dock!
If you really want to be able to do so from a right click, then this repository has a workflow solution. https://github.com/Sankra/OpenFolderInVSCode
Drag and drop the folder from Finder onto an empty VSCode window.
Found a way to achieve a 'Quick Action' that met my needs using the following steps using MacOS' Shortcuts app (No Automator needed):
if you are looking for screenshots as well, I wrote a small Notion page
Open the ‘Shortcuts’ app on your Mac
On the Left Pane, navigate to ‘Quick Actions’
On the top bar, press the ➕ button to add New Shortcut.
Click on ‘Any’ and change to ‘Files and Folders’ by selecting only those from the dropdown that appears on clicking the ‘Any’ field.
Click on ‘Action Library’ on the right pane and search for ‘shell’. Drag and drop the ‘Run Shell Script’ onto the main pane. This will add the action to the Shortcut’s flow.
In the shortcut details (on the right pane), make sure Use as Quick Action is ticked and so are ‘Finder’ and ‘Service Menu’.
In the newly added action called ‘Run Shell Script’ write “code “ and right-click to get the below pop-up, go ahead ‘Insert variable’ and then ‘Shortcut Input’.
Click on the ‘Shortcut Input’ tag that appears. A pop must appear, choose ‘File Path’ and just click anywhere else. This will change the tag to ‘File Path’.
Set ‘Pass Input:’ option to ‘as arguments’.
Be sure to set a cool name for your new Shortcut! I named mine a boring “Open in VSCode”.
Open a new ‘Finder’ Instance, right-click on a folder, go to ‘Quick Actions’ > ‘Customize...’
Make sure your Shortcut’s Name is selected. Exit the dialogue and Test!
There is a Terminal command named code, I would stick with it and you should get used to it as well if you are regularly using VS.
Follow the one-time setup with-in VS Code
Open your VS code and press ⌘ CMD + SHIFT + P
Type shell, and select Shell Command: Install 'code' command in PATH from the list
Open Terminal and hit any of the commands below:
code <path-to-folder>
OR
cd <path-to-folder>
code .
OR
cd <path-to-folder> && code .
I've actually managed to have it as an icon you can just add to the Finder window as such:
The script will allow you to open the current folder path in VSCode.
The steps to do so are:
Create a new Application with Automator
Select the "Run shell script" from the menu and drag it to the editor
Paste the following small script to the text area:
finderPath=`osascript -e 'tell application "Finder" to get the POSIX path of (target of front window as alias)'`
open -n -b "com.microsoft.VSCode" --args "$finderPath"
Save the Application to the Applications folder
Right click the app and drag and drop your desired VSCode icon to the blank area to the left of the name and close the Get Info window
Press and hold the Command key and drag the Application to an empty space in the Finder title row like in the picture
Test that it works by pressing on the icon. VSCode should now open with the content of the current folder in the navigation bar
Here is an alternative derived from the accepted answer.
Indeed the accepted solution by #jnovack just opens VS Code for me, but not the desired folder. If VS Code is already running it just switches the focus to a running instance of VS Code.
Solution
Provided that you have the code CLI command installed (if not, go to VS Code and do CMD+SHIT+P>"Shell Command: install 'code' in PATH")
Then open a terminal and run which code. You should get the code executable path looking somethin like /usr/local/bin/code
Then, as per #jnovack 's answer,
Open Automator
Create a new Document (CMD+N)
Create a new Quick Action
Workflow receives current files and folders from Finder.
Add a new Run Shell Script action to the workflow. (drag and drop the "Run Shell Script" object)
Pass input as arguments
Paste this code in the shell command field /usr/local/bin/code -n "$*" or replace with your path to the code executable if it differs from this one.
Save the action
Tbh. I would have expected to be able to use just code -n "$*", but for some reason, the PATH used by the automator's shell seems to be different from that used in the terminal. I'd welcome some input on that matter.
I find this to be the best solution out there:
https://github.com/RoadToDream/SzContext

The option to "Administer Test Controllers" is not available on the Test menu in Visual Studio 2012

I have installed Visual Studio Ultimate 2012 RC Version 11.0.50522.1 RCREL onto Windows 8 RP on a Virtual Machine running Hyper-V on Server 2012 RC DataCenter.
All the documentation states that if you want to administer the Test Controllers in a Load test rig, you have to click on "Administer Test Controllers" in the "Test" menu. However, I don't have that option in the Test menu. I've tried adding it manually, but then it simply remains unavailable.
What am I doing wrong? This is really holding me back.
I am able to administer test controllers by creating a dummy load test and then right-Clicking on the "Controller Machine" Note and selecting "Manage Test Controllers" from there. The issue I have is that I think there might be some other menu items missing: How do you set the active Controller (I have 4 set-up). It seems to try to run the tests locally, but then the TestResults databases I have created for each of the 4 controllers aren't used, and it can't find it.
Edit:
I've submitted a bug with Microsoft at: https://connect.microsoft.com/VisualStudio/feedback/details/758768/can-not-administer-or-manage-test-controllers-from-the-test-menu
As Cybermaxs said, you can find the "Manage Test Controllers" command in the Load Test menu. However, this menu is only visible if you have a C# Web Performance and Load Test project in your solution. It doesn't help you if you only have standard C# MS Test projects.
The good new is, you can manually add the "Manage Test Controllers" option to your Test menu, which is always visible.
Workaround:
Notice that I have a Unit Test project in my solution, but no Web Performance and Load Test projects.
I have a Test menu, but no Load Test menu.
My Test Menu does not contain the Manage Test Controllers option
To manually add the command:
Right-click anywhere in that menu bar area and select "Customize".
In the Commands tab, select the Test menu bar from the drop down.
Click the Add Command button, scroll down and select the Load Test category, and what do you know... there it is. The "Manager Test Controllers" command.
Select it and click "OK" to add it to the menu. Use "Move Up" and "Move Down" to position it to you liking (personally, I prefer it just above the first break).
Click "Close" to save, and with a feeling of success, see that the prodigal command has returned :)
You can right click on a load test.
It is also available in the menu item "LOAD TEST".

No option to open the Build process Workflow Designer

I have a build process in TFS and I'm using Visual Studio 2010. I can view the build process in the default xml editor, but I want to open it in the Workflow Designer.
Mostly there will be an option to open the build process in the Workflow Designer or you can press Shift-F7 and it'll open it when viewing the xaml.
For some reason that has disappeared, any ideas why?
Is there any way to force VS2010 to open a xaml (or xoml) file in the Workflow Designer and / or are there any good Windows Workflow editors out there like Kaxaml for WPF / Silverlight?
I have the same condition.
I have set my default editor for .xaml to the XML editor. This speeds up the load time of the file because it does not have to load the designer, but prevents me from seeing the workflow view of a build process. There is no option in TFS to allow you to view the build in a different editor, there is only a 'View' option.
So here is my workaround:
Find a .xaml form in your solution (not a build process .xaml)
Right click the file and choose 'Open with...'
Choose 'Workflow Designer' and click 'Set as Default'
Click 'Cancel' because clicking OK will try and open the file, fail, and set the setting back.
Now go open your build process .xaml. If it was already opened, nothing will change, so close the tab and try again.
Don't forget to default your setting back.
It's not a great solution, but it works for what I'm doing.
Did you try right clicking the template file and using "Open With" and selecting Workflow Designer?

Visual Studio - Run Batch File

What I would like
I would like to easily run a batch file without leaving Visual Studio. The batch files are not always the same, they change depending on the solution I'm working with.
What I know so far
I know you can create custom shortcuts in the Tools section of Visual Studio (Under External Tools).
My solutions have various scripts/batch files and I wish there was a way to create shortcuts under a solution folder or some other place that is solution specific.
I can create the scripts but there doesn't seem to be a way to run the script. I don't like having to open Windows Explorer each time I want to run a script.
Perhaps an add-in that would start a process with the selected file in the solution explorer? Or something similar?
Here is a full steps on how to add the external tool to run the batch files by right click on the file and select "Run the batch file", also whenever you need to edit the file, just open and edit it.
Here's how to do it...
Create an external tool called "Run batch file"
1) From Tools-> External Tools, create a new and put the below parameters:
2) Set the Command to: CMD.EXE
3) Set the Arguments to: /c "$(ItemPath)"
4) Set the Initial directory to: $(ItemDir)
5) ![DO NOT Check the "use output window" check box and then Apply to create the command
Note where the new command appeared in the list of commands.
The external commands are numbered from 1 starting below the divider bar.
#1 is usually "Create GUID"
To make it easy to remember you can move the new command to the top, to be the number one command in the list.][1]
6) Now go to Tools -> Customize and select the commands tab.
7) Select the Context menu radio button and select "Project and Solution Context menus | Item" from the drop down.
8) Now use "Add Command..." to add a new command
9) In the Categories list select "Tools"
10) From the commands select the "External Command #" that corresponds to the position of the "Run Batch file" custom command you noted the number of in step 5 above.
11) Move it to the right position in the list add keyboard short cuts etc.
12) Close the dialogue.
Now right click on the batch file and you should see a "Run batch file" menu item. This will execute th batch file and show it's output in the VS Output window.
Hope it helps.
I did this by right clicking the batch file and choosing "Open With", then I added a new editor and used explorer.exe (and then set that to be the default editor).
The best way to proceed is to write an external tool, and then you can pass in parameters based on your current solution that is loaded.
There are many project and solution specific variables you can pass to your external tool.
Open up the 'External Tools' dialog, and select your tool in the list box.
You will see the title of your external tool, as well as the command that points to the script or batch script you want to call.
The arguments edit box has a button next to it with an arrow next to it. Click the arrow and you will see a big list of variables, or parameters, you can pass to your external tool.
So, for instance you can use the following:
$(ProjectDir) - The full path directory of the project you are working on.
for instance "C:\builds\myproject"
$(ProjectPath) - The full path name of the vcproj you are working on.
for instance "C:\builds\myproject\foo.vcproj"
$(ProjectName) - The name of the project.
for instance "foo"
$(SolutionDir) - The full path directory of the solution that is currently loaded.
for instance "C:\builds\mysolution"
etc...
Will the Build Event hooks (pre-build, pre-link, post-build) be of any use to you? Also you can check out the Custom build setup too. Those are part of the solution.
You can add a new Makefile project to your solution. A Makefile project is a simple Visual Studio project whose build action is any command line you want. It is listed under the Visual C++ - General category in the new project dialog. In your case, just set the build command to invoke your batch script. Then, to execute your script while working in your solution, just right click on the Makefile project in the Solution Explorer and choose the Build context menu item.
Since you intend to run this script run on-demand (as opposed to running each time you build) you will want to remove it from the build in the Configuration Manager. Don't forget to disable building the project for all platforms and configurations.
Most of the macros are available to the Makefile project's build command line, although perhaps some that are associated with your main project will not have the correct value.
On my environment (Visual Studio 2022 v17.3.6 on Windows 11 v21H2) the $(ItemPath) parameter for cmd.exe leads to an error, but it works properly without:
This seems reasonable to me as the command is called "Open With" and works like the Windows "Open With" command by autmatically passing the file as an argument.

Resources