JProfiler is not able to detect any local running jvm, As I want to profile a java standalone application - jprofiler

JProfiler is not able to detect any local running jvm. Thinking of user access issue, I have started the java services with the same logged-in user on server but still no luck. Some help here would be really appreciated.

Related

Running tests on VM does not work unless window is open

We are attempting to do our testing remotely, so we set up some Virtual Machines to run our GUI tests and to free up our local machines. What we were hoping for was to have the tests run just like they would on a physical machine, however they seem to require an active Remote Desktop Connection up in order to run properly. These tests are written using LeanFT and it is a windows app so this is not mobile GUI testing.
Is there a certain way to configure this VM to set it up properly for automated GUI testing that does not require an active Remote Desktop Connection? It seems as if its sharing the controls on our physical machine..
Or am I completely wrong here.. Is a Remote Machine different than a Virtual Machine? Thanks!
It's possible to run a GUI test without an active Remote Desktop Connection
I achieved this with leanft through the following 2 steps:
Configure how you execute your tests
Whether you're running via a Jenkins slave or through another kind of "listener" (maybe ssh, or bamboo, etc.), you need to configure this listener to start after a specific user is logged on.
In my case I was running through the Jenkins slave, so I've configured the startup of the slave to launch as soon the user logged in.
Tell windows to login the user when the computer starts. You can achieve that via the following registry:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultDomainName"="DOMAIN"
"DefaultUserName"="USERNAME"
"AutoAdminLogon"="1"
"DefaultPassword"="PASSWORD"
The core requirement is that you need to have an active session (regardless of whether you are using Jenkins, TeamCity, Grid or other tools to launch the tests).
For your virtual machine, you will need to have access to the console. For VMWare vSphere, there is a native client or website. For VMWare Workstation or VirtualBox, these automatically display.
Using the console access, log into the system and set it up to never log out or sleep or hibernate. This is a variety of OS settings that you can look up.
Essentially, these boxes need to always be logged in. With this setup, you need to be sure access to these systems is controlled so that you don't have random people logging in / or logging out.

Running Selenium Server & ChromeDriver as a Windows Service

