'Set Text' action on a web-element intermittently generates TYPE_021 error - automationanywhere

I intermittently run into a TYPE_021 error when I perform a 'Set Text' action on a web-element that would be used as a drop-down in a manual flow, but simply inputting a value is legal.
I chose a 'Set Text' versus a Click command followed by a Keystrokes command because 'Set Text' seems more stable. Also, I did not attempt the obvious flow of selecting from the dropdown because the necessary value is not available in the dropdown.
What would cause a TYPE_021 error?

I agree with the availability of user guides for Automation Anywhere.. which is frustrating. I'm also not familiar with those type of errors but I would suggest the following methods:
Enclose Set Text command with Error Handling so that the whole task would not fail if the drop-down value is not available, then have If/Else commands after to check if it is valid or not.
Error Handling (Action: Continue; Task Status: Pass; Variable Operation = "True")
Move the drop-down selection part at the latter part of the task. Maybe the page was not fully loaded yet which causes failure.
Use Click command to select the value. Click the drop-down button then click the value. Modify the properties to insert the value required, maybe on HTML Value or HTML InnerText. You may enclose it with Error Handling if needed.

Related

BigDecimalField validation bug

BigDecimalField has a nice feature: it allows only digits, "+" and "-" signs, and a decimal separator defined by the current locale ("." or ","). It works fine until someone tries to enter a combination that is not a number or cannot be directly converted to the java BigDecimal type (e.g "123...45.6+++7-89--").
For sach combinations, the validation passes without any warning, and the background business object gets a null value.
Field is in the dialog and every time before opening the dialog there is a call to Binder.readBean() method (in order to set the appropriate data for editing), on "save" button in dialog I call Binder.writeBean(). Problem is that the next time I open the dialog, the problematic BigDecimalField still contains an invalid number entered,
actually Binder.readBean() stops working for that field.
There is a similar bug with IntegerField which I noticed: IntegerField validation bug.
How can I validate BigDecimalField and avoid this bug? How do i get the BigDecimalField to work again and not keep showing invalid data? Is there a elegant way to catch the NumberFormatException that probably occurs somewhere inside the vaadin api, and proces it i.e. warn the user that he has to enter a valid decimal number. Is there a way to do it via Binder?
I am using Vaadin 23.3.0
Checking format error is not yet by default on. You need to enable it by setting enforceFieldValidation=true in feature flags in src/main/resources/vaadin-featureflags.properties file.
com.vaadin.experimental.enforceFieldValidation=true
See more at: https://github.com/vaadin/platform/issues/3066

selecting option for mat-select dropdown and retrieving selected option using cypress

I have a mat-select dropdown with more than 20 values. I have to select a value from the available list. The first 5 values are visible when the dropdown is clicked. After that, the values in the dropdown are not visible and unable to click.
cy.get('app-screen').find('#paper-code').click());
cy.contains('mat-option', 'AL019').should('be.visible').click();
Since the above code failed, updated the code as below.
cy.contains('mat-option', 'AL019').click();
This worked. But, will it get failed anytime later?
Another question, is how to get the selected option for mat-select?
It could fail later but it won't if you set the force option to true and avoid having to wait for an actionable state.
cy.contains('mat-option', 'AL019').click({ force:true });
If it does fail in the future, you want to know about it because there's a regression in the app.
Don't {force:true} unless you really really need to, because it will stop your test catching such regressions.
To test the value is selected may be as simple as
cy.get('app-screen').find('#paper-code').should('contain', 'AL019)

Skip "Capture Page Screenshot" for some keywords

I'm writing test cases in Robot Framework using AppiumLibrary.
I'm importing AppiumLibrary with the following code to get a screenshot whenever something goes wrong:
AppiumLibrary.__init__(self, run_on_failure="Capture Page Screenshot")
Is there a way to NOT take a screenshot for a specific keyword? This keyword will for example create 15 screenshots (if it's not able to find Donald):
Wait Until Keyword Succeeds 30 seconds 2 seconds Element Text Should Be Username Donald
There is nothing built-in to do what you want. There are many solutions, however.
One solution would be to turn off capturing the keyword (using register keyword to run on failure) immediately before calling wait until keyword succeeds. You could then call wait until keyword succeeds, and then turn capturing back on afterwards.
Or, you can register your own custom keyword instead of Capture page screenshot. Your own keyword can use whatever logic it wants to determine whether to capture screenshots or not. For example, it could look for a global variable that tells it whether to capture or not.
You could also write your own keyword to use in place of wait until keyword succeeds which also uses one of the other two solutions.
For example, create a keyword named wait until element contains text which turns off the capturing, runs wait until keyword succeeds, and then turns it back on. Then, in your test you still just have a single statement:
wait until element contains text Username Donald
Register Keyword To Run On Failure NONE
${Status} Run Keyword And Return Status Wait Until Keyword Succeeds 30 seconds 2 seconds Element Text Should Be Username Donald
Register Keyword To Run On Failure Capture Page Screenshot
IF ${Status}==False
Element Text Should Be Username Donald
END
-Lets Walkthrough whats happening in the above code snippet
Register Keyword To Run On Failure NONE (To avoid multiple
screenshots when Element Text Should Be keyword fails in the
next line )
After waiting for 30 seconds it will return status If the keyword passes it returns pass and if it fails it returns fails and gets stored in status variable (Remember no screenshots are generated in this process since we turned off screenshots in point 1.)
Again setting back Capture Page Screenshot Keyword on Failure to take screenshot.
Lastly one more time it will run Element Text Should Be and if it fails it generates a screenshot and keyword fails.(Since ${Status}==False that means it will run only if Wait Until Keyword Succeeds keyword fails otherwise this IF block will not run since our keyword already passed)

Google Sheets - Run script based on value

I'm very new to scripting and really need some help getting started.
Basically I'm trying to develop a simple script to show a warning message when a certain value in a cell has been selected from a drop down list.
When the option 'Behind' has been selected I just want a simple popup window or something to say 'Review is needed'.
I've explored 'toast' but I'm not sure how I'd get the script to run based on the value.
Any help would be much appreciated, I'm going bald :(
Emma
You can also achieve this kind of behavior without writing your own script. See Data validation.
Select the cells for which you want this to apply
Click on Data -> Data Validation in the menu
Set your criteria for allowed values
On invalid data, select either Show Warning or Reject Input (the latter will reject the input and show a toast)
Put a checkbox in Show validation help text to add a custom warning text

List all the invalid controls in Orbeon forms

I have 30 fields in my form. At the bottom of the form I have a button where if I click on it, it should display all the fields which are invalid. Invalid includes not filling the mandatory fields also.
Using xforms:trigger I can create a button and using DOMActivate even I can write xforms:action. But what should I write inside the xforms:action to list all invalid fields.
You can implement your own error summary by listening to events like xforms-valid and xforms-invalid, keeping track of which controls are valid and invalid. But this is not a trivial task, especially if you want to handle repeats, and even nested repeats. Fortunately, this work has been done already for you, and the code has been put in a reusable component: <fr:error-summary>.
If you are using Form Runner, the error summary is setup for you by default. Otherwise, see this documentation on how to use the error summary component.

Resources