How to start a foreground process even if its parent is a Windows service or daemon process? - windows

I have a parent process which stared as a service. This service needs to start RobotFramework.
If Robotframework did not start foreground, Selenium test library will complain when starting the browser (Chrome) and fail.
for example, i have a testcase like:
test.txt
***setting***
Library SeleniumLibrary
***test case***
open_browser
Open Browser www.stackflow.com chrome
i run test.txt from a windows service process, by invoke command like
pybot test.txt
since pybot`s parent is a service ,so, pybot also become a backgroud process, and this result selenum complain open brower failed
What should I do to make RobotFramework start on the foreground? Or is there another way to make Selenium work properly?

Related

Starting screen sessions and running commands in it

I'm trying to write a bash script that should be capable of starting a java application in a separate screen. (detached terminal)
what I want to achieve:
Start a named Screen session
Run a java command in it
The session should not be attached
The java command I want to run is a jar application. This application will be running until it is manually stopped, that's why I want the screen to be detached.

Using VMRUN to execute selenium process in Ubuntu VM without XVFB

I'm using vmrun.exe from VMware Workstation to start an Ubuntu 16 desktop VM and launch a Java selenium Firefox process in it. I can start and launch the script however I would like the selenium process to be visible in case a user would like to monitor it. It gives the following error when trying to launch firefox with a visible GUI.
org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/home/vmdops/firefox/firefox) on port 7055; process output follows:
Error: GDK_BACKEND does not match available displays
The following bash script is used to launch the process
java -jar seleniumProcess.jar
I can execute the process headless with XVFB and run the selenium process in memory however then I cannot view the process running visually.
/usr/bin/Xvfb :1 & export DISPLAY=:1
java -jar seleniumProcess.jar
What is the proper terminology to explain why the firefox browser cannot be displayed?
Is there anyway to launch the selenium process from VMRUN that allows the firefox browser to display normally?
Thanks
Conteh
I was able to resolve the issue adding -interactive to the end of the command
vmrun -T player -gu vmdops -gp xxxx runScriptInGuest "C:\VMDOPS2\VMDOPS2.vmx" /bin/bash "sh /home/vmdops/autovpn/runProfiler.sh" -interactive
This works when the use is already logged in interactively. When I launch too quickly after starting the vm I get the following error.
Error: The specified guest user must be logged in interactively to perform this operation
So one must wait a while after booting.

How to run selenium server in the background using windows batch script in Jenkins?

I am running protractor tests on a server machine through Jenkins. I need to start the selenium web driver before running the tests. i.e. "webdriver-manager start" and run the tests while the server is running and shut it down once tests are run. How do I do this using batch script?
I am using start, cmd commands in the batch file to achieve it but once the selenium server starts, I am unable to go back to the prompt unless I stop it.
How to I make it run in the background by staying in the same command prompt window rather than opening up the new command prompt window selenium server starts?
you should run webdriver-manager start as shell script.
Make sure
1 - Node.js installed on jenkins
2 - provide correct path to webdriver-manager

Debug meteorjs application with node-inspector

I am trying to debug a meteor application at server side.
I created an environment variable export NODE_OPTIONS='--debug'.
I run meteor (version 0.7.0.1) command. It tells the debugger listening on port 5858.
I start node-inspector (version v0.7.0-2) and point to 127.0.0.1:8080/debug?port=5858, but I can see only a couple of strings, Source, Console and a prompt > where I cannot write anything.
I have this error in the console:
“The connection to ws//127.0.0.1:8080/socket.io/1/websocket/Za… was interrupted while the page was loading”.
The same if I use 0.0.0.0:8080: I can see something more of the debugger on the right panel, as Watch expression, Call stack, but the Source list is still empty.
Node-inspector should be listening, because if I stop meteor says that the remote debugging has been terminated. I cannot figure out what I am doing wrong.
have a look at https://groups.google.com/forum/#!topic/meteor-talk/EG8pe7pF3f8
Just want to share some of my experience on using node-inspector to
debug server side codes:
1. When you run Meteor, it will spawn two processes on Linux machine
(Note: I have not checked this on Windows or Mac machine)
process1: /usr/lib/meteor/bin/node /usr/lib/meteor/app/meteor/
meteor.js
process2: /usr/lib/meteor/bin/node /home/paul/codes/bbtest_code/
bbtest02/.meteor/local/build/main.js --keepalive
You need to send kill -s USR1 on process2
Run node-inspector and you can see your server code
On my first try, I modify the last line on meteor startup script in /
usr/lib/meteor/bin/meteor to
exec "$DEV_BUNDLE/bin/node" $NODE_DEBUG "$METEOR" "$#"
and run NODE_DEBUG=--debug meteor on command prompt. This only put --
debug flag on process1 so I only see meteor files on node-inspector
and could not find my code.
Any suggestion on how to modify the script so we can use "--debug"
flag on the meteor script?
Cheers,
Paul

Running Erlang project on Amazon EC2

We have a project with different processes, and run it by calling erl -pa ebin, mymodule_supervisor:start_link().
We have set up an ubuntu instance on Amazon EC2. Being new to this, how can we run the project remotely, so we can close the connection and the project will continue to run?
We can run the Erlang shell in the background, but we can't our project on it. It would be perfect to see an example.
Method 1: You could build a release package from your code. If done right, this will embed a complete Erlang system (along with your application and its dependencies) in an easily distributable tar file. Using an automatically generated script the node can then be started as a daemon, running in the background even after you close your shell.
A good way to get started is to use Rebar, which already supports release handling out of the box.
Method 2: Use tmux or screen (both easily installed on Ubuntu) to start your node and detach the session. If you choose tmux, the following should work:
Start tmux simply by running tmux from a shell.
From within tmux, start your node with the erl command as before.
Detach your session using Ctrl-b followed by d. Exit your shell. The node should still be running.
The "proper" way to start the supervisor is to call its start_link function from within the start function of your Erlang application.

Resources