UFT click an element based on a given property value - hp-uft

I'm working with a date selector, and I'm trying for my UFT script to pick an appointment date 3 days from today's date. I have set up that value specifically to match the property value format in the HTML code:
14
My question is: How can I instruct UFT to look for a property value by matching whatever is in the "aria-label" property with the value that I have defined in my data table?
Also, I noticed that the 'Tab index' is -1, not sure if that has anything to do
Much appreciated
I have the following code, but UFT does not recognize it "strAppointmentDate" is the cell in the data table where I defined the desired date:
iDate= strAppointmentDate
Set dd = Browser("Browser").Page("Select Appointment").WebButton("aria-label:=" &iDate, "html tag:=td", "index:=-1")

Instead of "aria-label" try "attribute/aria-label".

Related

Google sheet adding a layer on top of a vlookup to make it conditional on a yes/no and a date

I would like to put in a basic toggle into a Google sheet.
Here is my reference table, It gets imported from another Google document so it's updated all the time.
I also have another google sheet that goes back to this lookup reference. It fills in the data if the date is less than today's date and matches the Date and the Source columns as a key.
I'd like to add another part in the Google sheet that says Include Today and you can type in the word "Yes"
If you type in Yes, I would like the yellow section, that uses the lookup_ref reference table, to include today's date, and otherwise include only days before today. In the example here, today is October 14, so if we type in "Yes" into this field, we need to have a value other than 0 for V15.
Okay, so you want to optionally include today's values in the formula. So you can conditionally add 1 day to today based on the value of "Include Today".
For example, if you add "Include Today" Yes/No value at cell "Z1", then you need to add IF(Z1="yes",1,0). So your formula can be
=IFERROR(IF(O15 < today() + IF(Z1="yes",1,0), vlookup(A15,lookup_ref,4,false), 0),0)

Quicksight parse date into month

Maybe I missed it but I'm attempting to create a dynamic 'Month' parameter based on a datetime field - but can't seem to get just the month! ? Am I missing something ?
here's my source DTTM date/time field -
In Manage Data > Edit [selected] Data Set > Data source
Just add 'calculated field':
truncDate('MM', date)
where MM returns the month portion of the date.
See manual of truncDate function
The only place in Quicksight that you can get just a month, e.g. "September" is on a date-based axis of a visual. To do so, click the dropdown arrow next to the field name in the fields list, select "Format: (date)" then "More Formatting Options..." then "Custom" and enter MMMM in the Custom format input box.
Quicksight menu selection as described
This will then show the full month name on the date axis in your visual. NB It will use the full month name on this visual for ALL time period "Aggregations" - e.g. if you change the visual to aggregate by Quarter, it will display the full name of the quarter's first month etc.
If you are talking about "Parameters" in the Quicksight analysis view then you can only create a "Datetime" formatted parameter and then only use the "Date picker" box format for this parameter in a control (+ filter).
If you use a calculated field in either data preparation or analysis view the only date functions do not allow full month names as an output, you can get the month number as an integer or one of the allowed date formats here:
https://docs.aws.amazon.com/quicksight/latest/user/data-source-limits.html#supported-date-formats
You'll need to hardcode the desired results using ifelse, min, and extract.
Extract will pull out the month as an integer. Quicksight has a desire to beginning summing integers, so we'll put MIN in place to prevent that.
ifelse(min(extract('MM',Date)) = 1,'January',min(extract('MM',Date)) = 2,'February',min(extract('MM',Date)) = 3,'March',min(extract('MM',Date)) = 4,'April',min(extract('MM',Date)) = 5,'May',min(extract('MM',Date)) = 6,'June',min(extract('MM',Date)) = 7,'July',min(extract('MM',Date)) = 8,'August',min(extract('MM',Date)) = 9,'September',min(extract('MM',Date)) = 10,'October',min(extract('MM',Date)) = 11,'November',min(extract('MM',Date)) = 12,'December','Error')
Also, I apologize if this misses the mark. I'm not able to see the screeshot you posted due to security controls here at the office.
You can use the extract function. Works like this:
event_timestamp Nov 9, 2021
extract('MM', event_timestamp)
11
You can add a calculated field using the extract function:
extract returns a specified portion of a date value. Requesting a time-related portion of a date that doesn't contain time information returns 0.
extract('MM', date_field)

