Is there a way to concatenate the results of a script into a longer string? - selenium-ide

I need to generate a new random email each time I run my script. I know the script by itself works, but when I attempt to add the returned number into testaccount+<###>#gmail.com it fails. It doesn't like my plus signs, but I'm pretty sure those are standard? Selenium IDE answers only please.
Command: execute script
Target: return
{"testaccount+"+Math.floor(Math.random()*99999)+"#gmail.com";}
Value: Var1
The error I get is: Unexpected token '+'

Related

Pentaho script invocation not working properly

I'm running a PowerShell script from pentaho, but I encounter the following problem. When it is called, the script step gets as parameter the rows that are processed by the previous step. From the images should be more clear what is the problem.
This is the complete transformation.
This is how the steps are configured.
Here are the parameters of the transformation before the script step.
This is the result after the execution. The string after the ....shell.bat contains the names of the rows that were processed by the previous step. If I do no process any row this string is not present. The problem is that this string should not be passed as parameter to the powershell.exe command, the first parameter should be the path to the script file. In fact in the row below (the output) the command is correct.
The problem is that I looked all the options and controlled all the variables, and seem everything ok. I'm not able to run the command successfully because I cannot remove this passed parameter (which I don't pass, but pentaho pass it by itself).
It is possible that is a bug or something? Can anyone give me some indications on how to solve this. Thank you.

Problems with Wget64

Attempting to write a Wget to get and save Vanguard pricing data. So far I have 2 statements that both work correctly from the Command Line when I paste the string. When I save the string as a bat file one works and the other gives an unexpected result.
The string that works correctly in both places is:
Wget64 --output-document=C:\Users\Default\downloads\VVA_Daily_Portfolio-%DATE:~-4%-%DATE:~4,2%-%DATE:~7,2%.html "https://personal.vanguard.com/us/funds/annuities/variable"
The string that only works in the Command Line and not as a bat file is:
Wget64 --output-document=C:\Users\Default\downloads\VVA_Fund64_History-%DATE:~-4%-%DATE:~4,2%-%DATE:~7,2%.html "https://personal.vanguard.com/us/funds/tools/pricehistorysearch?radio=1&results=get&FundType=VVAP&FundIntExt=INT&FundId=0064&fundName=0064&fundValue=0064&radiobutton2=1&beginDate=03%2F01%2F2017&endDate=12%2F31%2F2017&year=#res"
Can someone help me write the script so that the expected result is achieved. I suspect that the Vanguard website can tell the difference between a Command Line vs bat file query, or that there is something inherently different between the two methods of execution.
ANy assistance is appreciated. Dan
The cmd command parser behaves differently in command line and batch files. In this case, the main problem is the variable expansion. In command line when a variable does not contain a value (it is undefined), the variable read operation is not removed, but inside batch files the read operation is removed.
That means that something like echo(%thisDoesNotExist% will output (under the assumption the variable does not exist) %thisDoesNotExist% in command line and nothing in batch file.
What relation has this with your problem?
If we split your wget in parts you have
Wget64
--output-document="C:\Us ... y-%DATE:~-4%-%DATE:~4,2%-%DATE:~7,2%.html"
^........^ ^.........^ ^.........^
"https://pe ... h?radio=1& ... &beginDate=03%2F01%2F2017&endDate=12%2F31%2F2017&year=#res"
^....^ ^....^
You can see where the parser tries to resolve variables, correctly in the output case and incorrectly (from the purpouse of the command point of view) in the URL.
You need to escape (by doubling them) the percent signs that are not part of a variable read operation, ex. ... beginDate=03%%2F01%%2F2017&...

Reading user input from powershell through scriptcs

Here I have a problem to read user inputs from Command prompt or windows powershell through scriptcs.I tried with Console.ReadLine(),Console.Read() or Console.ReadKey() wrapped it around Convert.ToString() to get user response but none of them gives result.Do I need any special package to handle the user input. Any help is appreciated.
I got the solution I was previously executing through Windows power shell and so I don't get the response as desired while using Console.ReadLine() or Console.Read().It appears as if it got hanged and processing instruction indefinitely. But when I work the scriptcs code in command prompt it reads the input and works as expected.

What is the Redis command line (redis-cli) continuation character?

I am trying to build a redis 'stored procedure' in lua that will update a keyvalue store when one of the map fields changes, and will also extract a value from another key when said value changes. I have built this lua(redis) script and it works.
But I discovered that when I try to enter it into the redis-cli, it complains unless I concatenate all the lines of the script onto one long line. Surely there is a 'continuation character' recognized by the redis-cli (?) but I cannot find it.
Anybody know the continuation character for redis-cli?
One option would be to save the lua script to a file and then use the command line to execute the script in the file as shown here:
http://www.redisgreen.net/blog/2013/03/18/intro-to-lua-for-redis-programmers/
I realize this is not a direct answer to what the continuation character for redis-cli might be (or if it exists).

Powershell - MS Exchange E-mail Autoresponder

We've currently got an issue where we're receiving a lot of bounced e-mails (from an auto generated e-mail) back from people where a specified e-mail address is not valid (failure notice). I need to identify certain messages in the mailbox and respond automatically to them - as a newbie to Powershell I'm struggling a bit! I think I understand how to check for the occurrence of a string but I don't know how to iterate through an inbox to look at/get a handle on each message in turn and I don't know how to extract the subject or body text in order to analyse the contents and perform a string comparison. I fear this should be easy - but I can't find anything on the web that might do the job - can anyone help?
So just to clarify what you're looking for.
Mailbox A receives a large number of failure notice/bounce messages.
You'ld like your powershell script to search Mailbox A for every instance where the Subject line (or message body) contains "String X" and if there is a match, take some action?
Also, what version of Exchange are you using? You need to be at least on 2007 to use Exchange Command Shell. You'll then want to look over the Command Shell commands that can be run.
Look at the Exchange Message Tracking Log, and Pipe the results from one command you run to the next. Think of it like this...
(Run a command) | (Run another command on the results of the first command) | (Run a last command on the results of the second).
You can view an example on my website at:
http://www.technoctopus.com/?p=223
While not exactly the same, it might get you moving in the right direction.