[Recreator Required] Could not establish connection. Receiving end does not exist

Two seemingly random errors appeared today, several times:

Cannot read property ‘tab’ of undefined’

And

Could not establish connection. Receiving end does not exist.

However, I believe I may have fixed it/worked around it in my scenario.

My scenario

I am opening URLs from a CSV file in a new tab. Today, Kantu would error somewhere between the second and ninth URL.

Over the weekend the website changed its subdomain name and is now redirecting the old name to the new.

I searched/replaced the old name to the new in the CSV file and so far, no more errors.

I hope this may be of help to @admin and others.

I just ran another CSV file and forgot to search/replace the subdomain name - same thing happened. Swapped-out the old subdomain name for the new - working fine.

I’m guessing there’s some kind of disconnect happening between Kantu and the browser tab when a redirect occurs.

Am also getting same issue with error Could not establish connection. Receiving end does not exist..

@admin could you please help us on this ?

Please refer the log below. Am running that UI test case and suddenly its frozen with Error as could not establish the connection.

[info]
Executing: | click | id=IDToken2 | |
[info]
Executing: | type | id=IDToken2 | tomtom123 |
[info]
Executing: | click | id=loginButton | |
[info]
Executing: | waitForPageToLoad | | |
[error]
Could not establish connection. Receiving end does not exist.
[info]
Macro failed (Runtime 1.29s)

A test macro or a screencast of this issue would be helpful for us, so we can recreate the issue on the test systems.

I am getting the same error.
My belief is this is because of a slow loading Web App.
Instead of timing out on a clickandwait, Kantu is proceeding to the step in the macro.
In my case it trying to click a check box.

I get one of three errors when the page is loading slowly.

  • Lost connection.
  • Could not establish connection
  • Element not found

I used to only get the “Element not found”, but I increased the Page timeout and added a pause after the clickandwait.

My suggestion is as follows: this error is related to macro timeout


Error itself is random, as you can see in my log it triggers at least 3 different errors:

  1. [error] Could not establish connection. Receiving end does not exist.
  2. [error] Error #101: Kantu is not connected to a browser tab
  3. [error] macro ‘any_random_macro’ timeout 120s (change the value in the settings if needed)
    Error depends on what next action is coming when timeout happens.

How to reproduce.

  1. Set a macro with several included cases (i have a testsuite with 6 macros in it)
  2. each macro has page reloads and needs to wait elements to appear on page (i bet it happens when waiting is in charge)
  3. in settings of Kantu set the limited time for macro run, that is definitely more than needed for macro to pass (i have 2 minutes limit while full suite goes within 1.5 minutes)
  4. Run the suite, wait until it passes
  5. immediately run another time the same suite, wait it to pass
  6. Repeat several times to get different errors triggered in console when the timeout of 1-st run is over (than will 2-nd run timeout over, resulting in an error and so on)

I assume we have another hidden issue related: sometimes scripts are launched but not terminated. So sometimes when i get to some specific page, it gets clicked a submit button immediately, while it is not yet come to it by execution. I hope you will reproduce this problem too, while you will be testing it with steps above.

Please let me know if you reproduced this.
Thanks in advance.

hmm, another guess is wait after page reload, seems it’s most often fail place:


I am not sure what happens underground the scripts, but peculiarities of this part of my macro are:

  1. click triggers redirect to blank page
  2. and then second domain is opened with page reload, where “wait…” should be in charge.
    I would be happy if i helped at least to reproduce comething. If that is needed: I am ready to spend some time to try to reproduce on external sites.

@admin @TechSupport do u guys have any update on both the issues ?

The issue here is to recreate the problem, but we are working on finding a good test case. If anyone has a macro that we can run “here”, please post it in this thread.

A general workaround for any web page timing or connection issue with Selenium IDE commands is to use the RPA commands XClick (image) and XType (image) for this section of the test case. These commands work visually, and thus no communication with the browser is required.