Page_load time out is not working - watir

I am having this error after 60 secs of time since pages hasn't completed it's loading in 60 secs
Code I executed
b.element(:id,'Finish').click
Following error was thrown after 60 secs
C:/Ruby23/lib/ruby/2.3.0/net/protocol.rb:158:in `rbuf_fill': Net::ReadTimeout (Net::ReadTimeout)
from C:/Ruby23/lib/ruby/2.3.0/net/protocol.rb:136:in `readuntil'
from C:/Ruby23/lib/ruby/2.3.0/net/protocol.rb:146:in `readline'
from C:/Ruby23/lib/ruby/2.3.0/net/http/response.rb:40:in `read_status_line'
from C:/Ruby23/lib/ruby/2.3.0/net/http/response.rb:29:in `read_new'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1437:in `block in transport_request'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1434:in `catch'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1434:in `transport_request'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1407:in `request'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1400:in `block in request'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:853:in `start'
from C:/Ruby23/lib/ruby/2.3.0/net/http.rb:1398:in `request'
So I have included this in my program
client = Selenium::WebDriver::Remote::Http::Default.new
client.read_timeout = 120 # seconds
b=Watir::Browser.new :firefox, desired_capabilities: caps,profile: "default", http_client: client
But still it's working,
And then I included this code
browser.driver.manage.timeouts.page_load = 180
NO matter whatever I do, it always fails after 60 secs, Why is it so?
I have placed this question in watir-general, but no answer so far.

Related

Problems configuring LivyOperator in Airflow

For LivyOperator we set the following parameters:
polling_interval=60
retries_num_timeout=100
We set it up according to this documentation: https://airflow.apache.org/docs/apache-airflow-providers-apache-livy/stable/_api/airflow/providers/apache/livy/operators/livy/index.html
But, in this configuration after 100 * 60 seconds = 6000 seconds = 1 hour 40 minutes Livy-session is interrupted, operator becomes failed, loading is interrupted. Is there any way to resove such inconsistency on Airflow/Livy side?

Laravel-Excel keeps browser busy for 140 seconds after completion of import: how do I correct it?

Using the import to models option, I am importing an XLS file with about 15,000 rows.
With the microtime_float function, the script times and echos out how long it takes. At 29.6 secs, this happens, showing it took less than 30 seconds. At that time, I can see the database has all 15k+ records as expected, no issues there.
Problem is, the browser is kept busy and at 1 min 22 secs, 1 min 55 secs and 2 min 26 secs it prompts me to either wait or kill the process. I keep clicking wait and finally it ends at 2 mins 49 secs.
This is a terrible user experience, how can I cut off this extra wait time?
It's a very basic setup: the route calls importcontroller#import with http get and the code is as follows:
public function import()
{
ini_set('memory_limit', '1024M');
$start = $this->microtime_float();
Excel::import(new myImport, 'myfile.xls' , null, \Maatwebsite\Excel\Excel::XLS);
$end = $this->microtime_float();
$t = $end - $start;
return "Time: $t";
}
The class uses certain concerns as follows:
class myImport implements ToModel, WithBatchInserts, WithChunkReading, WithStartRow

rampUser method is getting stuck in gatling 3.3

