

Each literal consists of three parts- id (the value that you use in the snippet's code), the default value (once the code is generated) and a tool tip that will be visible in Visual Studio on hover. Then you need to create a literal for each placeholder. You need to create Declarations section under the Snippet node. Create Replaceable PlaceholdersĪs I told you, we have three placeholders for this snippet- the name, the locator's method and the locator's string. You can set a description that will be displayed in the Code Snippet Manager and the Visual Studio code editor. As I told you, this is an expansion snippet so for SnippetType you set Expansion. If you take a closer look at the snippet's XML, the code should be placed under the Code element, wrapped in the.

For example, key binding Cmd+\ in US keyboard layout will be shown as Ctrl+Shift+Alt+Cmd+7 when layout is changed to German. ( Code > Preferences > Keyboard Shortcuts on macOS) Most importantly, you can see keybindings according to your keyboard layout. Then, the second placeholder will be chosen- the B y loc ator's type, by default, it is set to Id, press again Tab and c hange the actual locator. You can open this editor by going to the menu under File > Preferences > Keyboard Shortcuts. The first placeholder that will be selected is the name of the property.
