Difference between @findByMethod and @findelement?

Answer Posted / elakkiya

Both methods are used to find the webelements.

findelement:
-------------------

This is one of the abstract method , should be used to find the single web element.
Return type is single web element.

@Findby:
--------------
This is one Annotation in Page factory model and used to locate one or more WebElements using a single criterion.

it has two kind of methods as follows.

• The @FindBys annotation is used in case elements need to match all of the given criteria
• The @FindAll annotation is used in case elements need to match at least one of the given criteria

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me how can we maximize browser window in selenium?

523


Mention what are the capabilities of selenium webdriver or selenium 2.0?

593


How to do drag and drop in selenium?

599


Can captcha and bar code reader be automated by using selenium?

539


Explain dataproviders in testng using an example. Can I call a single data provider method for multiple functions and classes?

548






How to debug the tests in selenium ide?

612


Can we use selenium grid for performance testing?

532


What difference do you make between soft vs. Hard to say in selenium?

554


Mention what is the difference between selenium and sikuli?

739


Explain the fundamental difference between xpath and css selector.

608


Can you use Selenium to test the Rest API or Web services?

576


What distinguishes between an absolute and relative url in side?

571


What is the syntax of finding elements by id using css selector?

563


In selenium ide, give the usage of context menu?

647


In which format does source view show the script in selenium ide?

573