So that we may perform front-to-back web UI testing, we are using Selenium and ChromeDriver to automate page loads/interaction as part of our testing pack.
This is behaving as expected during developer testing (on a developer's local machine), but we are struggling to perform these checks as part of our continuous integration build.
Our server plant is *NIX based, and all of our CI infrastructure runs on these machines. So that we may test Chrome under Windows (our delivery mechanism), we have configured a Selenium Grid. When the CI tests run, they access the grid, in order to locate a Windows node to run the tests on.
We have had a Windows desktop provisioned solely for the purpose of running these tests. This contains our standard enterprise build of Windows 7. This machine will be periodically rebooted in-line with the IT department's update policy.
In an effort to ensure the Selenium server is always running, we have added the Selenium Server (running in "node" mode) as a Windows service. The selenium Server is configured to start-up ChromeDriver to invoke the simulated user-interaction.
However, when running the tests from CI they fail due to timeout. Our working theory is, the system user that is running the service cannot create interactive windows. A web search has raised reference to the "Session 0" problem, but with little to no constructive advice on how to move forward.
Starting the Selenium Server process manually from an interactive session is not a viable solution, as this is leading to brittle tests - which are failing due to an infrastructure problem, rather than a genuine test regression.
How can we have an instance of Selenium Server started via a Windows Service whenever the system reboots, that is capable of launching Chrome instances?
It could be easily done with NSSM.
Installation of services looks like these:
nssm install seleniumhub java -jar C:\selenium\selenium-server-standalone-2.45.0.jar -role hub -hubConfig C:\selenium\hub.json
nssm install seleniumnode java -jar C:\selenium\selenium-server-standalone-2.45.0.jar -role node -nodeConfig C:\selenium\node.json
It provides easily way to remove service if needed:
nssm remove seleniumnode confirm
Add destination to nssm to your PATH variable and run from console as admin
UPDATE April 2021
NSSM is not supported for more than 3 years. So please consider other options like winsw or any other. WinSW does the same job as NSSM and allows to keep run configuration in xml.
You cannot run Selenium Grid as a windows service ever since Windows Vista. Microsoft calls it "Session 0 Isolation". You could do it in Windows 2000 or XP but since the time that Vista came out, Microsoft no longer will let Grid interact with the desktop (or any other UI programs for that matter). Regardless of the fact that you still see that "interact with desktop" checkbox, it is a red herring. So, you MUST run Selenium Grid in the foreground on that server in order for it to get access to the session. If it is running Windows Server, you could in theory have multiple sessions and leave Grid running in the foreground on one of the non-zero user sessions.
Right now you can't help it - it used to work fine in session 0 but for the past few days after chrome update only works for interactive sessions.
Related bugs:
https://code.google.com/p/selenium/issues/detail?id=8029
https://code.google.com/p/chromium/issues/detail?id=422218
My preferred solution to this problem (and my default choice for running Selenium Grid as a service) is to use a simple tool called AlwaysUp. It has a free 30 day trial to try it out.
What to do:
Download AlwaysUp
Configure AlwaysUp to start the Selenium Grid node on startup
Configure AlwaysUp to run the Selenium node as a specific user (not the default System user)
This way the the node will run as a service, survive machine restarts and work with the latest version Chrome.
If the user account you use to login to the machine is different from the user account you specify to run the node as a service then you will not see the browsers pop up on the desktop as they are running in a different user session. The end result is that it is almost identical to running as a normal service but gets round the Session 0 issue.
Yeah, you should use NSSM. Important is, that you add your windows account in the "Log on" tab, or any other valid account. If you run your node with the "Local System account" option, you will get the session 0 problem. With a normal user session, the nodes run smoothly invisible in the background :)
we don't use selenium GRID, we were disappointed with its stability. We use a "Jenkins Grid", that is jenkins slaves nodes on various servers.
The slaves are services with the interact with desktop flag. They run as services with NSSM, and the SERVICE_INTERACTIVE_PROCESS flag. Making sure that NoInteractiveProcess is set to 1 (cf https://learn.microsoft.com/en-us/windows/desktop/services/interactive-services).
We don't have the fancy features of the grid (that is balancing according the browser types slots). Instead, we have Jenkins balancing the test jobs using a slave node or another.
Initially we did not use the interact with desktop flag, having browsers to run without "real" display, but the behavior was not very stable (especially with resize commands).
Hope this helps.
As I explained on this thread, I found that using a small paid tool FireDaemon Pro saved me a lot of time from trying to configure NSSM and other free tools.
It works well in the background, and restarts Selenium along with the server, which was my main requirement for running Selenium Standalone Server as a Windows Service.
This free tool would probably do it:
http://yajsw.sourceforge.net/
For that to work, you need a wrapper.conf file and a script to run the YAJSW wrapper. I takes time to read the documentation, but it is a free solution.
I wrote an example shared here, that installs JBoss7 as a Windows service.
Of course, you can simplify my example by a lot.

Tests running silently without window appearing

Apologies, I'm still fairly new to selenium so please bear with me as I explain this.
Currently my selenium tests are running on a remote machine but no window opens when I'm remotely logged into that machine!
My setup is:
Remote machine has 2 admin users with Selenium Grid2 and a node as a windows service.
The machine is running windows server 2012 with the services having Interactive services enabled.
I am using Selenium 2.42.1 with IEDriver version 2.42.0
Tests are being built and run remotely on our build server.
I think that's everything, if there's any more information then please let me know as I'd really like to know why I cannot view my tests running.
Just for clarification, the tests are running and they successfully pass or fail where necessary, but I just can't see it if I'm remote logged into the machine.
UPDATE
There has been some interesting progress on this issue but still no resolution.
I decided to try and run a node from command line and funny enough the tests run with no problems and the browser window is displayed.
So if anyone has any idea why a browser window would appear when running a node from command line but not when running a node as a service would be great.
I'm using java service wrapper to create my service and im using the same nodeconfig.json when running the node.
This can happen when you are running the node as a windows service. There is an option in service to say whether the job should run in background or interact with desktop. Check that and you should see the windows.

Automated UI testing on remote computers without installing anything remotely

Which options do we have to do automated UI testing on remote computers connected via RDP, if I don't want to install anything on the remote computer?
My only idea is to open the rdp session always in the same way and use recorded mouse and key strokes, but there are some disadvantages, e.g. I assume it's slow?
Anyways, do you know any open source or proprietary tools I can use? Best would be that I have to install nothing on the remote machine and play the record on my local machine.
Starting with UFT 11.50 (previously known as QTP) there is support for image based testing.
You can have one machine with UFT installed and replay on other machines via RDP using Insight UFT's image based automation solution.
eggPlant Functional allows you to automate the UI of any app on Windows machines using an RDP connection. It's pretty fast assuming you are connecting over a decent network, and you don't need to install anything additional on the target machine.

Integrating LDAP with Glassfish and FTP

I'm currently faced with the task of integrating a glassfish environment and an FTP-Server with LDAP. This is work for an university, we need to be able to have a number of students(which all have Login-Data via LDAP, though access is only permitted via SSL) run their own applications on a glassfish server, upload them and then restrict their access at a given date.
I set up a Suse Enterprise 10 SP3-Server, configured it, installed a Java6-repository and Glassfish 3.0.1. Does anybody know whether there is a way to connecting Glassfish with LDAP and letting specified users upload specific programms? If upload is not possible I thought about simply setting up a FTP-Server and connecting that via LDAP, can anybody point me to a link on how to do that?
I obviously googled but getting information for Suse Enterprise 10 is actually very hard, wasted about an hour because I wanted Java 6-repos instead of compiling it via source.
thanks for any help in advance
Glassfish rpms can be downloaded from opensuse build service http://software.opensuse.org/search
For Glassfish integration with ldap, this might be of help