Selenium automation - running from a common folder - selenium

I am trying to setup a shared folder on vm and from that folder setting up automation. Is there a way that all the people who have access to that folder can see automation running? See chrome instance running autmation?

Usually, CI like Jenkins is used to run automation on VM and collect results.
But as for your question - to be able to view automation tests running on the browser on VM user should be logged in to that VM by Remote Desktop Connection.
Having a shared folder on VM can't help you to see tests running on VM because it doesn't mean users who have an access to it have a user account on that VM.
I would recommend creating one testing user account on that VM and share it with the team.
Run is performed on the agent, there is no way to see real time run on the agent without being logged in. You can record the run, save video to your shared folder, so users within access to that shared folder will have an access to saved videos.

Related

Jenkins Execution Issue

A selenium script , when executing from Eclipse in a local machine , clicks an UPLOAD button in browser to upload some files from local machine to that application running in browser.
This uploading part is failing when the script is executing from Jenkins because Jenkins server is unable to access local machine.
Any idea how to overcome this issue..??
Accessing these files from the server is a bad idea (unless it's a Jenkins's slave) though can be achieved via your code or some CMD tool, with providing the address and credentials. Put some effort in this and you'll find how to do it...
The better solutions will be adding these files to the Jenkins server as well or committing these files to your repository and checkout them before the test.
A shared folder could also do the trick on a filer type server or similar.
Hope it helps. Anyway there's no substitute to your own research e.g. Google and StackOverflow.

Selenium / Protractor not able to run browser tests (E2E) if the user running it is not interactively logged-in

We have a Continuous Integration agent that runs with the identity of a non-logged-in user (non interactive) - i.e. the agent does work with sufficient Windows user credentials, but no user is "physically" logged-in to Windows and the agent run as a scheduled task with sufficient privileges.
The problem is that under these circumstances Selenium is not able to open a browser to actually run browser tests.
What could be the solution?
This guide just briefly mentions how to configure the Windows user to be able to run a browser with a non-logged-in user (using control userpasswords2) but that advice doesn't work.
To clarify, this problem is not specific to the Bamboo CI agent (referred to in the above link). It's common to all scenarios where Selenium running on behalf of a non-logged-in user would try to run a browser.
You need to have an interactive session to interact with. I believe this question on SuperUser Run interactive task even if user is not logged on Windows as well as the instructions from Atlassian you linked are the correct answer.
Once the user is set to auto-login, you need to reboot the system to cause that auto-login to occur. The recommendation in the linked question of forcing a lock after the login is a good one for security, but still provides an interactive session for the CI/Selenium to work against and without running under System with limitless privileges.
If this does not fix your problem after following all the directions and rebooting, and you have verified that the user is in-fact logged in at the time you run the CI/Selenium (typically you can check this with Remote Desktop and looking at that logged in user for the console session in Task Manager > Users tab), then there is most likely a different problem.

Running Hub and Nodes remotely on Windows without a user logged into the machine

Selenium GRID2 is setup with a hub and three nodes (VMs Windows). All the config files are set and I start the services with a couple batch files executed on each machine. Once everything is started up it works great. When the remotely connected user who executed the batch files actually logs out of the machine the tests fail to connect to the browsers anymore.
I could leave the user account logged on after starting everything and just stay logged on. However, I would much rather find a way to get the services to startup and stay active without any user logged on the systems. Is there a way to force all the services to stay active after all users logout of the machine. Also need the full browser to function as there are screenshots as well. Could someone point me in the right direction or tell me how to get that to work or if it's possible?
Setup a scheduled task via Task Scheduler to execute the batch files to start the node on each machine. You can set a trigger to execute the batch file on system startup, or at a specific time.
Also, when creating the task, select the option "Run whether user is logged on or not"
I also add a task to restart the node machines (every night) to keep it clean of stale browser windows.Since the node batch files runs at startup, you do not need to login to the hub/node machine to start it manually.

Store selenium tests on a server but run them on local browsers, through a framework like fitnesse

I've been working on a webdriver framework for a while now, I guess it is
keyword driven now. We would like for there to be a central place for users to
store tests, preferably on a wiki, but then when they are run they would open up
the browser on users local machine.
I originally started working using Fitnesse, which works great for storing the
tests however when we hosted it on a server when a user tries to run a test it
opens the browser on the server which the user can't view. Does anyone know a
way that I could force Fitnesse to open the users local browser or display the
browser to the user? Or do you know another framework/way to store tests in a
central place but run them in local.
I've been looking at sending through the local users ip through a fixture to start up the initial framework, I was hoping that fitnesse would already know the ip.
Thanks,
James
You can either find a framework that does what you want, or the bare minimum would be to create a thin wrapper that copies the test dll's and executeable to a machine and executes psexec to execute the tests on the remote machine. You could probably write the entire thing in maybe 20 lines of code.

running selenium as a RC in IE, as a scheduled task

I'm trying to automate a task using Selenium-RC where the user doesn't have to be logged in. Here's the ideal scenario:
Running as a scheduled task and the user is not logged in.
Selenium will start at a scheduled task, open IE and go about the script.
I'm not sure this is possible, but I need to simulate user interactions with IE without the user being logged in. what would be the best way to do this?
IDEA:
would I able to put Selenium on a virtual machine, have the virtual machine run as a scheduled task on a physical machine; so when the user is logged out the virtual machine can still be started, and selenium will run on the virtual machine.
If you are using ant build, you could create a batch file to invoke the build. Now you could schedule the execution of batch.
I suppose you could same while using TestNG framework with java. So you create a batch file for executing test using testng.xml and then have it scheduled.