使用Gherkin,Specflow和Selenium进行平行测试

时间:2015-11-10 15:31:50

标签: c# selenium mstest specflow gherkin

我正在使用Gherkin场景,Specflow步骤和Selenium远程webdriver为Asp.Net MVC项目设置自动验收测试。目的是使用selenium服务器中心在多个节点上并行运行Jenkins的测试。

目前我正试图让他们在当地并行运行并遇到一些困难。是否可以与Gherkin / Specflow设置并行运行这些测试,或者Gherkin场景是否重复使用相同的Specflow步骤以使类似的场景不能同时运行它们?

如果不是不可能的话,究竟能做到什么?如果不可能还有什么办法可以加快测试过程呢?

2 个答案:

答案 0 :(得分:0)

无关
  

Gherkin场景为类似场景重复使用相同的Specflow步骤这一事实使得无法同时运行它们

完全可以运行user www-data; worker_processes 4; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { ## # Basic Settings ## server { client_max_body_size 100M; } sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; server_names_hash_bucket_size 64; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; # gzip_vary on; # gzip_proxied any; # gzip_comp_level 6; # gzip_buffers 16 8k; # gzip_http_version 1.1; # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; ## # nginx-naxsi config ## # Uncomment it if you installed nginx-naxsi ## #include /etc/nginx/naxsi_core.rules; ## # nginx-passenger config ## # Uncomment it if you installed nginx-passenger ## #passenger_root /usr; #passenger_ruby /usr/bin/ruby; proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } #mail { # # See sample authentication script at: # # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript # # # auth_http localhost/auth.php; # # pop3_capabilities "TOP" "USER"; # # imap_capabilities "IMAP4rev1" "UIDPLUS"; # # server { # listen localhost:110; # protocol pop3; # proxy on; # } # # server { # listen localhost:143; # protocol imap; # proxy on; # } #} 个案in parallel。据我所知,挂起测试的最大数量不应超过 5 。但是我为此目的使用了自定义工具,在单独的线程中生成每个测试,使用TPL很容易实现。

答案 1 :(得分:0)

您需要使用selenium网格来执行此操作,如果可以的话,我建议将网格放在另一台计算机或虚拟机上。

您可以使用1)任务并行库和2)动态对象类的组合在多个浏览器上运行相同的测试。我在这里写了http://blog.dmbcllc.com/running-selenium-in-parallel-with-any-net-unit-testing-tool/

的具体细节
相关问题