Re: [selenium-users] findElement(By.id()) vs findElementById() in FirefoxDriver

776 views
Skip to first unread message

Jon Valvano

unread,
May 8, 2013, 9:58:53 AM5/8/13
to seleniu...@googlegroups.com
Have a look at the JavaDoc:

Both of these methods are from the RemoteWebDriver class.

findElement(By.id()) requires you to created your own By.id instance.
findElementById(String) is a helper function that will generate the By.id instance for you.

It comes down to providing you with the flexibility to choose what you want to keep track of in your tests/framework.  
Do you want to track locators as Strings?
Do you want to track locators as By objects?





On Wed, May 8, 2013 at 8:13 AM, Shashank Shekhar Tiwari <shshank....@gmail.com> wrote:
findElement(By.id()) vs findElementById() in FirefoxDriver 
Why two methods for same purpose? Create an object of FirefoxDriver class. Both the methods are available on this object, purpose is same..Why so?

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/l9VReU6gutcJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jon Valvano

unread,
May 8, 2013, 10:01:02 AM5/8/13
to seleniu...@googlegroups.com
"Both of these methods are from the RemoteWebDriver class."

I should have said, "Both of these methods are inherited through the RemoteWebDriver class.".
Reply all
Reply to author
Forward
0 new messages