Variable in M291
-
Hello, trying to get the IP address variable showing in M291 but with no success
var ip = {network.interfaces[0].actualIP}
M291 S2 P"Copy and paste in the IP address in your browser" R""^{var.ip}^"" -
@Nazar the R parameter is wrong, it should be this:
M291 S2 P"Copy and paste in the IP address in your browser" R{var.ip}
If a parameter is to be an expression, the whole expression must be enclosed in { }. You could also have used this:
M291 S2 P"Copy and paste in the IP address in your browser" R{""^var.ip^""}
but the concatenation with empty strings is redundant.
Also the first line can be simplified to:
var ip = network.interfaces[0].actualIP
-
@dc42 Thank you so much
-
@dc42 Im struggling with something similar. What if I want the IP variable to be included also inside de P parameter in order to have a full test like "copyu and paste the IP number: (IP variable value here)"
-
@Tinchus you would use something like this
P{"copy and paste the IP number: "^network.interfaces[0].actualIP}