Dropdown selection in Cypress [closed] - select

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
I need to locate this dropdown element and click on it. I have done below. But it does not work. What am doing wrong?
const pageObjects = new PageObjects();
const brandOfTheCar = "Renau";
pageObjects.getSelectAbrandBtn().type(brandOfTheCar);
cy.get(".brand-filter__control")
.find("div div")
.contains("Renault")
.click()
.click({ multiple: true, force: true });
pageObjects.getApplyFiltersBtn().click();
});[![enter image description here][1]][1]

How about you use contains with div and the inner text value Renault (3).
cy.contains('div', 'Renault (3)').click()

Related

how to create communication with dynamic text box [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
How to communicate between dynamic textbox that without id .
In normal case we can have some of the event name onchange and etc . but in dynamic component. We don't have that key (id) to link it. Like onchange$id then do something "".
so in dynamic component case , how to get value from dynamic component? Please provide idea.
since your question isn't very precise (about how you create those components dynamicall - java or zul templates) here the 2 basic methods:
from java code:
after creating a new component just add an event listener programmatically, no need for any convention based method names.
//create dynamically anywhere
Textbox someInput = new Textbox();
someInput.setParent(someParent);
someInput.addEventListener(Events.ON_CHANGE, this::onChangeSomeInput);
//someInput.addEventListener(Events.ON_CHANGE, (InputEvent event) -> {...});
...
public void onChangeSomeInput(InputEvent event) {
Textbox someInput = event.getTarget();
someInput.getValue();
}
from zul code:
in this case event forwarding is the tool of choice, it lets you delegate the event to a parent component with an id
<grid id="mygrid">
<template name="model">
<row>
<textbox forward="onChange=mygrid.onChangeSomeInput(${each})"/>
</row>
</template>
</grid>
then you can implement a composer method like this
public void onChangeSomeInput$mygrid(ForwardEvent forwardEvent) {
InputEvent event = (InputEvent)forwardEvent.getOrigin();
Object each = forwardEvent.getData();
}
(I wrote this code our of my head so please excuse typos/errors, I'll be happy to provide running examples in case you specify your question)

OOTB Granite Render Condition in AEM [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I have created a button called annotation and I have added hasannotation OOTB granite render condition. On selection of an image having annotation, the button doesn't get rendered.
Image Of the custom button with granite:rendercondition
Properties of the button
Properties of granite:rendercondition node
First you need to add granite:rel property to your button.
As said in the documentation:
This is used to indicate the semantic relationship of the component
similar to HTML rel attribute.
You can add the AEM existing granite:rel in your custom button as "aem-assets-admin-actions-annotate-activator" as shown /libs/dam/gui/content/assets/jcr:content/actions/selection/annotate
Or you can also add your custom value lets say "my-annotation-rel". In this case you need to tell AEM to consider your custom value. In order to do this, you need to overlay /libs/dam/gui/coral/components/admin/contentrenderer/base/assetBase.jsp
and add this line :
actionRels.add("my-annotation-rel");
Update: render condition is not working because the path is not correctly passed to redercondition component. {requestPathInfo.suffix} does not give the actual path of the asset rather it gives the folder path and hence it fails to check when you are in card/column/list view.
In order to implement this, follow these steps:
Overlay /libs/dam/gui/coral/components/admin/contentrenderer/base/base.jsp
Add this below code inside getActionRels(Node node, boolean hasReplicate,boolean hasRemoveNode, boolean hasModifyAccessControl, boolean isExpiredAsset, boolean isExpiredSubAsset, boolean isDAMAdmin, boolean isContentFragment) method
boolean hasAnnotation = false;
NodeIterator nodeItr= node.getNodes();
Node commentsNode;
while(nodeItr.hasNext()) {
Node childNode = nodeItr.nextNode();
NodeIterator childItr = childNode.getNodes();
while(childItr.hasNext()) {
Node secondLevelChild = childItr.nextNode();
if(secondLevelChild.getName().equals("comments")) {
NodeIterator thirdLevelNode = secondLevelChild.getNodes();
while(thirdLevelNode.hasNext()){
if(thirdLevelNode.nextNode().hasProperty("annotationData")){
hasAnnotation = true;
}
}
}
}
}
if(hasAnnotation){
actionRels.add("my-annotation-rel");
}
Add granite:rel (String) "my-annotation-rel" property to your custom button
It should work.
Another way without changing the OOTB jsp file behaviour, if you are customising metadataeditor then granite render condition should work . In this case you have to first overlay this and your custom button:
/libs/dam/gui/content/assets/metadataeditor/jcr:content/actions
and add granite:rendercondition node under your custom button and give path property as
${empty requestPathInfo.suffix ? param.item : requestPathInfo.suffix}

How to get coordinates of selected word on QWebView

mighty All,
I have selected the word by QWebPage::SelectNextWord().
I just exec the code:
ui->webView->page()->triggerAction(QWebPage::SelectNextWord);
The question is: how to define coordinates of blue rect of selected word,
any method which allows to solve this (Qt, Windows MDN, jscript,...)
Does anybody know how to do this?
Regards,
Radmir
MDN Api allows to write small script, that solves the task.
Thanks,
the question is closed.
Radmir

How to change controller name like product to products [duplicate]

This question already has answers here:
Reference: mod_rewrite, URL rewriting and "pretty links" explained
(5 answers)
Closed 6 years ago.
I have products controller like
http://domain.com/products
where products are listed and for single product details URL is like this
http://domain.com/products/view/parameter
I want to change my controller name from products to product for single product details like
http://domain.com/product/parameter
NOTE: Please don't give me direct reference of ellislab manaual because I tried those things.
Thanks in advance
$route["product/slug"] = "products/view/slug";
used this in page route.php

Set GWT 'HTML' Object's id [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
Setting a GWT widget’s id
I would like to add an 'id' to my GWT 'HTML' object to ensure that a particular style gets applied to it.
HTML obj;
How can I assign an id for this obj?
I couldn't figure it out based on this Javadoc
Thanks.
You could use object.getElement().setId()
You don't need to set an id. Simply add a CSS class name:
obj.setStyleName("myStyle");
or
obj.getElement().getStyle()...
and set any style you need directly.