I am trying to get the current time in milliseconds and to add to it 5 minutes... Tried:
${__time + 1000 * 60 * 5}
Tried many more variations, none of them worked..
Any ideas?
You could try this too.
${__groovy(System.currentTimeMillis()+5*60*1000,)}
Answering myself, sharing it with you...
The solution here is to use:
{__longSum(${__time}, 900000)}
Another alternative that would work also similar to the groovy solution is:
${__jexl2(${__time}+900000)}
Related
How I can get the next year from now?
1.year.from_now
I need to get only 2019 as a result from the above code.
Use Time.now.next_year (activesupport needed) and if you want only year then go with Time.now.year + 1
Other option
require 'date'
Date.today.next_year.year
1.year.from_now.year
does the job.
Any expression returns now + .next_year + .year
Time.now.next_year.year
Date.current.next_year.year
DateTime.current.next_year.year
etc. and all others solutions proposed.
I hope it useful for you. :)
Use this code: DateTime.now.year + 1
I'm trying to use a relatively basic IF function but having no luck - i'm sure i just have brackets or parenthesis wrong or something. Reckon it will be childsplay for you guys....
The formula is intended to show how many days a date has passed by. Date is shown in T column.
Basically it was working fine as the following, both for pending and past dates:
=IF(T7<=TODAY(), (TODAY()-T7),-(T7-TODAY()))
But I got greedy and wanted it to return more of a statement when the date has passed, as to how much it has passed by. So I've tried to make this happen with:
=IF(T7<=TODAY(),"EffOut(TODAY()-T7) days ago",-(T7-TODAY()))
Hoping it would enter "EffOut 8 days ago" (when TODAY()-T7 is 8 days) for example.
But it doesnt - it shows the entire argument i.e "EffOut(TODAY()-T7) days ago" in the return cell.
Is it possible to have a kind of embedded formula in the 'value_if' fields, mixed with text in this sense?
Happy to share the document if that would help, but will need to clear the data first so just let me know.
Thanks in advance, any help is much appreciated! Having read other posts I think it will just be a simple fix but its well beyond me! (I only got this far by perusing forums...)
Maybe something like this...
=IF(T7<=TODAY(),"EffOut "&DAYS(TODAY(),T7)&" days ago",-(T7-TODAY()))
=IF(T7<=TODAY(),"EffOut "&(TODAY()-T7)&" days ago",-(T7-TODAY()))
You just need to be careful to put "" around any strings. This is how Excel knows that's not a part of the formula. Remember to out the spaces is to the string like I did above so it looks like a sentence. The & sign combines the results of the calculated parts and the strings.
I have some buttons that get disabled when adding a user.
What I need to be able to do is have firewatir wait_until something is present.
I am trying to use this right now:
count = 10
while count > 0
browser.button(:name, "_eventId_addEmployee").click
Watir::Wait.wait_until_present {text.exist? newHireUsername}
end
count -= 1
end
For some reason I can't get the wait_until method to work correctly.
Thanks in advance!
I usually do something like this,
browser.element_type(:id, "xxx").wait_until_present
Instead of using the wait_until_present option I used an until loop to wait for text to appear.
This by-passed attempting to use it so it does not qualify as an answer for my original question but want it here for others.
How can I make the first letter upper case in the following:
${1:${TM_FILENAME/[\.php]+$//}}
Basically if the filename is "welcome.php", I'd like it to write out "Welcome". This at the moment writes "welcome" (lower case w).
Try the following snippet. Works for me.
${TM_FILENAME/(.*?)(\..+)/\u$1/}
For some reason the above example gives you weird charectors when using it ... it took me a while but the solution below works if you are still looking. It has two solutions here for you the first one is for actual textmate on mac:
${TM_FILENAME/(^.)(.*?)(\.php)/(?1:\U$1)(?2:)(?3:)/}
The next is if you are using e Texteditor on PC:
${TM_FILENAME/(^.)(.*?)(\.php)/(?1:)(?2:$2)(?3:)/}
I hope this helps you if you haven't already.
TM_FILENAME not works for windows?
I want to use XPath code in an InfoPath form to sum the data in field12 when field11 is equal to IT. I tried using the following code, but it doesn't work.
number(sum(/descendant-or-self::node()/my:group12[my:field11 = "IT;"]/my:field12))
I suspect this has to do with the multilayering of groups, as shown below. Does anyone know the code that would allow me to get to the data in group12? Thanks in advance for your help.
myfields>group9>group10>group11>group12>field11 field12
Genipro
Looks like:
number(sum(/descendant-or-self::my:group12[my:field11 = 'IT;']/my:field12))
could be right.
decendant-or-self should not be necissary in this case (unless you need the expression to work even if group12 is moved).
This should work fine:
sum(/my:myfields/my:group9/my:group10/my:group11/my:group12[contains(my:field11,'IT')]/my:field12)
It doesn't matter if any of the other groups are repeating either. All group12's will be checked.