Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's closing for no reason #27

Open
mateusgalasso opened this issue May 3, 2021 · 40 comments
Open

It's closing for no reason #27

mateusgalasso opened this issue May 3, 2021 · 40 comments

Comments

@mateusgalasso
Copy link

I just run php artisan magic
image

The browser open and close
My test:
image

@mateusjatenee
Copy link
Contributor

Hey! Can you check which version are you running under composer.lock?

@mateusgalasso
Copy link
Author

Hey! Can you check which version are you running under composer.lock?

0.3.0

@mateusgalasso
Copy link
Author

Hey! Can you check which version are you running under composer.lock?

"magic-test/magic-test-laravel": "^0.3.0",

@solracnet
Copy link

When this happens to me (with Java and Selenium) it is because of the different version between the browser and the driver.

@mateusjatenee
Copy link
Contributor

@stonkeep hmmm. Which version of Chrome are you running?

@fs-csmith
Copy link

I am having the same issue, when running magic, the browser appears for a couple hundred milliseconds and immediately disappears. If I insert a few assertions, the browser will stay open long enough to run the assertions, but as soon as it hits the magic function, the browser disappears.

I am running this in a Laragon (4.0.16.190914) environment on Windows.
Apache 2.4.47 win64 VS16
PHP 7.4.19 VC15
MagicTest 0.14
Laravel 8.38.0
Chrome Driver 90.0.4430.24
Chrome 90.0.4430.212

Do you have any suggestions for where I can work to start troubleshooting this?
Any assistance would be greatly appreciated.

@Sanoj32
Copy link

Sanoj32 commented May 30, 2021

Any updates for this issue? I am experiencing the same thing.

@mateusgalasso
Copy link
Author

@stonkeep hmmm. Which version of Chrome are you running?

The Last one

@mateusjatenee
Copy link
Contributor

@fs-csmith please update your Magic Test dependency

@mateusjatenee
Copy link
Contributor

Any updates for this issue? I am experiencing the same thing.

Please make sure you're on the latest version of the package. What do you see on composer list?

@mateusjatenee
Copy link
Contributor

@stonkeep hmmm. Which version of Chrome are you running?

The Last one

I need to know the exact version please

@fs-csmith
Copy link

@fs-csmith please update your Magic Test dependency

Thank you for your reply. To the best of my knowledge I am on the most current versions. Chrome recently updated so that version has changed since my last post. Currently, I am running:

Laragon (4.0.16.190914) environment on Windows.
Apache 2.4.47 win64 VS16
PHP 7.4.19 VC15
Laravel 8.38.0
Chrome Driver 90.0.4430.24
Chrome 91.0.4472.77
MagicTest 0.14

To eliminate the Laragon environment, I tried running on php artisan serve and got the same behavior. I appreciate your help.

@fs-csmith
Copy link

fs-csmith commented Jun 4, 2021

To be more clear when running magic in my terminal, I get a message DevTools listening on ws://.... followed by a handful of errors

[10:25:53.854] USB: usb_device_handle_win.cc:1058 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)

I initially ignored the errors as they seemed to be issues with the chromedriver that just needed to be cleaned up by them, but perhaps it is applicable to this issue?

And, I get the error even when no devices are connected.

@mateusjatenee
Copy link
Contributor

@fs-csmith I got access to a Windows computer and I'll try to reproduce your bug. Thanks for following the thread!

@Super-Saiyan-Mohamed
Copy link

Hello @mateusjatenee ,

Is there any update on this issue?

Thank You.

@mateusjatenee
Copy link
Contributor

Hello @mateusjatenee ,

Is there any update on this issue?

Thank You.

Hey Mohamed,

I've tried it on Windows and it worked fine. My time is a bit tight to pursue this further on Windows since I don't use it, so any help is very much appreciated.

@DanielvdSpoel
Copy link

@mateusjatenee I have the same issue, I just see the chrome window briefly and then it closes.
Chrome version is 93.0.4577.82 (Official Build) (64-bit). Version of magic test is 0.14

@mateusjatenee
Copy link
Contributor

@mateusjatenee I have the same issue, I just see the chrome window briefly and then it closes.

Chrome version is 93.0.4577.82 (Official Build) (64-bit). Version of magic test is 0.14

Thanks Daniel. Are you on Windows?

@DanielvdSpoel
Copy link

@mateusjatenee I have the same issue, I just see the chrome window briefly and then it closes.
Chrome version is 93.0.4577.82 (Official Build) (64-bit). Version of magic test is 0.14

Thanks Daniel. Are you on Windows?

Yes I am on windows, fresh laravel application. It opens, i see the default laravel welcome page and then it closes. Feels like it doesn't 'detect' the magic call

@DanielvdSpoel
Copy link

DanielvdSpoel commented Sep 17, 2021

I have an example repository that didn't work for me and a colleague. Maby it's handy for you debugging: https://github.com/DanielvdSpoel/magictesten

@khairu-aqsara
Copy link

is there any update on this? I having same issue here, the browser suddenly closed, I using same Chrome driver version with my installed Chrome 95.0.4638.54 and ChromeDriver 95.0.4638.17 it just a bit different with build number

@DanielvdSpoel
Copy link

@mateusjatenee do you have a update on this?

@mateusgalasso
Copy link
Author

I haven't tested it again

@mateusjatenee
Copy link
Contributor

@stonkeep @DanielvdSpoel Sorry, I don't have a Windows machine to test. I will ask a few colleagues to maybe reproduce the error and help me figure out what it is.

@huszerldani
Copy link

Same problem here. I am using Laragon and Laravel 8 on Windows. I tried an older chromedriver... When i start magic chrome appears and disappears two times

