AMP allows users to upload one selenium scripts when creating a crawling (spider) test in AMP. The Selenium script will execute before the AMP test, allowing you to script pathways into your websites and applications through authentication and user workflows to where you want AMP to test. It is worth noting that because the script runs before the test it cannot be used to script behavior during the crawl. AMP currently supports selenium scripts of the following file types:
- JSON
- HTML
- SIDE
The guide below will walk you through the process of recording a Selenium script on the Selenium IDE (.SIDE File). The link to install the extension can be found here:
https://selenium.dev/selenium-ide/
If you would like to learn more about Selenium we recommend you reference the Selenium resources.
Recording a Selenium Script on the Selenium IDE
Selenium is a great tool that AMP can use to bypass workflows and authentication for AMP Spiders. For this example, I created a test Selenium macro for logging into AMP. Here are instructions on how to record a Selenium script using the IDE.
First things first, you want to make sure that the Selenium IDE extension is installed, to check make sure you see the "Se" Icon in your toolbar:
Now that you have confirmed it is installed, you can click on the "Se" Icon to open the IDE. You will be directed to the screen below where you are going to want to click "Record a new test in a new project" as seen in this screenshot:
You will then be directed to a screen where you can name your project:
Be sure to name the project and click on "OK." From here, you will be directed to a screen where you will be allowed to input your "Base URL" which is where you want the Selenium script to start. Here is the example URL:
Since I want to start recording on the above URL, that is what you would input into this field. Make sure you have no active session on your browser that is already logged into the site that you are trying to bypass authentication. Once you are ready to record, click on "Start Recording." This will open up a new browser window directed at your "Base URL" and from here you can start recording your movements and inputs. You will see a red "Selenium IDE is recording..." image on the bottom:
Now, engage in the workflow you are trying to bypass. The Selenium IDE will record all of your movements and commands.
NOTE: Please do not use production credentials when using Selenium as the IDE does not encrypt information recorded from the password fields. Please use test credentials when using Selenium.
Once you have completed the workflow and are on the page you want the AMP crawler to start, navigate back to the Selenium IDE and click stop:
This will stop the recording and allow you to save the file. In order to save the file, click on the "Save" floppy disk icon:
Once you click the "Save" button, be sure to save it in the ".SIDE" file format when saving the macro:
Now that you have saved the .SIDE file. You will be able to follow instructions on Uploading Selenium Scripts in order to create an AMP Spider that uses the Selenium IDE script.
Comments
0 comments
Article is closed for comments.