I am having issues using rampUser() method in my gatling script. The request is getting stuck after the following entry which had passed half way through.
Version : 3.3
================================================================================
2019-12-18 09:51:44 45s elapsed
---- Requests ------------------------------------------------------------------
> Global (OK=2 KO=0 )
> graphql / request_0 (OK=1 KO=0 )
> rest / request_0 (OK=1 KO=0 )
---- xxxSimulation ---------------------------------------------------
[##################################### ] 50%
waiting: 1 / active: 0 / done: 1
================================================================================
I am seeing the following in the log which gets repeated for ever and the log size increases
09:35:46.495 [GatlingSystem-akka.actor.default-dispatcher-2] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Injecting 0 users in scenario xxSimulation, continue=true
09:35:47.494 [GatlingSystem-akka.actor.default-dispatcher-6] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Injecting 0 users in scenario xxSimulation, continue=true
The above issue is happening only with rampUser and not happening with
atOnceUsers()
rampUsersPerSec()
rampConcurrentUsers()
constantConcurrentUsers()
constantUsersPerSec()
incrementUsersPerSec()
Is there a way to mimic rampUser() in some other way or is there a solution for this.
My code is very minimal
setUp(
scenarioBuilder.inject(
rampUsers(2).during(1 minutes)
)
).protocols(protocolBuilder)
I am stuck with this for some time and my earlier post with more information can be found here
Can any of the gatling experts help me on this?
Thanks for looking into it.
It seems you have slightly incorrect syntax for a rampUsers. You should try remove a . before during.
I have in my own script this code and it works fine:
setUp(userScenario.inject(
// atOnceUsers(4),
rampUsers(24) during (1 seconds))
).protocols(httpProtocol)
Also, in Gatling documentation example is also without a dot Open model:
scn.inject(
nothingFor(4 seconds), // 1
atOnceUsers(10), // 2
rampUsers(10) during (5 seconds), // HERE
constantUsersPerSec(20) during (15 seconds), // 4
constantUsersPerSec(20) during (15 seconds) randomized, // 5
rampUsersPerSec(10) to 20 during (10 minutes), // 6
rampUsersPerSec(10) to 20 during (10 minutes) randomized, // 7
heavisideUsers(1000) during (20 seconds) // 8
).protocols(httpProtocol)
)
My guess is that syntax can't be parsed, so instead 0 is substituted. (Here is example of rounding. Not applicable, but as reference: gatling-user-injection-constantuserspersec)
Also, you mentioned that others method work, could you paste working code as well?

file_field().set crashing watir

When using file_field().set, my watir script crahes with a huge stack trace. I'm running on Windows 7 64, using Watir through cucumber. I am using IE10 as my browser.
Here is the beginning of it:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:294:
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]
And here is the end:
c:/Code/trunk/source/cucumber/webapp/lib/cucumber/lcpic/features/step_definition/newbusiness.rb:465:in `block in <top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-4.0.1/lib/watir-classic/element_extensions.rb:19:in `method_missing'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-4.0.1/lib/watir-classic/dialogs/file_field.rb:34:in `set'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-4.0.1/lib/watir-classic/dialogs/file_field.rb:48:in `set_file_name'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:214:in `text_field'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:224:in `wait_until_present'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/wait_helper.rb:15:in `wait_until'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:224:in `block in wait_until_present'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:155:in `present?'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/window.rb:138:in `exists?'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/window.rb:90:in `exists?'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/window.rb:48:in `hwnd'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_3127.0.0.1 - - [18/Jul/2014 10:11:33] "GET /status?_=1405692621800 HTTP/1.1" 200 15 0.0020
2/functions.rb:140:in `window_hwnd'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:294:in `find_hwnd'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rautomation-0.13.0/lib/rautomation/adapter/win_32/functions.rb:294:in `enum_windows'

Poltergeist current_url command is returning page_info hash instead of a URL

