To test the SEO plugin and the application-specific SEO plugin extension, you can create mock browser requests that behave as if they are coming from a search bot. To do this, the User-Agent
header in the request must be modified to have a value of googlebot
or some other search bot. One method for making these requests is to use the Requestly plugin for Google Chrome.
To use Requestly to mock search bot requests:
Create a new rule in Requestly with the following characteristics:
Rule Name: SEO Test
Rule Description: Triggers the CSA SEO pipeline
Status: Active
Headers Modification Rules:
Modify
Request
Header = User-Agent
Value = googlebot
Url Contains = /
context-root
/
Save the rule, making sure it is active.
Make sure the production server instance is running and make a request by navigating to the your site’s home page, for example,
localhost:8080/
context-root
/home
.Because the SEO Test rule is active, the request appears to come from a search bot. PhantomJS is called to render the HTML content for the page and cache it in the
SEORepository
.To confirm the page was rendered, in a browser, navigate to DynamoAdministration for the production server, for example, http://localhost:8080/dyn/admin. Enter your user name and password.
Use the component browser to navigate to the
/atg/seo/SEORepository
component.Click the List All Items link for the
SEOPage
repository item type. AnSEOPage
repository item matching the URL you used in step 3 should appear in the list of items.Once the testing is complete, be sure to deactivate the SEO Test requestly rule.