Restart casper script on phantom crash - phantomjs

I have a script that crashes after a while. It says: PhantomJS has crashed. Please read the crash reporting guide... Is it possible to restart the script when such a crash happens? I use Windows task scheduler to run the casperjs script.
Best Regards

Related

Sanity Start compiles however localhost:3333 returns nothing

Good day all... I have been having an issue with Sanity for the past 3 days... After running sanity start on my linux vps I get the success message Content Studio successfully compiled! Go to http://localhost:3333 however the link returns nothing - it just loads indefinitely without any error message in my console. I have tried chrome, brave and firefox as well as turning third-party cookies on - I'd appreciate any assistance or ideas as to what the problem may be
If simply re-starting Sanity Studio doesn't work, you might check if there's still a thread running after exiting studio, and if so, terminate the thread and start Studio again.
A simple CLI command that kills the process running on port 3333 is:
lsof -t -i tcp:3333 | xargs kill
I've experienced similar issues with Studio being unresponsive after inadvertently leaving it running when my MBP goes to sleep. When I return, it appears Sanity is still running in the terminal, but there is no browser response and no errors thrown in the terminal.
More resources that might help:
Finding the PID of the process using a specific port?
Find (and kill) process locking port 3000 on Mac

Is there a way to detach running remote ssh script in PyCharm?

I use remote shh interpreter in PyCharm regularly, using the configured deployment. I often run remote programs from PyCharm GUI (using F5 key), that takes hours to complete (e.g. training a deep net). This unfortunately means that any network outage causes running script to exit and I have to run the script over again. Is there a way to detach the running script so it keeps running? In the sense similar to what screen or nohup is doing? I know I can run it in screen manually via ssh, but it is a bit inconvenient.
Ok. I found out that this feature is not implemented yet. There is however a suggested workaround

Reboot computer during automation testing

I'm using SpecFlow with NUnit. Some scenarios require reboot computer in the middle of their running. I did not find any approaches to do it for specified technologies. Is there someone who can help me?
Call a command line command from your code to reboot the system should do it, but it would also kill the test run on that machine, so you would also need to schedule the test run to restart after the reboot.
Windows reboot command:
shutdown /r /t 0
As advised Niels, you can split your tests. And, after test is finished, save data on hard drive, then in next test suite read that data.

when am running my testscript through selenium if screen get locks my testcases geting failed

in my organiztaion automaticaly pc screen wil get lock from a server if idle when am running my scripts also pc getting lock and also if i switch to some other browser when running a scripts my testcases getting failed.
But Even a in a Eclipse IDE my test suite will be running as usual dono how to run my automation suite please anybody have a idea to deal with it.let me know. thank u in advance**

DalekJS: Chrome Browser - Close process after running tests

I'm running my DalekJS tests (0.0.8) successfully in PhantomJS and also in Chromium on a Linux system.
But i have a small problem with Chromium.
After running the tests the dalek process will not quit. I can only end it with Ctrl+C or by Closing Chrome manually.
I would like to implement an automatic testing system. Therefore it would be nice if the test process would quit like with phantom or with the saucelabs driver.
Is there something i can do about that?
Edit: From the verbose log i see that "dalek-browser-chrome: Shutting down ChromeDriver" is emitted. So the kill code somehow does not work on my Debian 7.
Thanks!
I helped myself with a quick and dirty fix.
It looks like the code does not recognize all chrome processes to kill. Many of the pids and processIDs that are checked are 'undefined'. Maybe it has to do with the fact that i use Chromium on my Debian 7.4 x86 system.
The dirty fix is to add the following code into the index.js of the dalek-browser-chrome module at line 599 in the function _checkProcesses() just under the comment "//kill leftover chrome browser processes":
if (process.platform != 'win32'){
cp.exec('pkill -f /usr/lib/chrom');
}
Of course this will kill all Chromium instances. Not only the ones spawned by DalekJS. But for my usecase this is sufficient for now.