Running webdriver IEDriver on Jenkins fails - selenium

I have a small C# webdriver test suite dll which I recently created...
Runs fine in Visual Studio
Runs from the command line perfectly using the NUnit 3 console runner.
I have Jenkins installed on my laptop (for testing before I put it into my live Jenkins), running with my Windows credentials. When I execute the test suite using the same NUnit3 console runner command I used before, all the tests fail, can't even log in as it can't find any elements. I took screenshots with Selenium & it's just a black rectangle!
Anyone have any ideas on how to get IE behaving - I bet it's a Windows permissions thing from Jenkins. Thanks!

I'll answer my own question.
Turns out you can't do what I'm attempting - it's a known issue with the way IE is built. What I had to do is install a new Jenkins node on another machine and get that to run the IE tests. That way it did work.

Related

Cucumber selenium failing in jenkins pipeline only

I am working on an integration test, using Selenium/Java/Cucumber. When I run the test on localhost, or remotely on a VM, it passes fine. But when it runs as part of a Jenkins pipeline it hangs with the error "Timed out receiving message from renderer". I have googled this and there are several possible causes, including version conflicts. But I can't seem to figure out how to check these versions in the jenkins pipeline. Any pointers on what to look into would be helpful. I believe the tests are running headless on the pipeline, because there is no Chromedriver pluigin installed in our Jenkins. The test is pretty straightforward - it involves clicking on an element within an iframe (this is where it hangs) and checking for some output. I have even tested it running manually on the VM created by the very same pipeline and it always works without an issue.

How does the elixir community recommend setting up integration tests with chromedriver?

I am using Hound (https://github.com/HashNuke/hound) for integration testing a Phoenix application. I have chrome and chrome headless working. To get it working I have another terminal window running chromedriver (installed via brew). This feels odd to me. Is there a library or test setup that would feel more "integrated" into the application? What's the Elixir way of doing this?
In the Ruby world there's the webdrivers gem (https://github.com/titusfortner/webdrivers). As far as I know it downloads a specified driver (lets say chromedriver) to $HOME. Then with every test run, the test uses the driver downloaded to that destination to execute the tests.
Before the webdrivers gem there was chromedriver-helper gem. Before that it was phantomjs. These implementations made it so running integration tests required 1: downloading the driver 2: running the test
In Elixir (with Hound) I have my tests working by first running chromedriver --verbose in a terminal split, and in the other screen I run mix test. This works fine but feels disjointed. This adds extra steps, 1: download the driver 2: start the driver 3: run the test 4: stop driver
I could write a script manually to run chromedriver in the background, and stop it after the tests are run.
I am new to the Elixir community and so I've researched a lot. It's still not clear to me if there is a "traveled path" I should go down vs just hooking everything up manually.
Have I missed a recommended abstraction? Is this intentional? Is this "just not created, yet"?
Thank you
Have you checked out wallaby? See https://github.com/keathley/wallaby

Can I write Selenium EdgeDriver tests on Windows 7 IDE

I am running Selenium WebDriver tests in the BrowserStack Automate grid. I am writing tests on a Windows 7 machine. I don't seem to be able to download and install the Edge WebDriver.
All instructions seem to point to downloading and installing Windows 10 first. This kind of makes sense if I wanted to run the tests locally - but not when I want to run them in a grid.
Are there any work arounds?

When selenium test runs by Jenkins and MSUnit, the browser doesn't come up however there are valid results

I put together a machine (Windows Server 2012R2) for POC reasons where a Jenkins installed and it executes Selenium UI tests using msunit
But, when I log in the server where the Jenkins runs and I watch what happens during CI build (compile and test execution) I can't see that the browser (Firefox) starts automatically, however, the test results and the logs show that a browser was executed.
My question is that, what the is happening when my tests are executed by Jenkins? If I execute the command which from visual studio on the same machine then I can see that Firefox starts, does what is programmed in the tests and the results are in the result.trx.Can I somehow set up Jenkins the way the browser really executed (I can believe it when I see it :)
In Jenkins when you run selenium test cases, they are executed in the background by default.
Your Jenkins might be configured to run those test cases in some video buffer(usually it happens on Linux but can also be configured on Windows) or in a headless state.
As your question, if you are using MSTest which basically used to convert the test cases result from trx to JMX format but also can be used to run selenium tests. when you run the same in Jenkins it will run in background on any slave or on master.

Jenkins with Xvfb and Selenium - Firefox started but nothing executed

I have a problem with Selenium under Jenkins 1.446 together with Xvfb: It looks like firefox is started correctly because I let my failing tests record screenshots. These screenshots all show the same failing page, which in my case is the starting page where the tests should begin. So I gues the selenium WebDriver commands do not arrive. What could be the reason? By the way, the tests are running perfectly on my local machine.
I'm using Firefox 9.0.1 with no specific test profile and no AddOns, Ubuntu 10.04, Senlenium 2.16.1
Log entry: com.thoughtworks.selenium.SeleniumException: Timed out waiting for action to finish
Thanks!
EDIT: Issue seems to be fixed by a system reboot ...
I experienced a very similar issue with FF9.0.1 and Selenium 2.16.1 running through JUnit launched by Maven SureFire plugin run by Jenkins on a WinXP node.
2.17.0 fixed the issue for me. Try updating to the latest Selenium.
Through RDP, I was able to watch the tests running. The tests appeared to be partially blocked by a prompt from Firefox asking about collecting anonymous usage statistics. Manually answering the prompt would allow the test to continue but because Selenium creates a new profile each time by default, the prompt would return on the next browser launch. Running the tests locally with a pre-configured FF profile allowed me to persist that the prompt had been answered. This isn't possible on my XP node because the tests are running as 'System'.
Selenium/WebDriver would normally take care of this for you by marking the prompt as already answered in a temporary FF profile configuration but a bug was causing the value to be set to the wrong value. You can inject a profile configuration to the Selenium FirefoxDriver driver to pragmatically configure stuff like this prompt but the bug appeared to prevent this as well. This has been resolved in Selenium 2.17.0 (http://selenium.googlecode.com/svn/trunk/java/CHANGELOG see 2.17.0 WebDriver bug fixes).