0

我正在使用 Selenium 对某个 url 执行一个简单的请求。我将流量记录到服务器 fia Fiddler2。

如果我将流量与真实浏览器的流量(In Private Browsing with Internet Explorer)进行比较,请求的顺序是不同的。

这是我的代码:

package com.example.tests.javaJunit4Webdriver;

import static org.junit.Assert.fail;

import java.io.IOException;
import java.util.Date;
import java.util.concurrent.TimeUnit;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.remote.DesiredCapabilities;

public class JavaJunit4WebdriverInternetExplorerWikiFacebook {
    private WebDriver driver;
    private String baseUrl;
    private boolean acceptNextAlert = true;
    private StringBuffer verificationErrors = new StringBuffer();

    @Before
    public void setUp() {

        try {

            DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
            caps.setCapability("ignoreZoomSetting", true);
            // Delete Browser Cache since IE does not open a clean profile
            // unlike Chrome & FireFox
            try {
                Runtime.getRuntime().exec(
                        "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255");
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            driver = new InternetExplorerDriver(caps);
            driver.manage().deleteAllCookies();

        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
    }

    @Test
    public void testJavaJunit4Webdriver() {
        System.out.println("testJavaJunit4Webdriver");

        System.out.println("airdroid");
        driver.get("http://web.airdroid.com/");
        Date now = new Date();
        System.out.println(now.toString());
        for (long stop = System.nanoTime() + TimeUnit.SECONDS.toNanos(7); stop > System
                .nanoTime();) {
        }
        System.out.println(new Date().toString());
        System.out.println("Wiki Facebook");

        baseUrl = "http://de.wikipedia.org/wiki/Facebook";

        driver.get(baseUrl);

    }

    @After
    public void tearDown() {
        System.out.println("tearDown");

        Date now = new Date();
        System.out.println(now.toString());
        for (long stop = System.nanoTime() + TimeUnit.SECONDS.toNanos(7); stop > System
                .nanoTime();) {
        }
        System.out.println(new Date().toString());

        driver.quit();
        String verificationErrorString = verificationErrors.toString();
        if (!"".equals(verificationErrorString)) {
            fail(verificationErrorString);
        }
    }

}

如果我执行这个测试用例,我会得到:

GET http://de.wikipedia.org/wiki/Facebook
200 OK (text/html)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=ext.flaggedRevs.basic%7Cext.gadget.CommonsDirekt%2CWikiMiniAtlas%7Cext.wikihiero%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmw.PopUpMediaTransform%7Cskins.vector&only=styles&skin=vector&*
200 OK (text/css)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=startup&only=scripts&skin=vector&*
200 OK (text/javascript)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=site&only=styles&skin=vector&*
200 OK (text/css)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Disambig-dark.svg/25px-Disambig-dark.svg.png
200 OK (image/png)

GET http://bits.wikimedia.org/geoiplookup
200 geoiplookup (text/javascript)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Facebook.svg/266px-Facebook.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/ef/MarkZuckerberg.jpg/220px-MarkZuckerberg.jpg
200 OK (image/jpeg)

GET http://bits.wikimedia.org/static-1.21wmf10/skins/common/images/magnify-clip.png
200 OK (image/png)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.triggerQueueCallback%2CloadingSpinner%2CmwEmbedUtil%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130218T165645Z
200 OK (text/javascript)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=ext.centralNotice.bannerController%7Cjquery.client%2Ccookie%2CmwExtension%7Cmediawiki.legacy.ajax%2Cwikibits%7Cmediawiki.notify%2Cutil%7Cmediawiki.page.startup%7Cwikibase.client.init&skin=vector&version=20130307T025300Z&*
200 OK (text/javascript)

GET http://meta.wikimedia.org/wiki/Special:BannerRandom?userlang=de&sitename=Wikipedia&project=wikipedia&anonymous=true&bucket=0&country=DE&slot=2
200 OK (text/javascript)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Flag_of_the_United_States_%28Pantone%29.svg/20px-Flag_of_the_United_States_%28Pantone%29.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9f/Flag_of_Indonesia.svg/18px-Flag_of_Indonesia.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Flag_of_Mexico.svg/18px-Flag_of_Mexico.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Flag_of_India.svg/20px-Flag_of_India.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Flag_of_Brazil.svg/20px-Flag_of_Brazil.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Flag_of_the_Vatican_City.svg/13px-Flag_of_the_Vatican_City.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Flag_of_%C3%85land.svg/20px-Flag_of_%C3%85land.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/8/87/Flag_of_American_Samoa.svg/20px-Flag_of_American_Samoa.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/3/30/Flag_of_Nauru.svg/20px-Flag_of_Nauru.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Flag_of_Guernsey.svg/18px-Flag_of_Guernsey.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Flag_of_Monaco.svg/18px-Flag_of_Monaco.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Flag_of_Iceland.svg/20px-Flag_of_Iceland.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/3/3c/Flag_of_the_Faroe_Islands.svg/18px-Flag_of_the_Faroe_Islands.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9c/Flag_of_Brunei.svg/20px-Flag_of_Brunei.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Flag_of_the_People%27s_Republic_of_China.svg/20px-Flag_of_the_People%27s_Republic_of_China.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Flag_of_Niger.svg/20px-Flag_of_Niger.svg.png
200 OK (image/png)

GET http://meta.wikimedia.org/wiki/Special:RecordImpression?result=hide&reason=empty&country=DE&userlang=de&project=wikipedia&db=dewiki&sitename=Wikipedia&bucket=0
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Flag_of_Gibraltar.svg/18px-Flag_of_Gibraltar.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Flag_of_Burundi.svg/18px-Flag_of_Burundi.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Tonga.svg/18px-Flag_of_Tonga.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Flag_of_French_Polynesia.svg/20px-Flag_of_French_Polynesia.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Flag_of_Latvia.svg/20px-Flag_of_Latvia.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/2/27/Flag_of_Moldova.svg/20px-Flag_of_Moldova.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Flag_of_the_Bahamas.svg/20px-Flag_of_the_Bahamas.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Afghanistan.svg/20px-Flag_of_Afghanistan.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Flag_of_Yemen.svg/20px-Flag_of_Yemen.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Flag_of_Guinea.svg/20px-Flag_of_Guinea.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Flag_of_Canada.svg/18px-Flag_of_Canada.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9c/Flag_of_Denmark.svg/20px-Flag_of_Denmark.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Flag_of_Vietnam.svg/20px-Flag_of_Vietnam.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Flag_of_Palestine.svg/20px-Flag_of_Palestine.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Flag_of_Cambodia.svg/20px-Flag_of_Cambodia.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Flag_of_Azerbaijan.svg/20px-Flag_of_Azerbaijan.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/12px-Commons-logo.svg.png
200 OK (image/png)

GET http://bits.wikimedia.org/images/wikimedia-button.png
200 OK (image/png)

GET http://bits.wikimedia.org/static-1.21wmf10/skins/vector/images/search-ltr.png?303-4
200 OK (image/png)

GET http://bits.wikimedia.org/static-1.21wmf10/skins/common/images/poweredby_mediawiki_88x31.png
200 OK (image/png)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=skins.vector&only=scripts&skin=vector&*
200 OK (text/javascript)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=site&only=scripts&skin=vector&*
200 OK (text/javascript)

GET http://upload.wikimedia.org/wikipedia/commons/e/ec/Wikipedia-logo-v2-de.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Flag_of_Turkmenistan.svg/20px-Flag_of_Turkmenistan.svg.png
200 OK (image/png)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=ext.UserBuckets%7Cext.articleFeedbackv5.startup%7Cext.flaggedRevs.advanced%7Cext.gadget.CommonsDirekt%2CWikiMiniAtlas%7Cjquery.articleFeedbackv5.verify%7Cjquery.autoEllipsis%2CcheckboxShiftClick%2CclickTracking%2CdelayedBind%2Chidpi%2ChighlightText%2Cjson%2CmakeCollapsible%2Cmw-jump%2Cplaceholder%2Csuggestions%2CtabIndex%7Cmediawiki.api%2Chidpi%2CsearchSuggest%2Cuser%7Cmediawiki.page.ready%7Cmobile.desktop%7Cmw.MwEmbedSupport.style%7Cmw.PopUpMediaTransform&skin=vector&version=20130307T025253Z&*
200 OK (text/javascript)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=ext.vector.collapsibleNav%2CcollapsibleTabs%2CeditWarning%7Cjquery.collapsibleTabs&skin=vector&version=20130307T025311Z&*
200 OK (text/javascript)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=jquery.ui.button%2Ccore%2Cdialog%2Cdraggable%2Cmouse%2Cposition%2Cresizable%2Cwidget&skin=vector&version=20130218T165324Z&*
200 OK (text/javascript)

GET http://bits.wikimedia.org/favicon/wikipedia.ico
200 OK (image/x-icon)

GET http://meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400
200 OK (text/javascript)

GET http://upload.wikimedia.org/wikipedia/commons/a/a1/Monobook-bullet-star-gray.png
200 OK (image/png)

如果我在 Internet Explorer 的“私人会话”中执行请求,则执行顺序会有所不同。

GET http://de.wikipedia.org/wiki/Facebook
200 OK (text/html)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=ext.flaggedRevs.basic%7Cext.gadget.CommonsDirekt%2CWikiMiniAtlas%7Cext.wikihiero%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmw.PopUpMediaTransform%7Cskins.vector&only=styles&skin=vector&*
200 OK (text/css)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=site&only=styles&skin=vector&*
200 OK (text/css)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=startup&only=scripts&skin=vector&*
200 OK (text/javascript)

GET http://bits.wikimedia.org/geoiplookup
200 geoiplookup (text/javascript)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Disambig-dark.svg/25px-Disambig-dark.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/06/Facebook.svg/266px-Facebook.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/ef/MarkZuckerberg.jpg/220px-MarkZuckerberg.jpg
200 OK (image/jpeg)

GET http://bits.wikimedia.org/static-1.21wmf10/skins/common/images/magnify-clip.png
200 OK (image/png)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=jquery%2Cmediawiki%2CSpinner%7Cjquery.triggerQueueCallback%2CloadingSpinner%2CmwEmbedUtil%7Cmw.MwEmbedSupport&only=scripts&skin=vector&version=20130218T165645Z
200 OK (text/javascript)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=ext.centralNotice.bannerController%7Cjquery.client%2Ccookie%2CmwExtension%7Cmediawiki.legacy.ajax%2Cwikibits%7Cmediawiki.notify%2Cutil%7Cmediawiki.page.startup%7Cwikibase.client.init&skin=vector&version=20130307T025300Z&*
200 OK (text/javascript)

GET http://meta.wikimedia.org/wiki/Special:BannerRandom?userlang=de&sitename=Wikipedia&project=wikipedia&anonymous=true&bucket=1&country=DE&slot=7
200 OK (text/javascript)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/e2/Flag_of_the_United_States_%28Pantone%29.svg/20px-Flag_of_the_United_States_%28Pantone%29.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9f/Flag_of_Indonesia.svg/18px-Flag_of_Indonesia.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Flag_of_India.svg/20px-Flag_of_India.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/f/fc/Flag_of_Mexico.svg/18px-Flag_of_Mexico.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/05/Flag_of_Brazil.svg/20px-Flag_of_Brazil.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Flag_of_the_Vatican_City.svg/13px-Flag_of_the_Vatican_City.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/5/52/Flag_of_%C3%85land.svg/20px-Flag_of_%C3%85land.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/8/87/Flag_of_American_Samoa.svg/20px-Flag_of_American_Samoa.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/3/30/Flag_of_Nauru.svg/20px-Flag_of_Nauru.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Flag_of_Guernsey.svg/18px-Flag_of_Guernsey.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Flag_of_Iceland.svg/20px-Flag_of_Iceland.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Flag_of_Monaco.svg/18px-Flag_of_Monaco.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Flag_of_Turkmenistan.svg/20px-Flag_of_Turkmenistan.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Flag_of_Gibraltar.svg/18px-Flag_of_Gibraltar.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/5/50/Flag_of_Burundi.svg/18px-Flag_of_Burundi.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Tonga.svg/18px-Flag_of_Tonga.svg.png
200 OK (image/png)

GET http://meta.wikimedia.org/wiki/Special:RecordImpression?result=hide&reason=empty&country=DE&userlang=de&project=wikipedia&db=dewiki&sitename=Wikipedia&bucket=1
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/8/84/Flag_of_Latvia.svg/20px-Flag_of_Latvia.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/Flag_of_the_People%27s_Republic_of_China.svg/20px-Flag_of_the_People%27s_Republic_of_China.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/3/3c/Flag_of_the_Faroe_Islands.svg/18px-Flag_of_the_Faroe_Islands.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9c/Flag_of_Brunei.svg/20px-Flag_of_Brunei.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/2/27/Flag_of_Moldova.svg/20px-Flag_of_Moldova.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Flag_of_the_Bahamas.svg/20px-Flag_of_the_Bahamas.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Flag_of_Afghanistan.svg/20px-Flag_of_Afghanistan.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/8/89/Flag_of_Yemen.svg/20px-Flag_of_Yemen.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Flag_of_Guinea.svg/20px-Flag_of_Guinea.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Flag_of_Canada.svg/18px-Flag_of_Canada.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/9/9c/Flag_of_Denmark.svg/20px-Flag_of_Denmark.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/2/21/Flag_of_Vietnam.svg/20px-Flag_of_Vietnam.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Flag_of_Palestine.svg/20px-Flag_of_Palestine.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/8/83/Flag_of_Cambodia.svg/20px-Flag_of_Cambodia.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Flag_of_Azerbaijan.svg/20px-Flag_of_Azerbaijan.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/4/4a/Commons-logo.svg/12px-Commons-logo.svg.png
200 OK (image/png)

GET http://bits.wikimedia.org/static-1.21wmf10/skins/vector/images/search-ltr.png?303-4
200 OK (image/png)

GET http://bits.wikimedia.org/images/wikimedia-button.png
200 OK (image/png)

GET http://bits.wikimedia.org/static-1.21wmf10/skins/common/images/poweredby_mediawiki_88x31.png
200 OK (image/png)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=skins.vector&only=scripts&skin=vector&*
200 OK (text/javascript)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=site&only=scripts&skin=vector&*
200 OK (text/javascript)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/f/f4/Flag_of_Niger.svg/20px-Flag_of_Niger.svg.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/e/ec/Wikipedia-logo-v2-de.png
200 OK (image/png)

GET http://upload.wikimedia.org/wikipedia/commons/thumb/d/db/Flag_of_French_Polynesia.svg/20px-Flag_of_French_Polynesia.svg.png
200 OK (image/png)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=ext.UserBuckets%7Cext.articleFeedbackv5.startup%7Cext.flaggedRevs.advanced%7Cext.gadget.CommonsDirekt%2CWikiMiniAtlas%7Cjquery.articleFeedbackv5.verify%7Cjquery.autoEllipsis%2CcheckboxShiftClick%2CclickTracking%2CdelayedBind%2Chidpi%2ChighlightText%2Cjson%2CmakeCollapsible%2Cmw-jump%2Cplaceholder%2Csuggestions%2CtabIndex%7Cmediawiki.api%2Chidpi%2CsearchSuggest%2Cuser%7Cmediawiki.page.ready%7Cmobile.desktop%7Cmw.MwEmbedSupport.style%7Cmw.PopUpMediaTransform&skin=vector&version=20130307T025253Z&*
200 OK (text/javascript)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=ext.vector.collapsibleNav%2CcollapsibleTabs%2CeditWarning%7Cjquery.collapsibleTabs&skin=vector&version=20130307T025311Z&*
200 OK (text/javascript)

GET http://bits.wikimedia.org/de.wikipedia.org/load.php?debug=false&lang=de&modules=jquery.ui.button%2Ccore%2Cdialog%2Cdraggable%2Cmouse%2Cposition%2Cresizable%2Cwidget&skin=vector&version=20130218T165324Z&*
200 OK (text/javascript)

GET http://meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400
200 OK (text/javascript)

GET http://upload.wikimedia.org/wikipedia/commons/a/a1/Monobook-bullet-star-gray.png
200 OK (image/png)

在比较 Selenium-2-Chrome <-> Chrome 浏览器和 Selenium-2-Firefox <-> Firefox 浏览器时,也会出现这种差异。

是否有可能使硒会话与“自然浏览”会话完全一样?

提前致谢!

PS: Sysout/Syserror 如下:

Started InternetExplorerDriver server (64-bit)
2.29.1.0
Listening on port 15656
Mrz 07, 2013 7:15:42 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Software caused connection abort: recv failed
Mrz 07, 2013 7:15:42 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
testJavaJunit4Webdriver
airdroid
Thu Mar 07 19:15:44 CET 2013
Thu Mar 07 19:15:51 CET 2013
Wiki Facebook
tearDown
Thu Mar 07 19:15:55 CET 2013
Thu Mar 07 19:16:02 CET 2013

我的图书馆是:

27.02.2013  15:54           345.048 apache-mime4j-0.6.jar
27.02.2013  15:54           242.154 bsh-1.3.0.jar
27.02.2013  15:54           324.238 cglib-nodep-2.1_3.jar
27.02.2013  15:54           232.771 commons-codec-1.6.jar
27.02.2013  15:54           575.389 commons-collections-3.2.1.jar
27.02.2013  15:54            52.543 commons-exec-1.1.jar
27.02.2013  15:54           173.587 commons-io-2.2.jar
27.02.2013  15:54           299.994 commons-jxpath-1.3.jar
27.02.2013  15:54           315.805 commons-lang3-3.1.jar
27.02.2013  15:54            60.686 commons-logging-1.1.1.jar
27.02.2013  15:54           281.014 cssparser-0.9.8.jar
27.02.2013  15:54         2.189.111 guava-14.0.jar
27.02.2013  15:54            45.024 hamcrest-core-1.3.jar
27.02.2013  15:54            53.070 hamcrest-library-1.3.jar
27.02.2013  15:54         1.230.705 htmlunit-2.11.jar
27.02.2013  15:54         1.009.889 htmlunit-core-js-2.11.jar
27.02.2013  15:54           427.022 httpclient-4.2.1.jar
27.02.2013  15:54           223.374 httpcore-4.2.1.jar
27.02.2013  15:54            26.598 httpmime-4.2.1.jar
27.02.2013  15:54           101.578 ini4j-0.5.2.jar
27.02.2013  15:54            56.533 jcommander-1.29.jar
27.02.2013  15:54           125.727 jetty-websocket-8.1.8.jar
27.02.2013  15:54         1.006.639 jna-3.4.0.jar
27.02.2013  15:54           913.435 jna-platform-3.4.0.jar
27.02.2013  15:54            37.875 json-20080701.jar
27.02.2013  15:54           245.039 junit-dep-4.11.jar
27.02.2013  15:54           124.478 nekohtml-1.9.17.jar
27.02.2013  15:54         1.106.629 netty-3.5.7.Final.jar
27.02.2013  15:54         4.060.747 operadriver-1.2.jar
27.02.2013  15:54             8.597 phantomjsdriver-1.0.1.jar
27.02.2013  15:54           450.284 protobuf-java-2.4.1.jar
27.02.2013  15:54            15.808 sac-1.3.jar
27.02.2013  15:54         3.749.497 selenium-java-2.31.0.jar
27.02.2013  15:54           278.281 serializer-2.7.1.jar
27.02.2013  15:54           813.398 testng-6.8.jar
27.02.2013  15:54         3.176.148 xalan-2.7.1.jar
27.02.2013  15:54         1.363.159 xercesImpl-2.10.0.jar
27.02.2013  15:54           220.536 xml-apis-1.4.01.jar
4

1 回答 1

0

根据系统负载、空闲连接的可用性、DNS 查找时间等,您将看到来自任何客户端的请求的不同顺序。

因此,从纯粹的“排序”角度查看请求并不是很可靠。

您没有提供任何时间戳来显示定请求的发出时间。据我们所知,所有这些请求都是在同一毫秒内发送的,如果您在浏览器中重新加载页面,您会得到不同的结果。

我不久前写的一篇文章:http: //blogs.msdn.com/b/ieinternals/archive/2011/07/18/optimal-html-head-ordering-to-avoid-parser-restarts-redownloads-and-改进性能.aspx 解释了“前瞻”解析器如何在不同浏览器和同一浏览器的不同版本之间导致不同的请求排序。

于 2013-03-13T23:12:29.567 回答