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

What is the difference between driver.close() and driver.quit() methods?

518


Name the different types of waits in webdriver.

513


While injecting capabilities in webdriver to perform tests on a browser which is not supported by a webdriver what is the limitation that one can come across?

476


What are some disadvantages of Selenium automation?

514


what is your approach clicking all the links which are available on the page?

494






Explain what is the difference between find elements () and find element ()?

488


How can we maximize browser window in selenium?

529


What happen if you mix both implicit wait and explicit wait in a selenium script?

461


How can we check if an element is enabled for interaction on a web page?

432


Write a code to wait for a particular element to be visible on a page. Write a code to wait for an alert to appear.

729


What are the important features of selenium ide?

510


Tell us can you write the code to double click an element in selenium?

454


How to assert the title of the web page?

479


What are the annotations available in testng?

496


Can you write the code to double click an element in selenium?

508