Cmobilecom AF 5.19 Developer Guide

24.5 User Agent

To determine if a user agent is a bot or a mobile device, patterns are used to match User-Agent request header. The configuration file is cmobilecom.home/conf/user-agent.xml. For example,

<user-agent>

	<bot>
		<pattern>.*(spider|bot|crawler).*</pattern>
	</bot>

	<mobile>
		<pattern>.*(mobile|sm-t|touch|android).*</pattern>
	</mobile>

</user-agent>

Bot

If User-Agent header matches any of the bot patterns (case-insensitive), it is regarded as a bot. Patterns are regular expressions. For a bot, HTTP sessions will not be created, and view states will not be saved. Note that a long list may incur some performance overhead.

Mobile

If User-Agent header matches any of the mobile patterns (case-insensitive), it is regarded as a mobile device. Patterns are regular expressions. Cmobilecom AF may respond differently for better user experience.
MultitenantTest AutomationFrames / No Frames