Skip to main content

Posts

Showing posts with the label chromedriver

Headless Miracles: Chromedriver Headless VS Chromdriver

You may have heard that we are running the cases in the headless mode so that we could accelerate the execution of the test cases.  So is this true all the time? In this post, I have a little test to compare the headless mode in Chromedriver with version 2.33 and Chromedriver. The tests were run in Windows. I am using Capybara , I have around 200 test cases written in Cucumber . Tests are running parallel with 15 execution lines. This execution is controlled by tags so we can get the execution time when a tag finished. With this way, we can compare the tag specific time differences and the total time difference. I am using the following Chromedriver instances written in env.rb  file in the project. TAGS Chrome Headless DIFF signup 90.0009999275 70.003000021 22.22% login 100.000999928 80.003000021 20.00% basket_a 120.000999928 120.003000021 0.00% order_d 160.001999855 150.003999949 6.25%

Using ChromeOptions for Capybara: Disable Images and More

Chromedriver lets us set preferences via capabilities when it is initiated by Webdriver. These preferences can be used for specific purposes for example disabling images can reduce network needs and fasten the test runs; and disabling popups can make your cases more stable by reducing non-deterministic cases. In this post I want to explain how to use these feature of Chromedriver for Capybara with Ruby, you can also apply the same method for other languages with their bindings. Sometimes bandwidth is crucial if you have parallel pipelines for test runs. Think that you have 10 parallel pipes and very pipeline consume bandwidth to complete its tasks, the most heavy part of website generally images. If we disable the images we can fasten the overall test runs. To disable the images you should set the images option to 2 in preferences. For Capybara you can disable the images by following Chrome instance: Sometimes you need to disable popups which intermittently occurs and make

Change Default Timeout and Wait Time of Capybara

One of the biggest challenge for automation is handling timeout problem. Most of the time, timeout is 60 seconds but it may sometimes not enough if you have badly designed asynchronous calls or the third party ajax calls. This makes handling timeout more complex. set large enough to tolerate network related problems. For Selenium based automation frameworks, like Capybara, default Webdriver timeout is set to Net::ReadTimeout (Net::ReadTimeout) Changing ReadTimeout If you have timeout problem for Capybara, it gives an error like above. This means that the page is not fully loaded in given timeout period. Even you can see that page is loaded correctly but webdriver wait until the Ajax calls finish. class BufferedIO #:nodoc: internal use only def initialize (io) @io = io @read_timeout = 60 @continue_timeout = nil @debug_output = nil @rbuf = '' end . . . . . def rbuf_fill beg

Confusion of Using Selenium for Performance Testing

Time to time, I see some questions about integration test automation script to performance testing tool on Stackoverflow . There is a confusion about performance testing and test automation for whom newly started performance testing after doing some test automation. It is demanded that they have some automation code and want to use these scripts for performance testing to simulate user behaviour. Theoretically it seems a very good idea that tons of users are performing some cases and you are capturing the response time and finding bottle neck in terms of client side. However this is not applicable in practice because there are lots of obstacle to handle. The followings outline the obstacles and misunderstandings you will face, for the idea. I can open some browsers and simulate real user behaviour Automation scripts run over a browser, for web project. Most of the application are becoming as web app. For GUI based application what the hack test automation will have a role on pe