workfusion webelement has two variable ad doesnt take anything - variables

Workfusion I am trying to make two variables through web-element. When running individually its great but when running separately it has problems.
Please see the picture for the same. This doesn't get executed.

If your XPath has any variable then try the giving a value like following:
//*[#id="mv-tiles"]/a[${i}]
and you can keep changing value of i through loop. A variable inside another will throw error in Workfusion RPA Express.

The ${} evaluates the whole it's body.
Does the following, without nested ${} execute OK?
${webrange[countertemp]}

Related

What are the correct syntaxes for referring to a subform, and why is the recommended one producing an error?

I have the following two lines of code:
Debug.Print Forms!DocLoader!DL_RowBox!DLR_FileName.Name
Debug.Print Forms!DocLoader!DL_RowBox.Form!DLR_FileName.Name
The second one, which I have seen recommended in almost every VBA reference, including the answer being suggested from SO as I type this, follows this structure:
Debug.Print Forms![Form Name]![Subform Control Name].Form![Control Name].Name
These two lines of code should produce the same result. However, the second, recommended syntax throws error 40036, "Application-defined or object-defined error" unless I am in design view. I cannot use it at runtime, but I have never seen this limitation mentioned in any of the reference documentation or forum posts I have looked at. The first line, using only default parameters, seems to work no matter the context.
With the second line, I have tried just about every combination of bang and period I can, and I have also tried enclosing field names in brackets, but the common denominator is that as soon as I reference ".Form" the application throws an error. Even something simple like ".Form.Caption" has thrown an error. So what I would like to know is:
Are there any other correct ways of referring to a subform's form properties, since I need these as well as its controls
Why would the first line execute correctly while the second, recommended one does not seem to work?
Running the compiler appears to have fixed the issue.

Using XPath In Cycle For

I'm trying to solve one simple problem that i can't understand how i could solve in excel vba.
I have one cycle for and a Xpath with 24 elements and i want to get text from each element, but when i use xpath shows me that i put the wrong xpath. I understand that i put i inside the string of xpath and that get me wrong. I try different approach like using
Name.Add findApp.FindElementByXPath("(//span[#class='offer-item-title'])["&"i]").Text
but nothing seems work. Can someone help me how i could solve this? Thank you so much :)
Code:
for i=0 to 23
Name.Add findApp.FindElementByXPath("(//span[#class='offer-item-title'])[i]").Text
Next i
XPath doesn't know that i is the name of a VB variable, it thinks it is the name of an element in your source document.
You can construct an expression like this:
FindElementByXPath("(//span[#class='offer-item-title'])[" & i & "]")
Or better, but I don't know if VBA offers the capability, is to pass a parameter into the XPath expression -- ideally you only want to compile the XPath expression once, rather than repeating the compilation 23 times, because compiling it typically takes 100 times longer than executing it.
But for this particular example, it would be better to construct an expression that reads everything you want in one go, rather than making 24 separate calls. Incidentally, XPath indexing starts at one, so the call with i=0 will select nothing. Given that this is XPath 1.0, you can do
//span[#class='offer-item-title'])[position() < 24]

Mule variable in MEL as String

i have an expression bellow to read a file from resources :
#[Thread.currentThread().getContextClassLoader().getResourceAsStream('abc.txt')]
it worked fine, but i want to use a variable like this one:
#[Thread.currentThread().getContextClassLoader().getResourceAsStream(flowVars['fileName'])]
it does not work,
how can i make it work like the first one MEL ?
how can i read a file in absolute path "D://input/abc.txt" using MEL ?
Thanks for helps.
resolved
use flowVars.filename instead of flowVars['fileName'] it worked, but i can't get it, i use logger with this MEL #[flowVars['filename']] and it work too but in the second MEL it failed.
1) You are using a different case with the two different approaches. Variable names are case sensitive.
2) Just use a FileInputStream:
#[new FileInputStream("path")]
Or even better maybe to use the File transport/Mule Requester Module.
Try this, Use variable name instead of using keyword "flowVars"
#[Thread.currentThread().getContextClassLoader().getResourceAsStream(fileName)]

Evaluate a variable within a variable in Powershell

I have the following variables:
[string]$eth_netmask = "ext_netmask"
[string]$ext_netmask = "255.255.252.0"
$($eth_netmask) is returning ext_netmask. I was expecting 255.255.252.0
What am I doing wrong?
Thanks for the help in advance!
The command $eth_netmask returns the value of the variable named eth_netmask. The expression $(something) has nothing to do with variables, but instead evaluates the contents of the parentheses before evaluating the rest of the statement. That means that the statement $($eth_netmask) will evaluate in two steps:
1: $($eth_netmask) evaluates to the command "ext_netmask"
2: "ext_netmask" evaluates as a command which has the result of printing ext_netmask to the output.
This format is unnecessary since variables are normally resolved before the rest of the command anyway. My recommendation would be to avoid needing to do this at all if there is any alternative. Putting this kind of roundabout referencing into a piece of code can only cause problems. However, if you can't avoid it for some reason, it is possible to reference a variable the name of which is stored in another variable.
[string]$eth_netmask = "ext_netmask"
[string]$ext_netmask = "255.255.252.0"
Get-Variable -Name $eth_netmask -ValueOnly
This is the point at which the $(something) syntax becomes useful. If you need to use the value that you have just returned in another command, such as if the value was an ip that you were trying to ping, you might do something like this:
Test-Connection $(Get-Variable -Name $eth_netmask -ValueOnly)

Stimulsoft code based variables won't show their value

I´m losing my mind here, I've tried every example I've found online and still can't get it to work, this is the way im creating the variable on the code that generates the report, I'm working on a .NET application:
report.Dictionary.Variables.Add(New Stimulsoft.Report.Dictionary.StiVariable("test",""))
report("test") = "ANYTHING"
While it does show me the created variables on the Stimuloft gui, it contains absolutely nothing, any ideas on what I'm doing wrong? Thanks!
You should use next code to set value of variable:
report.Dictionary.Variables("test").Value = "ANYTHING"
The code that you use will work after calling report.Compile() method only.