Adding custom properties in CodedUI Test builder - coded-ui-tests

I want to add custom properties of my control to CodedUI test builder. How can i achieve it?
I have used Automation provider to implement support for codedUI test in the control().Only the properties returned by the AutomationElementIdentifiers are visible in the assert window now, what should i do to include the other custom properties in it?
Please guide me to resolve this.
Thanks

The following is an example of adding custom properties to a link, but it applies to any other control.
HtmlHyperlink myLink;
myLink.SearchProperties.Add("InnerText", "Custom Inner Text", PropertyExpressionOperator.EqualTo);
I have never actually used the following and not sure if it even applies to coded-ui, but I know it exist.
myLink.SetProperty("PropertyName", "Something");

Thank you for your suggestion, unfortunately it doesn't works.
Finally i realize what is happening in my case, While using Automation Provider in a custom Control(like Grid) we can select the cells and can return only the properties supported by the AutomationElementIdentifiers, it is not possible to return the custom properties of the control to the test builder.
In case of control type i can return only the controltypes comes under the AutomationIdentifier.
So for my grid cell i used ControlType.Edit, but its not much helpful, the values in the Grid cells are not returned. So i decided implement the CodedUI support for my control as described in MSDN .
Thanks
Kalai

Related

Vaadin 14 (Flow) - Binding - where can I get access to .setAsRequired(boolean)

As title. I am working on a Vaadin 14 application (final stages of upgrading from Vaadin 7).
One of the aspects I am currently looking at is updating some existing fields on a screen to control whether or not to enforce mandatory (asRequired) checks.
ie: if field A is populated, field B is mandatory, otherwise not mandatory. That kind of thing.
Looking at the API, it appears I should be able to do this.
https://vaadin.com/api/platform/14.5.1/com/vaadin/flow/data/binder/Binder.Binding.html
void setAsRequiredEnabled(boolean asRequiredEnabled)
Enable or disable asRequired validator. The validator is enabled by default.
The problem is, I cannot seem to find where I can get access to this function.
We are currently using Vaadin version 14.5.1.
The Binder and the Binding Builder both do not show this function.
I would appreciate any guidance. I just cannot seem to locate how to access this function, to control dynamic adjustments to the required validator.
As always, right after I posted the query, it took me slightly longer in experimenting with the Flow API to find the solution.
For anyone else trying to find this -
I found you get the Binding object from the Binder you are using as follows, which then can tweak this setting:
Binding binding = (Binding) binder.getBinding("property").get();
binding.setAsRequiredEnabled(true);

Magnolia Multivalue Field- start with one option

I have created a multivalue field in a dialog and it looks like this when I initially open the dialog:
Is there any way to have it display the field(s) necessary to create the first option when the dialog first opens? This is how we want it to look:
I have looked through the documentation and I could not find a way to accomplish this, but I thought I would ask before telling the designers 'no.'
Thanks for your help!
You need to customize multivalue field to achieve it.
Create your own field factory by extending info.magnolia.ui.form.field.factory.MultiValueFieldFactory<D> in extended factory override createFieldComponent() and once field is initialized (e.g. by calling super.createFieldComponent()) you can add the first option you wanted programatically.
You might have to also tweak transformer or saving of the field to not save empty option if it doesn't do that already ootb.

How to enable customization textbox in CA304000 screen?

I adding some customization field in CA304000 ( Finance ->Cash Managerment -> Transaction) but these text field automaticaly disable.
Can you guy help me please ?!
Looking at the CATranEntry graph in CAAdj_RowSelected you will see the entire row is marked as enabled = false (PXUIFieldAttribute.SetEnabled(sender, adj, false);)
You need to extend this graph and CAAdj_RowSelected to enable your fields with similar logic found in the graph already. For example there is already a check for determining if the transaction is released:
PXUIFieldAttribute.SetEnabled<CAAdj.curyControlAmt>(sender, adj, adjNotReleased);
You will use this same syntax for your custom fields with something like this
PXUIFieldAttribute.SetEnabled<CAAdj.usrTNVName>(sender, adj, adjNotReleased);
Use the same logic found in the base graph for how adjNotReleased gets set and use it in your extension.

Edit selected custom object properties at run time

I have a requirement in which i should read all the property of the class and display them in UI and the user should be able to edit them and again save the edited property values to the same object. The custom object may have one or more custom type with in it. So i need to allow the user to edit those object properties referred in the parent object too. Suggest an approach to do the above requirement.
Thanks in advance.
You can use the same control that Visual Studio uses for it's UI editor: the ProperyGrid.
It does exactly what you want, see Getting the Most Out of the .NET Framework PropertyGrid Control

ADF: Show/hide options in af:navigationPane

I'm using JDeveloper 11.1.1.7.0
I have followed this tutorial http://docs.oracle.com/cd/E18941_01/tutorials/jdtut_11r2_43/jdtut_11r2_43.html to create a basic and plain left-side menu in my application.
This tutorial shows more advance topics, but I have created a simple left-side menu, with a list.
I haved created an unbounded task flow, drag/drop a wildcard, then the views, then the control flows, ... It works perfect
In the JSF template, in the left-side, I have this code:
<af:navigationPane id="pt_np1" hint="list" value="#{supervision_menu}" var="supervisionInfo">
<f:facet name="nodeStamp">
<af:commandNavigationItem text="#{supervisionInfo.label}" id="pt_cni1"
destination="#{supervisionInfo.destination}"
action="#{supervisionInfo.doAction}"/>
</f:facet>
I need an advanced feature, and I want to show/hide some options, based on a parameter.
I need to execute a view object with this parameter, process the results, so I get the information to know which options could be shown or hidden.
So, my questions are:
How could I force to execute this check as the first step of this flow?
In generated menu.xml and in af:commandNavigationItem, there are visible attribute. Where should I place the condition?
Any help would be very appreciated. Thanks
Not exactly sure what you mean by this:
I need to execute a view object with this parameter.
Assuming you mean "execute a QUERY against the VO", then if you used a ViewCriteria to create the where clause fragment that gets ANDed to the VO where clause, then you can use ExecWithParams (here,here, here) and drag this method onto the task flow as part of the navigation to the View. Then this will execute prior to entry to the view. Or use you can use Invoke on there Executables of the Binding layer - drag to top of list of executables, but this is no longer the recommended way, being replaced with the previous method.
if you are not using ViewCriteria (why not?) then one suggestion is to expose a method on the AM containing the VO, and pass the parms to this method and have it call the VO, but this is basically what ExecWithParms does. This method, once exposed, could be utilized in the same fashion as I mentioned above. If you can describe more precisely what you are trying to do I can try to be of more help.
As I told to Joe, the final solution requires to change the approach.
I have made an unbounded task flow, then created a menu, then adding ADF Security and finally shown/hidden options, in function of user roles/permissions.
I hope it helps. Thank you

Resources