Browser Extension Operations (v1.0.0)
Prerequisites
Install Keploy on PC
git clone https://github.com/keploy/keploy.git
Now come inside this directory and run this project in docker by putting the command mentioned below.
docker-compose -f docker-compose-dev.yaml up
Install the Keploy browser extension from the link: https://github.com/keploy/browser-extension/releases
After installing the browser extension go inside your extension manager and switch to the developer mode.
After that go on the load unpacked button, which appears just after switching on the developer mode and import your extension file from the expected location.
Now we have:
-
Selenium extension installed
-
Keploy extension installed
-
Keploy tool is installed and running in docker
Let's start front-end testing using selenium IDE extension. The Keploy extension will keep running in the background once keploy server is up.
Step-1: Create a new project and rename it, or you can also open an existing project
Step-2: Give a title to your 1st test case
Step-3: Put the URL of the desired website for testing.
Step-4: Press on the record button present in the top right corner.
Step-5: Now default browser will open, In our case, it’s the chrome browser.
Step-6: Perform your desired actions and selenium will start recording the positions and actions along with the data present at that place.
Step-7: In our case we are doing a google search with the keyword oss. We can see many search results present in the suggestion but we will go with the 1 st option.
Step-8: We know that our keploy server is already running in the background and keploy extension is present in the chrome browser. In the background, our keploy server is recording all the data coming from APIs on the front end in mongo DB. Let’s see inside mongo DB using mongo compass.
Step-9: Now we will replay the recorded data in selenium, but this time data will not come from live servers of google, instead of that data will come from the moc database made by keploy
Step-10: Now because of the static database all the selenium test cases will pass.