[fakeapp]

242 views
Skip to first unread message

Roberto

unread,
Nov 9, 2010, 10:59:30 AM11/9/10
to Fake

hi, just bought Fake. Great tool. Still I am not sure how to be able
to use a counter as a variable in a XPath string. Basically I have to
access a loong list of elemnts via XPath, the DIV[] part will count up
to 2500.

/HTML[1]/BODY[1]/SPAN[1]/DIV[4]/DIV[1]...
/HTML[1]/BODY[1]/SPAN[1]/DIV[4]/DIV[2]...


So I thought of something like
--

Repat
number of times: 2500

Click HTML Element
for XPath /HTML[1]/BODY[1]/SPAN[1]/DIV[4]/DIV[$vmyar]

End Repeat

--
But I need to know if the var will be accepted in the XPath string and
how I can increment it by 1

Todd Ditchendorf

unread,
Nov 9, 2010, 11:12:31 AM11/9/10
to fak...@googlegroups.com
Hi Roberto, here's how to do that:

http://skitch.com/itod/d91fb/looping-with-xpaths

and here's a downloadable workflow to get you started:

http://fakeapp.com/ex/looping_with_xpath.fakeworkflow.zip

hope that helps!

TD

Xavier Duportet

unread,
Dec 23, 2013, 7:31:20 AM12/23/13
to fak...@googlegroups.com
Hi there,

I'm trying to adapt this script to my case.
my question: how to start from 1 and not 0?
I guess we should set the loop.index to 1 right? but how to do this?

thanks so much for your help!

Best,

Xavier

Todd Ditchendorf

unread,
Dec 23, 2013, 3:31:00 PM12/23/13
to Fake
Hi Xavier,

No, you cannot set the value of `fake.loop.index`. It is there to tell you which iteration you are currently on. Setting it would not make sense.

Just increment your own index variable by 1.

TD


--
You received this message because you are subscribed to the Google Groups "Fake" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fakeapp+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages