Get selectedOptions on sl-select with Shoelace.style - shoelace

I have an <sl-select> element from Shoelace.style.
I have selected it in my script but unlike the native <select>, it doesn't appear to have a selectedOptions property.
Is there an alternative? or how can I get selectedOptions from it?
What options do I have here?

You can achieve the same thing by checking the value attribute on the sl-select component.
Here is a demo of it working.

Related

Exchanging data between property page of CPropertySheet

I have a property sheet having two pages. The first page contains an edit box (EDITBOX1)and a check box (CHECKBOX1) . The second page contains also contains an edit box(EDITBOX2) with a check box(CHECKBOX2).
I am trying to implement a way that when there is no value in EDITBOX1 and EDITBOX2 have some value CHECKBOX2 should be checked and it should be dithered .
Then when we entered somevalue to EDITBOX1 the previously checked CHECKBOX2 should not be checked and dithered.
Can anyone suggest me some implementation? Any suggestion is appreciated.
Thanks a lot!
Derive your own class from CPropertySheet. Override CPropertySheet::OnActivatePage. Set the appropriate page how you want when it is activated.
Include your pages in your MyPropertySheet.h file. Declare your pages (CPropertyPage m_Page1, CPropertyPage m_Page2, ..) - as many as you need - in the MyPropertySheet.h file.
Add the pages to your CPropertySheet in the class constructor in MyPropertySheet.cpp file with method
CPropertySheet::AddPage(&m_Page);
Get parent of your CPropertySheet in MyPropertyPage2.cpp such as:
CMyPropertySheet* pSheet = (CMyPropertySheet*)GetParent();
Reach your m_Page1 controls pSheet->m_Page1.GetDlgItem(CHECKBOX2) from m_Page2.

How to set attribute of a webElement in Protractor?

I'm using Protractor 2 and want to change the class attribute of a webElement.
Pretend I have this menuWrapper element which I need to append show to its class attribute.
What is the easiest way to achieve this? Except for browser.executeScript().
Selenium WebDriver specification (which WebDriverJS and hence Protractor follow/use) does not have anything documented for setting an element's attribute, only for getting an element's attribute. In other words, you won't find anything built-in for this task.
Certainly, the easiest way to set an element's attribute would be to use executeScript().

How to avoid spacing in class name

Currently, I am automating a web page using Watir-webdriver with page-objects. Here I want to check a class name if checkbox checked. I need to check infra01 and checked is present if unchecked infra01 and unchecked exists or not.
<span class="infra01 infrastructure checked"></span>
<span class="infra01 digitinline unchecked"></span>
Please help how to proceed using regular expression. Also please help me how to proceed the class name with spacing.
Not sure about the page object part, but you don't necessarily need to use a regular expression. You can use the attribute_value method to get the value of class attribute in the span tag and check to see if "unchecked" is included in the returned string:
browser.span.attribute_value("class").include? "unchecked"
try to proceed with regexp:
browser.span(:class => /#{Regexp.escape("infra01 infrastructure checked")}/).when_present.click
If it possible to use "if" 1st element unchecked "else" click 2nd element

How to add tabindex to xe:djComboBox

I need to add a tabIndex to a page that contains several Dojo Combo Boxes from the XPages Extension Library. It seems that the tabIndex property is not supported.
The XSP editor says it is an "unknown property" and "not defined on tag ".
Does anyone know how to add this property?
Note: In this application, jQuery is not available to use.
This code works for me
<xe:djComboBox id="djComboBox1" tabIndex="3"></xe:djComboBox>
<xe:djComboBox id="djComboBox2" tabIndex="2"></xe:djComboBox>
<xe:djComboBox id="djComboBox3" tabIndex="1"></xe:djComboBox>
I never used them and have to DDE available yet but can you define the tabindex attribute via the attrs property list of the control?

Cannot get itemDescription on f:selectItems to have an effect

The doc says:
"itemDescription: evaluates to a String that will serve as the description to be shown for the item."
http://docs.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/facelets/f/selectItems.html
http://docs.oracle.com/javaee/6/javaserverfaces/2.1/docs/vdldocs/facelets/f/selectItem.html
I'm not getting any title attribute added to the resulting option element in the DOM or anything, not even when setting a literal String as its value (neither on f:selectItem nor f:selectItems, each tried seperately, the latter with a c:forEach over the list items which showed up correctly with their labels).
Some forum posts seemed to suggest people use it for tooltips.
The doc isn't being entirely clear, is the itemDescription attribute on the component even meant to be rendered as a tooltip/title? And if not, what's it good for?
I think BalusC already answered it in https://stackoverflow.com/a/25512124/3280015, which I initially overlooked.
"While creating the custom renderer, you could make use of the unused(!) description property of the UISelectItem class."
So it is currently simply unused and left for potential use by developers. Maybe that's what the Doc means by:
"for use in development tools."

Resources