SSRS Cache Report Parameters Previous Week

Is there a way to set the Parameter Values in the Cache Refresh Plan window to use the previous Sunday? The field is a Date/Time field and will not let me enter code such as =DateAdd(DateInterval.Day, -7,DateAdd(DateInterval.Day, 1-Weekday(today),Today)). It is looking for date format. Thanks in advance
I'm unaware of any parameter caching options. However, you should be able to get a default value to work. Perhaps the expression below will work.
=DateAdd(dd,1- DatePart(dw, CDate(Today())), CDate(Today()))
If you still can't get it to work, another option would be to add a data set that spits out the value. You could use something like:
SELECT DATEADD(dd,1- DATEPART(dw, CAST(GETDATE() AS DATE)), CAST(GETDATE() AS DATE))

Report parameters always using design time values

How do I get the report to use a design-time set value on first run, and then use whatever the user inputs for subsequent 'refreshes'?
I'm using .Net 4 and Telerik Q1 2013 Reporting controls.
I've created a report that has a StartDate and EndDate parameter, which is passed to a SQL query and returns relevant data.
To make it easier for the users to just open and run the report with minimal effort, the StartDate and EndDate have a default value, being set as the first and last day of the current month respectively.
This works great. However, if the user changes these values after the report is loaded, and tries to run the report for say the first to last day of the previous month, the query does not use the user-entered values. Instead it always uses the expression for what is supposed to be the default value.
The way I set the default value is by opening the ReportParameter Collection Editor (right-click in the report, click Report Parameters), and set the Value property of the parameters.
The StartDate is set to:
=StartOfCurrentMonth()
and EndDate is set to
=EndOfCurrentMonth()
Any help would be greatly appreciated!
Stephen,
What you've outlined here works for me, are you maybe not running the service pack? I set the Value property in the ReportParameter Collection editor to both StartDate and EndDate as:
='3/1/2013'
The preview of the Report runs immediately with the default values. I am able to change the values and preview the report fine.
I created a Windows Forms application that creates an instance of the report. When the report first renders, it renders with the default values and I am also able to change the values in the ReportViewer as an end user and re-render the report with no issues.
TopPageViews report = new TopPageViews();
InstanceReportSource reportSource = new InstanceReportSource();
reportSource.ReportDocument = report;
this.reportViewer1.ReportSource = reportSource;
this.reportViewer1.RefreshReport();

Simple Date Arithmetic in Oracle APEX

What I need to do is, in my mind, incredibly simple. So simple in fact that it is probably obvious and therefore I cannot seem to find any place that documents how to do this.
What I need is just to take the value of a Date Picker page Item (:P1_DATE_1) and through a dynamic action set the value of a second Date Picker page Item (:P1_DATE_2). The value of (:P1_DATE_2) should be 2 years, or 730 days, greater than the value of (:P1_DATE_1). So all I need is a simple '+730' expression right?
I had this working using sysdate as the start date for this calculation. The below PL/SQL expression gave the appropriate output:
to_char(sysdate + 730,'dd-MON-rr')
But then I could not get it to translate to accepting the value of the page item. I already have the actions and everything set up I just can't get it to function when I try substituting :P1_DATE_1 for sysdate. I have tried as many different manifestations of that expression using the page item but it does not populate the 2nd page item.
Sorry for the probably stupid question but if anyone could help out I would appreciate it. Thanks!
#Justin Cave is correct: all values in page items are treated as varchar2
As for your dynamic action, this is what i've set up:
Region:
Dynamic action (date 2 add):
True action:
Are you getting an error? If so, what error? Since page items in APEX are always strings, you need to convert them to dates before doing date arithmetic on them. Something like this should work assuming that P1_DATE_1 is in the DD-MON-RR format as well.
to_char( add_months( to_date( :P1_DATE_1, 'DD-MON-RR' ),
24 ),
'DD-MON-RR' )
If you're not getting an error and the second item just isn't defaulting, my guess is that you have an order of operations problem. Are you certain that the first item is actually set to a non-NULL value when the initialization code for the second item is run? If you're trying to set the value in the second item based on a value that the human selects at runtime in the first date picker, you'd either need to submit the page or you'd need a bit of Javascript.

Resources