@ITMobilityControl
Copy link
Contributor

This is probably because Windows doesn't support TTY. I think this manages the terminal connections. So when the magic test starts it tries to create a new Psy Shell (to ask for input). But since there is no TTY, it just skips this part and closes the browser (because it thinks it has completed the magic test steps).

This problem only exists on Windows itself (with for example Laragon). If you try this via WSL (Windows Subsystem for Linux), it'll probably work since that does have TTY support.

I've tried some ways to make this work with Windows/Laragon but I just can't get the MagicTestManager run function to 'talk' to the CMDER that Laragon uses.

TLDR;
Windows/Laragon does not support TTY which does not boot the shell to ask for input.

@A805532
Copy link

A805532 commented Apr 6, 2023

Hello @mateusjatenee ,
It is not working for me also. I have Windows 10 Enterprise machine. I my case browser is closing automatically.
I checked it is working fine in Linux machine, and it is a very good innovation. Can you help me to setup magic-test in Windows 10 machine?

@ITMobilityControl
Copy link
Contributor

@prakashhalder what applications are you using? For example Laragon or WSL (Windows Subsystem for Linux)?

@A805532
Copy link

A805532 commented Apr 6, 2023

@prakashhalder what applications are you using? For example Laragon or WSL (Windows Subsystem for Linux)?

I am using xampp

@ITMobilityControl
Copy link
Contributor

I am using xampp

Is this message popping up in your console by any chance?
"TTY mode is not supported on Windows platform."

@A805532
Copy link

A805532 commented Apr 6, 2023

I am using xampp

Is this message popping up in your console by any chance? "TTY mode is not supported on Windows platform."

Yes, I am getting "Warning: TTY mode is not supported on Windows platform."
How can I solve this problem

@ITMobilityControl
Copy link
Contributor

I am using xampp

Is this message popping up in your console by any chance? "TTY mode is not supported on Windows platform."

Yes, I am getting "Warning: TTY mode is not supported on Windows platform." How can I solve this problem

See my comment:

This is probably because Windows doesn't support TTY. I think this manages the terminal connections. So when the magic test starts it tries to create a new Psy Shell (to ask for input). But since there is no TTY, it just skips this part and closes the browser (because it thinks it has completed the magic test steps).

This problem only exists on Windows itself (with for example Laragon). If you try this via WSL (Windows Subsystem for Linux), it'll probably work since that does have TTY support.

I've tried some ways to make this work with Windows/Laragon but I just can't get the MagicTestManager run function to 'talk' to the CMDER that Laragon uses.

TLDR;
Windows/Laragon does not support TTY which does not boot the shell to ask for input.

You can't fix this problem on Windows, because it simply does not support it. Only way you can get it to work on Windows is by installing WSL. See: https://learn.microsoft.com/en-us/windows/wsl/install

@A805532
Copy link

A805532 commented Apr 6, 2023

I am using xampp

Is this message popping up in your console by any chance? "TTY mode is not supported on Windows platform."

Yes, I am getting "Warning: TTY mode is not supported on Windows platform." How can I solve this problem

Still I am unable using WSl, I am getting error like
Facebook\WebDriver\Exception\UnknownErrorException: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /snap/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

@ITMobilityControl
Copy link
Contributor

This is a whole other error. You can try a few things:

  1. Remove the current chrome drivers from the Laravel dusk folder in vendor.
  2. Add the --disable-dev-shm-usage option.
  3. Google around and see what fixes it for you :)

@A805532
Copy link

A805532 commented Apr 7, 2023

This is a whole other error. You can try a few things:

1. Remove the current chrome drivers from the Laravel dusk folder in vendor.

2. Add the --disable-dev-shm-usage option.

3. Google around and see what fixes it for you :)

Thanks for your response. Those steps which you have mentioned working well, all issues have gone. But we are getting blank chrom browser, no data. I am using docker.
magic

Can you help me regarding this?

@ITMobilityControl
Copy link
Contributor

Have you followed the installation steps for magic tests?
Something like:

    public function testBasicExample()
    {
        $this->browse(function (Browser $browser) {
            $browser->visit('/')
                    ->magic();
        });
    }

If this is the case, please share more information on what you are trying to test and with what code.

@A805532
Copy link

A805532 commented Apr 12, 2023

Have you followed the installation steps for magic tests? Something like:

    public function testBasicExample()
    {
        $this->browse(function (Browser $browser) {
            $browser->visit('/')
                    ->magic();
        });
    }

If this is the case, please share more information on what you are trying to test and with what code.

Hello,
Thanks for your quick response. Still I am facing issue,
I have followed the steps which were mentioned in the document. It was working fine Linux machine but issue in WSL, I have also adjust the setting which you have mentioned in this discussion, still I am getting blank chrom browser. I am attaching all the information with this response. Please once more if is there any solution.
magic-5
magic-4
magic-3
magic-2

magic-1

@ITMobilityControl
Copy link
Contributor

@prakashhalder sadly I cannot help you further without debugging the project myself. I would recommend diving into the magic test package and trying to find where it stops or doesn't give any more output.

@mateusjatenee
Copy link
Contributor

@ITMobilityControl Appreciate your help here. 🙏🏻

I'll have access to a Windows machine for a few days and I'll try to debug this. It's really hard since it isn't reproducible in Linux/Mac, and apparently doesn't happen in WSL.

@A805532
Copy link

A805532 commented Jun 22, 2023

@ITMobilityControl Appreciate your help here. 🙏🏻

I'll have access to a Windows machine for a few days and I'll try to debug this. It's really hard since it isn't reproducible in Linux/Mac, and apparently doesn't happen in WSL.

@ITMobilityControl
Is there any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests