Page 1 of 1

Methods with a return value in repo

Posted: Mon Nov 17, 2014 4:42 am
by rampage333
Hi everyone,

is it possible to edit a repo item xpath to enable the use of methods with return value?

something like:
/div[@innertext='"somemethod(1,2)"']


thanks in advance.

Re: Methods with a return value in repo

Posted: Mon Nov 17, 2014 3:49 pm
by krstcs
No, the path cannot have in logic outside of Regex.

What you CAN do, though, is to variablize the path and set the variable right before you need to use it.

MyRepoObject --> /div[@innertext=$var1]

Usercode:

Code: Select all

var1 = somemethod(1,2);

MyRepoObject.Click();
var1 will be evaluated by the MyRepoObject call at the time the Click() is attempted.