In the past, you had to write text().withText(<your text>) for text selection. This was tedious to write and additionally hard to read, too.
Now, we've implemented optional parameters, allowing you to simply use text(<your text here>) with your preferred parameter. This makes it easier to select text and improves readability.
And before introducing optional parameters for relational selectors like above(), below(), leftOf(), and rightOf(), you could only select the first element. Making it impossible to automate things where you wanted to target the nth-element.
You can now add an index, which starts at zero, to select other elements more conveniently like this
In this blog post we show you how you can use the optional parameters to improve your automations 🥳
Optional Parameters for `text()`
Targeting a text-element before optional parameters was done like this:
This is unpleasant to write and also to read. Now you can shorten it by leaving out the withText() and supply your text directly to text() like this:
Optional Parameters for Relational Selectors
Let us start with an example first. How would you select the text WOOHOO when you can only target the text FIRST reliably?
Exactly. You would have to rely on SECOND which may clutter your code and blur your intentions like this!
But you can now use an index for relational selectors like above(): For the first element, input nothing or zero; for the second, input one; for the third, input two, and so on.
This enables you to select the second element right of FIRST with ease.
With the new optional parameter for `text()` we simplified the targeting of text elements.
With the optional index-Parameter for relational selectors like above() it is now possible to select the nth-element and target elements in your AskUI automations that were hard to target before.
Also check out the docs:
Working in What-You-See-Is-What-You-Get editors (WYSIWYG) can be very tiring and also taxing on your wrists. Things like highlighting the same thing over and over again can often not be done with search-and-replace, because there is just no button for it 😤 In this tutorial I will show you how I automated this task with AskUI and also how to work around some kinks of WYSIWIG-Editors like microanimations and strange behaviour.
Embrace Immersive and Interactive User Experiences: A Guide to Automating WebGL Websites with AskUI As web developers increasingly seek to captivate users with immersive experiences, WebGL-based websites have gained popularity. By harnessing the power of canvas to draw graphics and animations directly, they offer unparalleled creative control and dynamism in crafting user interfaces. The result? A more flexible and engaging platform for stunning graphical compositions, delivering real-time interactions that captivate visitors.
Visual Regression Testing (VRT) is a useful method to guard yourself against unwanted layout and visual changes that can occur with new version of a Graphical User Interface (GUI).AskUI is not a testing tool in the original sense but an automation tool for all GUIs that is platform-independent. Wouldn't it be nice to combine VRT with AskUI, so you do not have to maintain two different projects.Luckily you can do this because Jest - AskUIs favourite runner - can be extended to provide VRT, while AskUI delivers the screenshots to test on.