you're right, the only way to solve this elegantly is with XPath, however I'm not that good with it yet and I need to make this work on pages that are very complex and that change a lot. so now I will have to dig into this.
On Sat, Nov 6, 2010 at 6:52 AM, Deepak Shetty <[email protected]> wrote: > do you have to use a regex ? an XPath assertion has better support for > positional stuff. Worst case you can always use a beanshell assertion (and > java regex's) > > regards > deepak > > On Fri, Nov 5, 2010 at 9:34 AM, Adrian Speteanu <[email protected]> > wrote: > > > Hello, > > > > Can you think of a way to assert that something is matched in document on > > the exact x match? > > > > I have: > > 1. variableToMatch - its numeric > > 2. samplerToAssert - response matches ${variableToMatch} pattern several > > times, an assertion without regex will also pass easily, but it is more > > important to test that is on the exact match-position no. 2, 3, 4 etc on > > various repetitions. > > > > How would you assert this? > > > > My alternative is to add a sampler after that that I'm interested in and > > test if variableToMatch equals a regex on the exact same position I > > predict, > > but preferably I want samplerToAssert to fail. > > > > Suggestions? > > > > Thanks, > > Adrian > > >

