Follow

Advanced Strengthening Configurations

In addition to XPaths, Expert Mode within the Capriza Designer offers several other advanced options for strengthening controls. This article will detail each of these options and their applicable use cases.

 

CSS Selectors

 

Included within the Expert Identification section, CSS Selectors enable you to strengthen controls by specifying specific CSS classes that are unique to that web element and consistent throughout the source application.

 



Let's take the blue search button in the below application as an example.

 

Screen_Shot_2017-05-31_at_3.33.13_PM.png

 

Throughout the source application, the button belongs to a particular CSS class, called ".btn," that describes the button color, border radius, etc. To help Capriza better identify the button, you can select the .btn class from the CSS Selectors menu.

 

 

Note: CSS Selectors are based on the styles of the source application—not the Zapp. Therefore, even if you apply different styling to the control using the Designer that render it less unique or vary throughout the Zapp, Capriza will still be able to leverage CSS Selectors to identify the control.

 

As with XPaths, changes to the CSS of the source application may impact the ability of Capriza to locate the control. Exercise caution when using CSS Selectors with applications that may change frequently.

 

JavaScript

 

Some source applications may contain controls that are very complex or vary in position and are, therefore, difficult to locate using XPaths or Facts/Anchors alone. Some examples may include tables within tables or controls contained in an iframe.  In this type of scenario, a snippet of JavaScript can be used to locate the control.  (Note: This differs from XPath mode as, in XPath mode, the Xpath is evaluated on all iframes, while in JavaScript mode, the code is only run once on the root window.)

 

To insert JavaScript, enable Expert Mode. Under Identification Mode, select JavaScript.

 

 

A text field where you can enter our code will appear. You can also open a larger JavaScript editor by clicking the arrow button on the right hand side of the box.

 

 

 

The below example demonstrates how to use JavaScript to locate a control within an iframe. 

 

window.document.querySelector("div.containerClass>iframe").contentWindow.document.querySelector("div.yourClass");

 

Event Listeners

 

Elements within the HTML DOM, particular interactive ones like buttons, modals, lookups, etc., may be listening for a variety of events. Events may include a variety of actions, such as Keyboard interaction, Mouse interaction, Value change, Focus change, Page change, etc.  

 

For example, a text input may listen for a keydown event, and when the user begins typing, the web page can catch it and do something with it, such as surfacing a popup message.

 

These event listeners can also be used to strengthen controls. To add event listeners, simply enable Expert Mode within the Identify tab and choose the desired listener from the dropdown menu.

 



Visibility

 

Visibility of a control on the corresponding web page is typically one of the first checks Capriza performs to decide whether to display a control and its corresponding mobile page. However, there may be situations where you would like to display a control within your Zapp regardless of whether or not it is visible in the source application page.

 

For example, you may have a search field that only renders in your web application once a button is clicked. If the field is always present in the DOM, skipping the visibility check can remove the need to click on the button.

 

In such cases, the Visibility setting within Expert Mode can be used. If set to "No," Capriza will look for and, if correct facts and anchors are present, render the mobile control even if it is not visible in the web application.

 

 

DOM Distance

 

For source applications that change infrequently, you can also use consistency in DOM distance (number of elements between the element and the bottom of the DOM tree) to strengthen controls. The Designer will automatically assume the answer (Yes/No) to this question. You may modify or confirm the answer to better strengthen your control.

 

 

Summary Question

 

For controls with at least one unique component to them, the Summary Question provides an easy way of highly strengthening the control. The Summary Question lists the key attribute used to identify that controls and asks you to confirm if it is the only control on the page that matches the set of attributes.

 

Note: The Summary Question is only surfaced if the Designer detects an attribute that may possibly be unique only to that control.

 

 

If set to yes, this indicates to Capriza that this attribute is unique to this control and, if present, the control can be recognized with 100% certainty. The strength meter will go up to 10.

 

 

Answering the question yes will override all other Anchors and Facts. Only answer "Yes" if you are certain.

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.