select Multi-Value Select Boxes using cypress - multi-select

I could not select Multi-Value Select Boxes (http://select2.github.io/select2/)
I try:
cy.get('s2id_e9').click()
cy.get('ul li:first').contains('California').select()
but it does not work.
How can I select these options? Hope someone can help?

cy.get('#s2id_e9 ul.select2-choices').click()
cy.contains('.select2-result-label', 'California').click()

This worked for multi select dropdowns
cy.get('[name="Optionwithcheck[]"]').select(['Option 2','Option 3'])

Related

A SQL Query to select a string between two html tags

I need to get the text between html tags in SQL.
< em> " **Test,Extract Me** " < /em>
This is just a small part of html body where the unique identifier is < em>"
Please help
SELECT SUBSTRING(ColumnName,CHARINDEX('html_tag',ColumnName)+LEN('html_tag'),CHARINDEX('html_close_tag',ColumnName)-LEN('html_close_tag')) FROM TableName
please replace html_tag,html_close_tag with your tags.
I think you want to take a substring of the column value.
You can try something like this:
SELECT SUBSTRING(ColumnName, 5, LEN(ColumnName) - 5) AS TrimmedValue FROM TABLE;
SELECT SUBSTRING(ColumnName,CHARINDEX('html_tag',ColumnName)+LEN('html_tag'), CHARINDEX('html_close_tag',ColumnName) - CHARINDEX('html_tag',ColumnName) - LEN('html_close_tag') +1) FROM TableName
In case the marked answer query doesn't work.
With using JQUERY you can find easily with simple one line of code :
$('em').text();
You can do the same with simple JS as well
document.getElementsByTagName('em')[0].innerText

How to filter contents in linked list using select statement?

A class has a property which holds link of rid's.ie testcaseLink:[#20:0,#20:1].I have a problem in selecting only certain rids from the testcaseLink using select statement.
Looking for something like select testcaseLink.get(#20:0) from tableName.Is there is any method to filter the contents of collections in orientdb
select testCaseLink[#rid=#20:6 OR #rid=#20:8] from tableName where ColumnName='Value' Solved the problem

linq query analogous to sql Not In, In clause

I want the linq query analogous to sql query mentioned below
select HTId,HTN from tblHTMaster where HTId in (
select HTId from tblUHTs
where UId='F7ECFB41-177F-4408-B856-A4F669FAA714')
Thanks in advance
from s in db.tblMaster
let t= from u in db.tblUHTs
where u.UId='F7ECFB41-177F-4408-B856-A4F669FAA714'
select u.HTId
where t.Contains(s.HTId)
select new {s.HTId, s.HTN}

Need help on a T-SQL XPath query

I'm hoping somebody can help me solve a syntax problem with a TSQL xpath query.
Given the following xml:
<emails>
<email></email>
<email></email>
</emails>
I'm trying to execute the following query:
select * from messages where SendTo.value('(/emails/email)[1]', 'nvarchar(max)') like '%[email value]%'
My query looks only in the first email element and it needs to look in all email elements.
Thanks,
Chris
Try this :-
select * from messages
CROSS APPLY SendTo.nodes('/emails/email') AS Artists(a)
where a.value('(text())[1]', 'nvarchar(max)') like '%[email value]%'
Demo in SQL FIDDLE

NHibernate group by named parameters doesn't work with repeated parameters

My query in HQL is basically:
select functionA(a, :paramA), functionB(b, :paramB), functionC(c, :paramC), sum(d)
from tableA
groupby by functionA(a, :paramA), functionB(b, :paramB), functionC(c, :paramC)
However this gets turned into SQL of
select functionA(a, #param0), functionB(b, #param1), functionC(c, #param2), sum(d)
from tableA
groupby by functionA(a, #param3), functionB(b, #param4), functionC(c, #param5)
Now obviously this is going to throw a 'blah' is invalid in the select list because.... error as the group by clause doesn't match the select clause. I'm about to change this to a string format so I can get on with some productive work but if anyone has the answer as to why NHibernate will not reuse the same named query input the 2 times it is used that would be much appreciated.
A similar question seems to have been asked here with no real answer either.
This has been solved in NHibernate 3.0.0.Alpha1. You can get it here

Resources