I have a select that shows the value "select me" if the user has not yet selected an option. "select me" is not actually an option in the select, its just the default value shown.
So how can I check that value?
Something like this doesn't work because "select me" is not an option:
cy.get('#filter-dropdown').find('option:selected').should('contain.text', 'select me');
I was able to do this by finding the label for the select since the label is what contains the text, whether its defaulted or selected.
cy.get('label[for="filter-dropdown"]').should('contain.text', 'select me');
Related
I am using Apex 20.1.0.00.13, trying to create link on a column of a Classic Report.
I have followed the step to create the link for a column and redirect it to a page in the same application as the steps below :
To create a link to another page, in the Link Builder - Target dialog:
Type - Select Page in this Application.
Page - Specify the target page number.
Set Items - Select a Name and Value to specify session state for an item.
Clear Session State, Clear Cache - Specify the page numbers on which to clear cache. To specify multiple page, enter a comma-delimited list of page numbers.
Rest Pagination - Select Yes to reset pagination for this page.v
Advanced, Request - Specify the request to be used.
Click OK.
But when I am setting the item and values to specify session state for an item, the Set Items : Name doesn't populate the columns, it appears blank, Could someone let me know where I am going wrong.
I am trying to achieve a link from page 1 say a row with dept no - 2, to be directed to page 2 with details of dept 2 . Is there any other way to do it. Since its a column and not an item I am unable to pass it as a parameter to the next page.
Thanks in advance !
Right; there are no "items" here, you have to create hyperlinks within the report.
Suppose that this is classic report's query:
with test (id, name) as
(select 1, 'Google' from dual union all
select 2, 'Yahoo' from dual union all
select 3, 'Bing' from dual
)
select
id,
'<a href="' || case
when name = 'Google' then 'https://www.google.com'
when name = 'Yahoo' then 'https://www.yahoo.com'
when name = 'Bing' then 'https://www.bing.com'
end
|| '" target="_blank">' || name || '</a>' as link
from test
order by name;
Go to LINK column's properties and set "Escape special characters" to "No". Run the report; everything should work OK.
If - as you say - use it to navigate to another page in your application and set some items to some values (from the IR), then you'd do something like this:
SELECT
'f?p=&APP_ID.:217' ||
':&APP_SESSION.::NO::P217_ID' ||
':' || r.id
as link, ...
FROM my_table r ...
In other words: it navigates to page 217 and passes r.id column value into P217_ID item which is located on page 217.
link column from such a query can be referenced when creating a link column. It would be a
link to custom target
target type = URL
URL = #link# (literally, type #link#)
Probably you could change and merge these two pages into one Master-Detail page. This way you could use the built in lookup function.
I am currently using apex 19.1. I have this problem where I can't (or don't know how to) select certain columns from checkbox meaning I have this checkbox
which gives me the ability to check the columns names I want to use that output (:P3_COLUMN) from the check box to select a specific columns in a table. My solution was :
select :P3_COLUMN
from INPUT_TABLE$
I also tried :
select case :P3_COLUMN when 'currency' then currency when 'nationality' then nationality end as test from input_table
which gave me this output
and
DECLARE
str varchar2(100);
BEGIN
str := 'select ' || replace(:P3_COLUMN, ':', ',') || ' from input_table';
execute immediate str;
END;
which gave me this error
I don't know what to do, any help will be really appreciated.
Here's a walkthrough (my page is #51). Suppose that we want to display some column from Scott's DEPT table.
create a region whose type is classic report
create a page item (let's call it P51_COLS which is a select list item; its source is a query which looks like this:
select column_name d,
column_name r
from user_Tab_columns
where table_name = 'DEPT'
Page action on selection should be "Submit page"
region's source should be a PL/SQL function body that returns a SQL query and look like this:
return 'select case when :P51_COLS = ''DEPTNO'' then to_char(deptno )
when :P51_COLS = ''DNAME'' then dname
when :P51_COLS = ''LOC'' then loc
end as result
from dept';
Its "Page items to submit" should be set to P51_COLS
That's it ... run the page; select any column from the select list item and the result should be displayed.
Yes, I know - the query itself looks stupid as you have to name all cases. For some reason, Apex expects literally return 'select ...' statement. Concatenation, replace function, ... won't work. Perhaps someone knows why or - even better - can demonstrate how to workaround it. Meanwhile, try what's been written above.
first option use server side condition on the columns.
second option use dynamic sql> create function returns sql statement> call the function in your region source.
I would like to select a specific row in a table on a website and select a button next to it. The problem I have is each time I select the button it remembers the last button by position xpath=(//a[#id='DeleteLnkBtn'])[4] but i would like to select the row by name and select the button unique to that row. There are multiple rows with the same buttons all having the same name (Delete).
HTML:
<td>Auto Missed Session 2</td> <a id="DeleteLnkBtn" >Delete</a>
My aim is to reference the row by a text in the table "Auto Missed Session 2" and click on the delete button.
Here is what I've tried so far.
Option 1 - driver.findElement(By.xpath("//tr/td[contains(text() = 'Auto Missed ssion 2', + 'DeleteLnkBtn')]")).click();
Option 2 - driver.findElement(By.xpath("(//tr/td[contains(text(),'Auto Missed Session 2' + 'Delete')])")).click();
The above fails stating this is not a valid Xpath expresssion on Option 1 and No such element: unable to locate element on Option 2
The table data looks like this
td> Auto Missed Session 2 /td> - This is the name of the row in the table i would like to select.
a id= "DeleteLnkBtn" This is the button i would like to select.
Xpath of the button is //*[#id="DeleteLnkBtn"]
Thanks.
Try below code and let me know the result:
driver.findElement(By.xpath("//td[text() = 'Auto Missed Session 2']/following::a[text()='Delete']")).click();
APEX 4.2. I have Select List on form, based on query:
SELECT empno || ' ' || ename AS d, empno AS r
FROM emp
When select list expanded there two concatenated fields displayed.
But when some value selected and list collapsed I need only Ename displayed on form. So I need only JONES on pic 2 without number. Of course, return value must be empno anyway.
[EDIT] I mean I need both Empno and Ename displayed when Select List opened, only Ename displayed when it collapsed and always Empno returned.
Try adding another textfield to catch the name and place it over the select list.so every time you select an item, the value displayed is controlled in a separate container. You can try it by doing this:
Aside from the SELECT LIST ITEM you have created. Add another TEXTFIELD.
Then on the Main Page under Javascript > Execute when Page Loads
Paste this code:
$('#P5_SELECT_CONTAINER div:nth-child(2)' ).append($('#P5_TEXT'));
var s_width = Number($('#P5_SELECT').css("width").replace("px",""));
$('#P5_TEXT').css({"width":(s_width-22)+"px","position":"relative","right":s_width+"px","pointer-events":"none"});
But first youll be needing the name/id of your select list and the textfield you created. For this code,
select list id = P5_SELECT
textfield id = P5_TEXT
Just replace them(selectlist and textfield id) with what you already have.
Then create a dynamic action
EVENT = Change
SELECTION TYPE = ITEM
ITEM = P5_SELECT (or in your case Name of your SELECT LIST)
ACTION = EXECUTE JAVASCRIPT
then paste this code
var sel = $('#P5_SELECT option:selected').text();
var substr_sel = sel.substr(sel.indexOf('-')+1).trim();
$s('P5_TEXT', substr_sel);
console.log($v('P5_TEXT')); -- just to check if return is correct.
NOTE:just play with the width so that only the up/down arrow of the select list is displayed.
Hope this Helps
This is something easy - I know it. Been working for a couple of hours on it, googled it, no luck. Apologize in advance.
For some reason I can NOT alter the column heading using the column statement in Oracle.
Here is what I am running:
column clear;
column PeopleSoftTerms.LName HEADING 'PeopleSoft|Last Name';
SELECT PeopleSoftTerms.LName,
PeopleSoftTerms.FName as "PeopleSoft First Name",
TO_CHAR(PeopleSoftTerms.termdate, 'YYYY/MM/DD') as "Termination Date",
PeopleSoftTerms.ticket as "Maximo Ticket",
PeopleSoftTerms.LANID as "ID Listed in PeopleSoft",
Domain.logonid as "Active Directory ID", Domain.DisplayName, Domain.status
FROM PeopleSoftTerms
INNER JOIN Domain ON PeopleSoftTerms.LName = Domain.LName AND
PeopleSoftTerms.FName = Domain.FName;
I am at a loss here.
COLUMN commands take the column name only, not the fully qualified column name.
core> column event heading "This will work"
core> column v$session.event heading "This will not"
core> select v$session.event from v$session where rownum=1;
This will work
----------------------------------------------------------------
VKTM Logical Idle Wait
(This is in SQLPlus. I do not believe COLUMN is supported at all by SQL Developer.)
What are you trying to do with the "column clear" statement? If you're trying to clear formatting for a column, then you need to add the field name:
column field_name clear
If you're just trying to clear the column definitions, then you should reverse and try:
clear columns
Also, if the "column" statements are a part of the SELECT statement, then you shouldn't need to terminate them with a semi-colon.
column PeopleSoftTerms.LName HEADING 'PeopleSoft|Last Name'
SELECT PeopleSoftTerms.LName,
...
FROM PeopleSoftTerms
INNER JOIN Domain ON PeopleSoftTerms.LName = Domain.LName AND
PeopleSoftTerms.FName = Domain.FName;
Give some of that a try, and see if it helps.
Try to add the "" on the blank character of last name:
column PeopleSoftTerms.LName HEADING 'PeopleSoft|Last" "Name'