Captcha is present when running selenium automated tests on Windows server - selenium

I am trying to run selenium tests on Jenkins hosted on a Windows server. The test starts with Google login, when I try to run them on my local machine it works perfectly fine, but when I run it on Windows server it will ask me to solve the captcha, because of that the tests will fail.
Can I somehow disable captcha from google admin or add that IP to Whitelist, or add some arguments to selenium that will solve this?

Related

Integrated Windows Authentication (IWA) issue on Jenkins slave node in Selenium tests

Given: We have a Jenkins build running Selenium tests for application using using SSO authentication.Application and authentication provider are located in corporate intranet of type
"auth-service-name.corp-name.com". Tests are running fine on local Windows machine, but on Jenkins windows environment they can't pass IWA to access the tested website. Application tested works ONLY in Chrome, so it is the browser used in tests. In registries of Jenkins machine it was found out that there is a proxy set up, while on local machine there is no proxy.
Tried: sending http requests with login and pass for sso-provider page. starting chrome in jenkins via command line with(start chrome --auth-server-whitelist=
"*corp-name.com")
Question: Is there any way to bypass such an issue? What could cause that Jenkins machine can't pass IWA?

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.

Selenium Grid 2 Jenkins CI automation Single sign on application

I am currently working on an application which has single sign on. You have to be logged in using the LAN or internal wireless Network to access the web page. My architecture team has created the Jenkin Job with Selenium Grid for the automation.
We have Jenkins slave created on a remote server. Now, when I try to run my tests, I get the error message and the tests does not run. But when I run the http://www.google.com page, the tests run successfully. Has anyone faced this issue before?

Sikuli, selenium testing on Jenkins: Allow the browser to be launched in the foreground, as it is when i run it from development machine?

The issue is that Sikuli's image recognition capabilities only work when the target of the Sikuli tests is in the foreground and it has full access to the mouse. In its current configuration, Jenkins projects are never visible from the desktop of the windows slave node.
The way my current automated testing suite is setup right now, about 30 tests are written using only selenium. In the final two tests, selenium starts a webdriver (currently chromedriver but can be firefox or IE) and navigates to the right pages and Sikuli does its thing from there. Both use the java language bindings.
Currently Sikuli appears to be installed correctly, but when it is asked to click through a list of screenRegions supposedly populated by matching the desktop with a target image, it immediately throws a NPE.
How do I change my Jenkins setup on my windows 7 slave to allow the browser to be launched in the foreground, as it is when i run it from my windows 7 development machine?
So you've got a development machine where Sikuli works, and a test machine where Jenkins runs Sikuli and it doesn't work.
I had this same setup (with the Sikuli tester/Jenkins slave running Windows 7). What worked for me was to have the test machine run a VNC server, log in as a the tester account over VNC, and launch the Jenkins slave as a regular application and not a service. I used UltraVNC server.
As far as I could tell, the problem stems from Windows' security measures, which are designed to prevent a remote user from controlling your machine without your presence.
If you run Jenkins as a service, it doesn't get a real desktop allocated to it. The script will run, but (as you're seeing) Sikuli won't actually be able to find anything because there's nothing for it to look at. (Selenium is inspecting the page content programmatically, so it doesn't mind that the page is not actually displayed on any screen.)
You can also just run Jenkins and leave yourself logged in, and skip the VNC server. I wanted to run the machine without a monitor or keyboard and still have control, though. If that's your goal as well, you can't use Remote Desktop, because it allocates a new desktop on connection and then destroys it when you disconnect. (So Jenkins will work when you're watching and fail when you leave for the night. Very frustrating!)
As a side benefit, if you do it this way you can connect over VNC and watch Jenkins as it's running the test.
make the slave machine remote desktop to itself.
run the jenkins salve as program in that session
cmd /c start java -jar slave.jar -jnlpUrl http....slave-agent.jnlp -secret ... (find it in your jenkins master (shown when the slave service is down)
set it all to run at salve win startup.

How to test remote server deployment of Rails app with Cucumber and Capybara

I am developing a Rails 3.x app under Windows 7 and am using Cucumber and Capybara for testing.
I have set up an Ubuntu VM and deployed my app to that.
I want to use Cucumber / Capybara to test my app on the VM after each deployment - after all, this is a different OS and I want to leverage the power of my test suite to test different browsers (Firefox, Chrome and IE) against the deployed site.
In theory, it seems as though I have 3 main options:
1) Run Cucumber locally, with a local browser and hit the remote server (VM guest)
2) Run Cucumber locally with a remote browser hitting the remote server
3) Connect to the VM guest and run Cucumber locally under the VM
It seems to me that option 1) best simulates the real world, ie NOT running the browser on the remote server.
However, I am not sure if this is possible, or how to configure things to achieve it. In particular I am not clear whether or not I need Selenium Server in this case, and if I do, whether I should be deploying it locally (on the Windows dev machine) or remotely (in the guest VM where the app is deployed).
I have done a fair bit of Google searching about this issue and have looked at such posts as:
Problems with connecting to VM with cucumber remote test
https://github.com/leonid-shevtsov/headless
and while these give some clues such as the use of (which are exactly as described in the official Capybara docs at http://rubydoc.info/github/jnicklas/capybara)
Capybara.app_host = "http://hostname:4444"
Capybara.default_driver = :selenium
Capybara.run_server = false
the examples given seem to be referring to the browser running remotely (eg my Options 2 or 3) and I am still not sure what is the best approach to take.