Sunday, April 2, 2023

Selenium Commands Regularly Used

     Following commands are used with "Navigate" function of selenium.

       1) to(String url) :-  To open the specified URL.
2) to(URL url) :- To open the specified URL.
3) back() :- To redirect back in the browser history.
4) forward() : -  To redirect forward in the browser history.
5) refresh() :-  To refresh the current page.

    Following commands are used to manage the browser.

1) get(String url) :- To open the specified URL.
2) getCurrentUrl() :- To get the URL of current webpage.
3) getTitle() :- To get the title of the current page.
4) close() :- To close the current window(Tab).
5) quit() :- To close the complete browser.

 Following commands are used to search the webelements.

1) findElement(By by) :- This command will provide first element matching the specified criteria.
2) findElements(By by) :- This command will provide all elements which are present on webpage & matching the specified criteria .                                                         

 Following commands are used to perform manipulation on webelement.

1) click() :- Click on an element.
2) submit() :- Submit a form.
3) sendKeys(CharSequence... keysToSend) :- Send the specified keys to an element.
4) clear() :-  Clear the text from a text field.







Disclaimer:

This blog is related to software testing, automation testing, and their functioning. To write the blog I have referred lots of testing sites, material etc. If anyone has any issue about blog/written content or have any kind of suggestions then please write an email to me @ kprathmesh1992@gmail.com
Disclaimer of warranty: Software-Testing-Hub provides the Services to you as is. You use them at your own risk and discretion. That means they don’t come with any warranty. None expressed, none implied. No implied warranty of merchantability, fitness for a particular purpose, availability, security, title or non-infringement.



No comments:

Post a Comment