Git Product home page Git Product logo

login-logout-selenium-fb's Introduction

Login-Logout-Selenium-FB

Implementing LogIn And Logout Functions In Selenium WebDriver Right now, We are learning some commonly used functions which can actually helps us to minimize our webdriver test case code size. As you know, You need to perform some actions (Example : Comparing Strings, Comparing Integers, Compare Double, And More Like This) many times during your test case execution so repeating same code In every test case Is not a good practice. You can create and common function In some common class and then call that function whenever required.

Login and Logout from your application's admin panel or application account Is also this kind of repeating task which you need to perform very frequently during test execution. So why not create It once and then use It whenever required In your test? Let we try to Implement It.

Supposing you are testing facebook application and you wants to Implement LogIn and LogOut function on It. Then steps will looks like bellow.

Step 1 : Implement initData(), initBrowser(), and closeBrowser() functions In your CommonFunctions class as described In PREVIOUS POST.

Step 2 : Copy paste bellow given LogIn() and LogOut() functions In your CommonFunctions class.

Step 3 : Now Its time to call LogIn() and LogOut() functions In your webdriver test as bellow. Create class with name FBLogin and copy paste bellow given lines In It. Replace dummy user Id and password with your actual user Id and Password before running test.

Now run your test and observe result. It will login In your account and then logout from It. You can Include your test activity between logIn() and logOut() functions.

Now you can call logIn() and logOut() functions anywhere In your test or any of the test case. I hope you understand what I am trying to tell you.

****source: https://www.software-testing-tutorials-automation.com/2014/06/implementing-login-and-logout-functions.html

login-logout-selenium-fb's People

Contributors

maichlonizer avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.