Problem
I have an rspec feature test that is using capybara/poltergeist with :js => true and is doing something really simple:
visit borrow_path
click_on "Get Started"
page.should have_content "Create Your Account"
Clicking Get Started takes the user to our sign up page and then poltergeist raises a Timeout Error on the page.should have_content assertion, despite the screenshot of the page confirming that the content is, in fact, on the page.
The error is:
Failure/Error: page.should have_content "Create Your Account"
Capybara::Poltergeist::TimeoutError:
Timed out waiting for response to {"name":"find","args":["xpath","/html"]}. It's possible that this happened because something took a very long time (for example a page load was slow). If so, setting the Poltergeist :timeout option to a higher value will help (see the docs for details). If increasing the timeout does not help, this is probably a bug in Poltergeist - please report it to the issue tracker.
# ./spec/features/borrower/signup_spec
We've tried upping the timeout to 5 minutes, still the same error.
This doesn't happen consistently, every few runs the test will pass.
Details
With that in mind, I turned :debug on in our setup as follows:
Capybara.register_driver :poltergeist do |app|
# use 'page.driver.debug' as a js debugger
# see https://github.com/jonleighton/poltergeist/tree/v1.5.0#remote-debugging-experimental
Capybara::Poltergeist::Driver.new(app, :timeout => 300, :inspector => true, :debug => false, :window_size => [1280, 1400], :js_errors => true)
end
and re-ran the tests. The failed spec's output looks as follows:
{"name"=>"current_url", "args"=>[]}
{"response"=>{"page_id"=>126, "ids"=>[0]}}
An error occurred in an after hook
URI::InvalidURIError: bad URI(is not URI?): {"page_id"=>126, "ids"=>[0]}
occurred at /home/rof/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/uri/common.rb:176:in `split'
{"name"=>"current_url", "args"=>[]}
{"response"=>"http://127.0.0.1:49891/users/sign_up?m=borrower"}
{"name"=>"current_url", "args"=>[]}
{"response"=>"http://127.0.0.1:49891/users/sign_up?m=borrower"}
{"name"=>"body", "args"=>[]}
{"response"=>"http://127.0.0.1:49891/users/sign_up?m=borrower"}
I can't find any hints as to why a call to current_url is returning the page_id hash instead of a URL, but this actually breaks all subsequent feature tests and causes find to always return true:
{"name"=>"find", "args"=>["xpath","/html"]}
{"response"=>"true"}
Which causes this exception on all subsequent tests (whether they're tagged :js => true or not):
Failure/Error: Unable to find matching line from backtrace
NoMethodError:
undefined method `[]' for true:TrueClass
# /home/rof/cache/bundler/ruby/1.9.1/gems/poltergeist-1.5.0/lib/capybara/poltergeist/browser.rb:54:in `find'
# /home/rof/cache/bundler/ruby/1.9.1/gems/poltergeist-1.5.0/lib/capybara/poltergeist/driver.rb:114:in `find'
# /home/rof/cache/bundler/ruby/1.9.1/gems/poltergeist-1.5.0/lib/capybara/poltergeist/driver.rb:118:in `find_xpath'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/node/finders.rb:154:in `block in resolve_query'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/node/base.rb:77:in `synchronize'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/node/finders.rb:150:in `resolve_query'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/node/finders.rb:129:in `all'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/node/matchers.rb:107:in `block in assert_no_selector'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/node/base.rb:81:in `synchronize'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/node/matchers.rb:106:in `assert_no_selector'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/session.rb:396:in `block (2 levels) in <class:Session>'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/session.rb:81:in `reset!'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara.rb:253:in `block in reset_sessions!'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara.rb:253:in `each'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara.rb:253:in `reset_sessions!'
# /home/rof/cache/bundler/ruby/1.9.1/gems/capybara-2.2.1/lib/capybara/rspec.rb:20:in `block (2 levels) in <top (required)>'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:471:in `instance_eval'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:471:in `instance_eval_with_rescue'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:242:in `instance_eval_with_rescue'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb:31:in `run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb:85:in `block in run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb:85:in `each'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb:85:in `run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb:446:in `run_hook'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:350:in `run_after_each_hooks'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:298:in `run_after_each'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:120:in `block in run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-rails-2.14.0/lib/rspec/rails/example/controller_example_group.rb:158:in `call'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-rails-2.14.0/lib/rspec/rails/example/controller_example_group.rb:158:in `block (2 levels) in <module:ControllerExampleGroup>'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/extensions/instance_eval_with_args.rb:16:in `instance_exec'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/extensions/instance_eval_with_args.rb:16:in `instance_eval_with_args'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:247:in `instance_eval_with_args'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb:106:in `block (2 levels) in run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb:104:in `call'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb:104:in `run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/hooks.rb:446:in `run_hook'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:340:in `run_around_each_hooks'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:256:in `with_around_each_hooks'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example.rb:111:in `run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:390:in `block in run_examples'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:386:in `map'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:386:in `run_examples'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/example_group.rb:371:in `run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:28:in `map'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:28:in `block in run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/reporter.rb:58:in `report'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/command_line.rb:25:in `run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:80:in `run'
# /home/rof/cache/bundler/ruby/1.9.1/gems/rspec-core-2.14.7/lib/rspec/core/runner.rb:17:in `block in autorun'
Any idea what's going on?

Resources