Selenium - Key press events not working when automation scripts are run using Jenkins service - selenium

Facing a problem when running my scripts in Jenkins , noticed that the key press events for e.g
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_PAGE_UP);
Are not working when scripts are executed using Jenkins service.This works fine on my local.
Did any one came across this kind of problem when executing scripts using jenkins service on window machine ?
Application running on Chrome browser.
Please help.
Thank you.

Related

Azure DevOps for Browser Mode for automation

I have repo on ADO for selenium Scrip ,and we are using ADO pipeline for for execute automation. I m struggling for Browser Mode automation where I m expecting to see automation action on web page like clicking button etc.
By Default ADO configure as headless mode
Could you please suggest what I need made changes for browser mode in ADO(Just like we run automation using Jenkins and we can see all action based on our configuration )

see firefox when executing robot test in docker

I'm using robotframework with selenium and firefox.
I'm running test in a docker.
But for debugging purpose I want to see sometimes what's happen on the UI.
So is there a way to get the UI of firefox launch when test are running in docker.
thanks
You can use VNC to see what is actually happening over docker. It's like remote access where you can see everything on docker image
Download VNC viewer :
https://www.realvnc.com/en/connect/download/viewer/
Some tutorial :
Click Here
Article
https://medium.com/#shivam.somani09/running-automated-test-cases-on-vnc-viewer-using-docker-16656c3d1d87
OR if you don't want VNC
You can take screenshot if you just want an image on a particular place.
You can also use driver.getPageSource(); to get the HTML code

Run chrome as different user using Selenium and C#

As part of a testing project, I am trying to run a chrome instance as different user ('UserA') using Selenium and C#. I have tried all suggestions I could find, but nothing works. No matter what I do, the Chrome instance that is opened during the test, runs as the user logged into the machine and not as 'UserA'. Everything runs locally.
I am fairly new to this, so any advice/suggestion is appreciated

Bamboo not running NUnit webdriver tests

We have a CI setup using bamboo where one job was to run our automation, it checks out our Automation Solution from a repository, and run it using NUnit runner where it contains tests using selenium webdriver and some unit tests. It runs unit tests(not using webdriver commands) just fine, but not the webdriver tests.
We are sure that the solution is being checkout correctly because we can run the test using the command line referencing the created local repository, including tests that uses webdriver using the command below:
C:\pathToNUnitConsole\nunit-console C:\pathToCreatedLocalRepositoryInTheServer\NUnitTest.dll -include=FirefoxBrowserTest
We can see that the bamboo job never launched a browser, and we are getting test failure for not seeing browser elements. Also, we are getting error as we see in the logs:
10-Apr-2015 13:19:49 http://10.215.12.28:15871/cgi-bin/blockpage.cgi?ws-session=587410860
10-Apr-2015 13:20:42 JavaScript error: resource://gre/modules/CertUtils.jsm, line 168: NS_ERROR_ABORT: Certificate issuer is not built-in.
I don't know if this is your problem, but it sounds very similar to an issue I had trying to get NUnit runner to run tests built in SpecsFor.MVC, which is a wrapper that deals with instantiating an IIS Express instance, deploying a target web application to known location, then using Selenium/Chrome Driver to run the tests against the web app.
The problem I had was trying to run the Bamboo remote agent as a windows service. The Local Service account was not able to access the interactive desktop. Also, changing the service to run as a specific user account still failed, as the service was not allowed access to the user's isolated Session0.
I could login as that test user and run the test from the command line no trouble, but I couldn't get it to run when initiated by the remote agent windows service.
I eventually fixed it by using AlwaysUp (not a plug. I'm sure other similar solutions are available). This allowed me to set the machine running the tests to always log in as the test user on startup, would automatically restart the bamboo remote agent if it was closed for some reason and most importantly, to give the service access to the user's isolated session0.
Hope that might give you a few clues...

Selenium with hudson:firefox browser is not getting lanuched while selenium scripts are running through hudson

i integrated my selenium scripts (using junit) with Hudson. i invoked my job through ant . My problem was my scripts are running successfully but the fire fox browser is not getting opened. At this moment i am not using selenium grid .please provide any suggestion
Check whether you run Hudson as a service using your own account. If you want to see Firefox browser you must select Local System Account as a service runner (Log on option in service properties) Then there is a possibility to check interact with desktop checkbox and it makes browser "visible" while running your tests.