2017-10-16 7 views
0

我正在尝试使用JMeter执行负载测试,其中使用HTTP脚本记录器记录了脚本。现在我必须对多个用户执行相同的测试,因此使用包含5个用户的详细信息的.csv文件。当为5个用户配置并且假设有5个HTTP请求时运行测试脚本时,现在有一些请求失败表示如下错误: - 在使用Jmeter执行负载测试时出错

PDOException Connector.php线55: SQLSTATE [HY000] [1045]访问被拒绝的用户伪造“@ '本地主机'(使用密码:否)

in Connector.php line 55 
at PDO->__construct('mysql:host=localhost;port=3306;dbname=forge', 'forge', '', array('0', '2', '0', false, false)) in Connector.php line 55 
at Connector->createConnection('mysql:host=localhost;port=3306;dbname=forge', array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql'), array('0', '2', '0', false, false)) in MySqlConnector.php line 22 
at MySqlConnector->connect(array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 60 
at ConnectionFactory->createSingleConnection(array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql')) in ConnectionFactory.php line 49 
at ConnectionFactory->make(array('driver' => 'mysql', 'host' => 'localhost', 'port' => '3306', 'database' => 'forge', 'username' => 'forge', 'password' => '', 'charset' => 'utf8', 'collation' => 'utf8_unicode_ci', 'prefix' => '', 'timezone' => '+00:00', 'strict' => false, 'name' => 'mysql'), 'mysql') in DatabaseManager.php line 175 
at DatabaseManager->makeConnection('mysql') in DatabaseManager.php line 67 
at DatabaseManager->connection('mysql') in Model.php line 3224 
at Model::resolveConnection(null) in Model.php line 3190 
at Model->getConnection() in Model.php line 1870 
at Model->newBaseQueryBuilder() in Model.php line 1813 
at Model->newQueryWithoutScopes() in Model.php line 1432 
at Model->save() in ActivityController.php line 19 
at ActivityController::logUserActivity(object(Request), 'visited', array('url' => 'http://localhost/busnet/Source/Main/Services/public/index.php/post', 'method' => 'POST', 'requested_on' => '1508130477.865', 'responded_on' => '1508130477.8878', 'ip_address' => '127.0.0.1', 'status' => '200')) in ActivityMiddleware.php line 52 
at ActivityMiddleware->addToActivityLog(object(Request), object(JsonResponse)) in ActivityMiddleware.php line 34 
at ActivityMiddleware->handle(object(Request), object(Closure)) 
at call_user_func_array(array(object(ActivityMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AuthMiddleware.php line 74 
at AuthMiddleware->handle(object(Request), object(Closure)) 
at call_user_func_array(array(object(AuthMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CorsMiddleware.php line 26 
at CorsMiddleware->handle(object(Request), object(Closure)) 
at call_user_func_array(array(object(CorsMiddleware), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) 
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 102 
at Pipeline->then(object(Closure)) in Application.php line 1451 
at Application->sendThroughPipeline(array('App\Http\Middleware\CorsMiddleware', 'App\Http\Middleware\AuthMiddleware', 'App\Http\Middleware\ActivityMiddleware'), object(Closure)) in Application.php line 1221 
at Application->dispatch(object(Request)) in Application.php line 1161 
at Application->run(object(Request)) in index.php line 30 

这是我在记事本中的.csv

[email protected],[email protected],DATE,DESC,null,1,2,[email protected] 
[email protected],[email protected],DATE,DESC,null,3,3,[email protected] 
[email protected],[email protected],DATE,DESC,null,4,4,[email protected] 
[email protected],[email protected],DATE,DESC,null,5,5,[email protected] 
[email protected],[email protected],DATE,DESC,null,6,6,[email protected] 

和CSV数据集的配置是如下
https://i.imgur.com/zZaIP9M.png

出现误差为每个不同的请求运行即有时由4发送相同的请求出5个用户通行证但一个失败。

任何人都可以请帮我解决这个问题吗?

+0

你能告诉你的CSV,也许你有空值作为用户名,,或逗号中值:您可以通过把一切JMeter的线程组中的一个关键部分控制器下的测试呢? – user7294900

+0

@ user7294900,我在我的问题中共享了CSV文件和CSV配置文件。 –

回答