2016-03-21 30 views

cevap

0

kütüphane "iste" Bu

var http = require("http"); 
    module.exports = { 
     "Check Response Code" : function (client) { 
      var request = http.request({ 
      host: "www.google.com", 
      port: 80, 
      path: "/images/srpr/logo11w.png", 
      method: "HEAD" 
      }, function (response) { 
      client 
      .assert.equal(response.statusCode, 200, 'Check status'); 
      client.end(); 
      }).on("error", function (err) { 
      console.log(err); 
      client.end(); 
      }).end(); 
     } 
     }; 
1

Aslında Selenyum (https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/141)

kullanarak sayfanın tepki durumunu almak için henüz hiçbir yolu yoktur deneyin Ama ne yapmak kolay olabilir ithalat olduğunu, yapmak Eğer Selenyum testlerinde açmak ve cevap durum kodu doğrulamak istediğiniz web sayfasına isteğiniz 200 eşittir:

var request = require('request'); 

request('http://stackoverflow.com', function (error, response, body) { 
    browser.assert.equal(response.statusCode, 200); 
}); 
[nasıl alınır HTTP yanıt Kanununun
İlgili konular