Accelerate Test Creation
To speed up the CI process, we developed a group of features that support every phаse of the process, from test creation to execution. Let’s take a look how BELLATRIX can speed up your test creation by providing element snippets, handy elements locators, smart wait for the elements, more than 150 additional elements actions, ready-to-go templates and much more.
Speed Test Writing with Element Snippets
By giving you a corresponding snippet for more than 18 desktop elements out of the box, BELLATRIX will dramatically speed up your test writing.
Code snippets are small blocks of reusable code that can be inserted in a code file using a context menu command or a combination of hotkeys. In Visual Studio there are expansion snippets, which are added at a specified insertion point and may replace a snippet shortcut.
For example, to generate a CheckBox property, you need to type somewhere in you class dcheckbox and press Tab.
public CheckBox PermanentTransfer => Element.CreateByName<CheckBox>("BellaCheckBox");
On the first press of tab, the above code is generated. The first placeholder that is selected is the name of the property. Once you change it, you can press Tab. Then, the second placeholder is chosen- the By locator’s type, by default, it is set to Id, press Tab again and change the actual locator.
API Usability- Locate Elements
Additional methods and ability to add custom locators.
For example, in WebDriver to find an element, we use the FindElement method while specifying the locator through By class.
IWebElement agreeCheckBox = driver.FindElement(By.Id("agreeChB")); agreeCheckBox.Click();
However, this syntax requires additional effort. It is not fluent since you had to begin a new “chain” using the By static class. Also, it is not extendable if you want to add custom locators.
CheckBox agreeCheckBox = App.ElementCreateService.CreateById<CheckBox>("agreeChB"); agreeCheckBox.Check();
BELLATRIX provides you with a CreateBy method for each locator. Everything follows the natural writing flow, leveraging to the maximal degree on IntelliSense. If you add your custom locator, your method will appear as well. One of the coolest things that the BELLATRIX element includes, is the By property (knowing how it was located).
API Usability- Wait for Elements
Smart wait for elements that will solve 80% of all use cases.
All elements are internally waited to exist before usage. This solves 80% of all use cases. After that as part of the CreateBy API, we added additional ToBe methods which you can chain. Which means you can specify an unlimited number of conditions for each element that needs to be fulfilled before the element is returned.
var purchaseButton = App.ElementCreateService.CreateByName<Button>("Purchase").ToBeVisible().ToBeClickable().ToExists(); purchaseButton.Click();
BELLATRIX comes with 7 default ToBe methods.
Moreover, it is relatively easy to add your custom ToBe methods if needed.
150+ Additional Elements Actions
BELLATRIX saves you a lot of effort and code with extended elements and services APIs.
BELLATRIX exposes 18+ desktop controls. Each of them includes only the actions that you should be able to do with the specific control and nothing more.
var purchaseButton = App.ElementCreateService.CreateByName<Button>("Purchase"); purchaseButton.Click(); var calendar = App.ElementCreateService.CreateByAutomationId<Calendar>("calendar"); Assert.AreEqual(false, calendar.IsDisabled); var checkBox = App.ElementCreateService.CreateByName<CheckBox>("BellaCheckBox"); checkBox.Check(); Assert.IsTrue(checkBox.IsChecked); var password = App.ElementCreateService.CreateByAutomationId<Password>("passwordBox"); password.SetPassword("topsecret");
Or we bring new useful methods to default controls such as Focus and Hover.
var datePicker = App.ElementCreateService.CreateByAutomationId<Date>("DatePicker"); datePicker.Hover(); datePicker.Focus();
The most important attributes of each desktop control are included, as well as their assertion alternatives.
var label = App.ElementCreateService.CreateByName<Label>("Result Label"); Assert.IsTrue(label.IsPresent); Assert.AreEqual("Rocket", comboBox.InnerText);
Ready-To-Go Project Templates
BELLATRIX comes with preconfigured (ready-to-go) project templates.
You can directly start to write automated tests without bothering with tedious project configurations, installing packages, etc.