Thank you both Luke and Dan!!
I ended up changing my implicit wait value to a lower number and
indeed it did make my try catch statements take less time. You were
totally correct.
And Dan, I will use Size() in the future to find out the existence of
element. I too assumed that that an exception would be thrown if
nothing was found and it's good to know that it doesn't.
Actually, since I am using the C# version of Webdriver there doesn't
seem to be a Size() function and instead I'm using Count:
int size = driver.FindElements(By.XPath("some xpath")).Count;
.....which I'm assuming is the same thing.
Thanks again!
On Jun 21, 7:04 am, dan hirsch <
hirsh....@gmail.com> wrote:
> It is indeed not elegant but hey we work with what we have.
> It doesn't implicitly wait, if you want you can do it your self using
> implicitWait
>
> Sent from my iPhone
>
> On Jun 21, 2011, at 16:14, Luke Inman-Semerau <
luke.seme...@gmail.com>
> wrote:
>
> Dan, that seems counter-intuitive that findelements wouldn't throw an
> exception if no element is found, but good to know. Do you know if it
> implicitly waits if it doesn't find any elements or not? (I'll crack open
> the code later)
>
> -Luke
>
> On Jun 21, 2011, at 2:22 AM, dan hirsch <
hirsh....@gmail.com> wrote:
>
> Another short Answer, yes. Driver.findelements().size() or using
> JavaScript
>
> Sent from my iPhone
>
> On Jun 21, 2011, at 2:34, tommyboy < <
emailtommy...@gmail.com>
> <
http://groups.google.com/group/webdriver?hl=en>
http://groups.google.com/group/webdriver?hl=en.
> For more options, visit this group athttp://
groups.google.com/group/webdriver?hl=en.