I'm trying to make a general button extension in f# and canopy.
as you know we can click a button like this in canopy
click (//button[contains(text(),'save')])[last()]
But I'm trying to do something like this.
let _button value = sprintf "(//button[contains(text(),'%s')])[last()]" value
let button value = _button value
click button "save"
but this gives This value is not a function and cannot be applied
Any great ideas?
Thanks in advance
buttonis a function with signature:string -> stringclickis a function with signature:string -> somethingSo, you cannot pass
buttontoclick, you should write:or
Idiomatically, I would rewrite your code as: