Unable to open Chrome UI with Jenkins installed as Windows Service even on Windows Server 2019 even after doing necessary configurations - selenium

Unable to open Chrome UI with Jenkins installed as Windows Service even on Windows Server 2019 even after doing necessary configurations
I have installed Jenkins as service on Windows Server 2019 . I did the following
Open properties window of the service -> Logon-> enable the checkbox "Allow service to interact with desktop"
Toggled the NoInteractiveServices registry key from 1 to 0 .
3)Restarted Server as well as Jenkins
Still i am not able to see the Chrome Launch from Jenkins (Its working fine as headless)
I know that we by launching from .war file we can see the browser open . But when i navigate to folder and launch the war file jenkins gets opened but all my configured jobs are not visible
Please provide workaround for any of above

Related

Is it possible to automate Internet Explorer on an EC2 instance?

I would like to scrape some data from a website that only seems to show up in internet explorer, I have booted up a Windows Server 2019 EC2 instance and was hoping to install Python and Selenium along with a webdriver for internet explorer but I can't seem to download any software when connected to my Windows Server via RDP from my linux machine, are there any other methods you could suggest for automating Internet Explorer?
Log in to the instance (RDP) ------> go to server manager -----> head to local server -------> Find IE Enhanced Security Configuration and click on On ------> rn off IE ESC for Administrators and/or for Users and click OK.
You are good to download any content now.
I found a solution to download with internet explorer, go to the cog symbol > internet options > security
Then select each of the zones and untick the box marked 'Enable protected mode'

Running Selenium Tests from a VSTS Hosted Agent

I am running the Selenium test in Visual Studio Team Services with VS2017 hosted agents, but I think I am having issue's with company's proxy.
I am running the Selenium test from Visual Studio 2015, it runs very fine and able to access the web application.
When I am running the same Selenium test in VSTS using hosted agents, then it is failing on the below error and not able to reach the URL of the application to be tested:
"The site can't be reached"
I know there are proxy authentication required in my company but I am not sure how to run the Selenium test from VSTS hosted agent which can bypass the proxy.
If someone know the answer, please respond
The hosted agent is run by Microsoft and exists in Azure. It does not have connectivity to your internal network where your site is hosted.
You will need to set up a private agent that exists within your local network. A proxy can be configured for a private agent during setup with the following command line: ./config.cmd --proxyurl http://127.0.0.1:8888 --proxyusername "1" --proxypassword "1"
Ref: https://learn.microsoft.com/en-us/vsts/pipelines/agents/proxy?view=vsts&tabs=windows
We have several groups of agents hosted internally that can access stuff hosted on premise. We configured the agents using PAT's by clicking on user profile > security and generating a new PAT.

VSTS is it possible to run selenium UI test tasks against localhost web app?

I might be missing something obvious here but my mvc web app is successfully tested using specflow UI tests on my dev machine using localhost but I can't get this to work on a CI Build pipeline in VSTS?
Here is my setup, 1 x Asp.Net solution comprising of:
1 x WebCalculator (MVC app that simply adds 2 numbers together)
1 x UI Specflow tests project
On my Dev machine: I can run the unit tests using NUnit3TestAdapter within visual studio, with my website running at localhost:58909
On VSTS: After the build task, the Visual Studio Test Task is picking up the NUnit Adapter and tries to run the tests (using InternetExplorerDriver server) but fails to find my website running on localhost it seems:
Here's the output:
2017-04-03T09:02:31 Starting test execution, please wait...
2017-04-03T09:02:32 Information: NUnit Adapter 3.7.0.0: Test execution started
2017-04-03T09 Information: Running all tests in C:\a\1\s\WebCalculator.UiTestsNUnitRunner\bin\Release\WebCalculator.UiTestsNUnitRunner.dll
2017-04-03T09:02:32 Information: NUnit3TestExecutor converted 3 of 3 NUnit test cases
2017-04-03T09:02:33 Started InternetExplorerDriver server (32-bit)
2017-04-03T09:02:33 3.0.0.0
2017-04-03T09:02:33 Listening on port 1065
2017-04-03T09:02:33 Only local connections are allowed
2017-04-03T09:03:54 Started InternetExplorerDriver server (32-bit)
2017-04-03T09:03:54 3.0.0.0
2017-04-03T09:03:54 Listening on port 1123
2017-04-03T09:03:54 Only local connections are allowed
2017-04-03T09:03:54 Failed AddTwoNumbers("50","70","120",System.String[])
2017-04-03T09:03:54 ##[error]Error Message:
2017-04-03T09:03:54 ##[error] OpenQA.Selenium.WebDriverTimeoutException : Timed out after 10 seconds
2017-04-03T09:03:54 ##[error] ----> OpenQA.Selenium.NoSuchElementException : Unable to find element with id == summandOne
So my question, is the Visual Studio Test Task smart enough to test against my website which is built as part of the solution at localhost:58909 ?
The example from MS here: https://www.visualstudio.com/en-us/docs/test/continuous-testing/getting-started/continuous-test-selenium
Has the Specflow tests pointing at an XXX.azurewebsites.net url so I'm starting to think that building the website and executing the UI tests together (like I'm attempting) isn't the right approach for this?
Is it the case that when you want to run Specflow tests against a website - I need to build and release this to a hosted environment first??
Based on the source and test paths (c:\a\1\s…), I assume you are using Hosted Agent and do test on build agent. You can’t do it.
First, the Hosted agent is running as service, it can’t run interactive test (selenium UI test).
Secondly, the localhost means the test machine and website machine are at the same machine. Obviously, your website isn’t running in Hosted Agent.
Regarding the article you mentioned, the website is in the azure (baseURL=”https://partsumlimited.azurewebsite....), so it can be access from internet
You can refer to these steps to achieve your requirement:
Setup a on premise build agent that running as interactive mode (if it is running as service mode, you need to do test on remote machine, refer to that article to deploy agent, copy file and run test) Deploy an agent on Windows
Create a new build definition to use that build agent
Add IIS Web App Deployment step or other to deploy your web app to IIS (Deploy your Web Deploy package to IIS servers using WinRM)
Change your website URL in test code (You can use localhost if the build agent is running on the same machine)
Note: If you want to run test on remote machine, the remote machine need to be accessible from build agent.

Running Worklight Deployment Server with fixed IP to Generate War/Wlapp/.adapter files?

I am done with my Project and its time to Deploy things to the Websphere Server to host My Worklight Application based on Woklight 6.1.0.
Despite reading the following question, I still have a question.
IBM Worklight - How to connect to another Worklight Server located in another machine in the same network?
The Websphere Server on which i have to Deploy my .war, .wlapp and .adapter files is remote server and does not fall under my company's domain. I do not have access to IP address and port provided by clients, So to deploy the same my backup plan is to copy files to a laptop having open network access and use RDP of the Window Server IP to deploy
My issues are:
As Worklight behaves, while i do Run as --> Run on Worklight Development Server it overwrite file properties like worklight.properties,.plist and index.html for windows with details of its local IP address.
When i do, Run --> Build Settings and Deploy Target I build the application to work with different Worklight Server and fill details i.e. Server: http: //182.19.xx.x0:9xx0 and Context Path: /Advisor. After doing it i see a message stating "Rebuild your Application after every change" then i click on 'OK'.
I expected it to rebuild everything for me as per details i provided but nothing happens. Is there anything i am missing?
After you add your remote server details in the Build Settings and Deploy Target window, you are instructed to re-build the application. Worklight Studio will not do this for you.
Change deployment target
Click OK
Right-click on the application folder and select Run As > Build All Environment
Per the user documentation:
Important: This dialog is used only to specify configurations and
settings; clicking OK does not trigger a build. Any time that you make
a modification with this dialog, you must rebuild your application and
environments for your changes to take effect, using either the Run As
-> Run on Worklight Development Server or the Run As -> Build... menu commands.

Web Deploy results in ERROR_COULD_NOT_CONNECT_TO_REMOTESVC

We are trying to configure continuous integration with TFS 2012. While queuing a new build, the publish fails with the error:
Build FAILED.
"C:\src\ProjectName.sln" (default target) (1) ->
"C:\src\Website\ProjectName.csproj" (default target) (2) ->
(MSDeployPublish target) ->
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4377,5): msdeploy error ERROR_COULD_NOT_CONNECT_TO_REMOTESVC: Web deployment task failed. (Could not connect to the remote computer ("ServerName") using the specified process ("Web Management Service") because the server did not respond. Make sure that the process ("Web Management Service") is started on the remote computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_COULD_NOT_CONNECT_TO_REMOTESVC)**
I checked all the points mentioned in the IIS.NET documentation for this error. Both services mentioned, Web Management Service and Web Deployment Agent Service, are running fine. A restart of those services has no change in behavior.
Windows Server 2008 R2 with IIS 7.
Web Deployment Agent Service is running on port 8172.
Web Deploy 3.0
Windows Firewall is not blocking any port on the server.
How can this be fixed?
If you install Web Deploy 3.x BEFORE Web Management Tools are installed, you'll have to re-install Web Deploy. I beat my head against the wall for hours on this.
Install the Web Management Services ("Turn Windows Features On/Off"/Roles -> Web Server -> Management Tools -> Management Service)
Then uninstall Web Deploy (repair didn't work) via the usual Add/Remove Programs control panel
Install Web Deploy 3.x again using Web Platform Installer.
Fixed. /Sigh
Double check in your Web Deploy settings that the name of the website is exactly that of what's in IIS.
Ben Day blogged more about it.
Fix that i saw on another website:
Fix it by adding “http://” to server.
In other words, when server is www.xxxx.com would get the 403 error, but when server is http://www.xxxx.com, then it works.
You need also to indicate the app name e.g 'Default Web Site/MyApp'
That was my error. Once I added /MyApp, it worked.
I got this error when using msdeploy, not TFS. In my case I needed to make sure the user msdeploy is using had permission to deploy to the website.
Find the website in IIS manager, right click and go to Deploy, then Configure Web Deploy Publishing. Find the user used by Web Deploy and setup for this website.
In my case the Internet proxy was enabled on source - which made msdeploy to reach out to internet instead of local ICN.
You should check the logs on your IIS first - see that you actually get to the server, and then you can locate the exact error here - https://support.microsoft.com/en-us/help/943891/the-http-status-code-in-iis-7-0-iis-7-5-and-iis-8-0
Uninstalling and re-installing (not repairing!) after setting up IIS did most of the magic for me.
There is another possible cause of the error. IIS Managemente Service have its own configuration for IP Address Restrictions, which default value is Deny Access for unspecified clients (Windows Server 2012 R2 with IIS 8.5).
You must set this value to Allow or add access to your specific IP address/IP address range using the Allow... button.
Remember, you must Stop the Management Service previously to change this configuration.