Methods with a return value in repo

Ask general questions here.
rampage333
Posts: 5
Joined: Mon Nov 17, 2014 4:36 am

Methods with a return value in repo

Post by rampage333 » Mon Nov 17, 2014 4:42 am

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.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Methods with a return value in repo

Post by krstcs » Mon Nov 17, 2014 3:49 pm

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.
Shortcuts usually aren't...