Current time: 12-15-2019, 12:44 PM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
test agents detected as mobile browsers by some cms
12-09-2010, 06:33 PM
Post: #1
test agents detected as mobile browsers by some cms
Im trying to test a site which runs on Kentico CMS...

On testing on major browsers locally, it shows the website fine, but on webpagetest.org it redirects to the mobile version.

After initial debugging, i figured it is based on the user agent.

for example user agent of "Gloucester, UK - IE7 - DSL" is :-
Code:
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; PTST 2.252)

When i make a request to the site with this useragent from any browser it will be redirected to the mobile site, but if i delete the ; PTST 2.252 portion, it returns the normal website just fine.

On googling i couldnt find any documentation about the PTST portion.

Even on my decent trafficked website, only 4 out of 1071901 hits contained the term PTST .

Is this some user agent string unique to webpagetest?

Is there a way to mention a custom user-agent string while making a test?

FYI :-

Code:
sajal@sajal-laptop:~$ HEAD -S -H 'User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; PTST 2.252)' http://www.<snip>.com/home.aspx
HEAD http://www.<snip>.com/home.aspx --> 302 Found
HEAD http://www.<snip>.com/mobile/home.aspx --> 200 OK
[...]

sajal@sajal-laptop:~$ HEAD -S -H 'User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)' http://www.<snip>.com/home.aspx
HEAD http://www.<snip>.com/home.aspx --> 200 OK
[...]

Note: Second request has the PTST portion removed

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
12-10-2010, 02:12 AM
Post: #2
RE: test agents detected as mobile browsers by some cms
PTST is a pagetest-specific user agent string that gets injected when testing so it's easy to find (and filter) your test traffic. Unless they were explicitly trying to test a mobile site with WebPagetest I can't imagine why you're seeing what you are (being that picky about user agent strings would send most of their users to mobile).

You can override the user agent string with a script: http://www.webperformancecentral.com/wik...tUserAgent

Something like:

Code:
setUserAgent    Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
navigate    http://www.<snip>.com/home.aspx

(make sure there are tabs between the commands and values when you paste it into the script field).
Visit this user's website Find all posts by this user
Quote this message in a reply
12-10-2010, 03:51 AM
Post: #3
RE: test agents detected as mobile browsers by some cms
Thanks a lot. works like a charm.

My earlier attempts to play with scripted tests were a FAIL(probably cause of the tabs) ... now scripted tests will keep me busy for days Smile

Ive already passed a message to the person concerned about the aggressive/faulty mobile detection... but its not in my hands.... ".aspx" in the url is usually a good indicator of the quality of CMS they use ....

cdnplanet.com: We help you select the right CDN
Visit this user's website Find all posts by this user
Quote this message in a reply
12-10-2010, 04:11 AM
Post: #4
RE: test agents detected as mobile browsers by some cms
lol

btw, I tweaked the site a few days ago so you can actually add tabs directly in the script edit field (and breaking usability and the ability to actually tab out of the box but seemed like it was worth it) so it should be easier to deal with scripts now.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)