Azure DevOps VSTest,Site Currently unavailable message and times out despite being up - selenium

Currently using Selenium + ChromeDriver to execute automated functional tests through Azure DevOps VsTest task but whenever the task tries to execute tests pointing to a website in NetCore, it times out very quickly and sometimes (a lot of times) I get the standard error message from the registered screenshot on error of "This site can't be reached".
I tried running this locally and pointing to the same website but this issue doesn't seem to happen at all and I've got no clue on what's going on due to the big inconsistency between the results that the VsTest task provides.
I also tried opening Chrome on the machine that executes the task but it seems to open the URL fine there.
One thing to note is that the website I'm using uses Windows Authentication mechanism and I'm sending my credentials directly through the URL with https:\\credentialuserexample1:credentialpassexample2#thewebsiteaddress.com and it seems to open the page without issue there too.

Related

Difference between running via Firefox versus Selenium WebDriver (GeckoDriver)

I'm trying to scrape my own banking information by automating the process using Selenium in Ruby.
I'm running into a bizarre situation where performing the exact same sequence in the browser (whether just the normal browser or private/incognito) works fine, but when I try to log in under a Selenium-controlled browser I get back a strange 500 error from the server.
I've noticed the browser console logs also look different in terms of certain logging messages related to cookies, JS errors, libraries being loaded, etc.
I have found an answer on SO mentioning one possible difference in Chrome being a specific "cdc" string that might be detectable, but is there some kind of corresponding difference in Firefox/Geckodriver that could be used to detect the fact that I'm trying to automate the browser?
I'm not really sure where to look, because my understand was that running via Selenium should basically have identical behaviour to running via the browser itself.
Would love some guidance on what mechanisms may be in play to explain the difference in behaviour!

How do I kick off a Console App that runs Selenium web driver using a logic app?

I have a Console App that takes advantage of Selenium WebDriver. I'm intending to use this to automate the receipt of an email with an attachment and upload that attachment to a website. The Console App works perfectly. But I'm using WinAutomation to start that process from an .exe on the desktop of a VM.
What I'd like to do is, instead of using winautomation, publish that Console App to an App Service in Azure. This I can do easily. However what I'm wondering is, how would I go about kicking off that App Service and providing the email attachment using a Logic App.
Hope this makes sense
This isn't possible. Selenium requires the use of GDI+ which isn't allowable in an App Service Sandbox. The more plausible course of action is what you're already doing, running your Selenium test during your CI/CD flow on a build agent.

LoadRunner VuGen Script Replay Failing for Citrix Module Login

I am using LoadRunner VuGen to record a test I would like to execute using a Citrix module. I am able to successfully record the actions but when I play the actions back, it stops at the following line of code:
ctrx_wait_for_event("LOGON", CTRX_LAST);
The Citrix ICA Client screen is displayed and it is waiting for the Username, Password, and Domain to be entered by I am unable to manually enter the information in and after a couple a seconds it fails. When I initially record my actions, I am logging into Citrix via a web URL. But when I play back the actions it goes directly to the Citrix ICA Client screen without ever opening the URL.
This is Citrix application where Logging into the Citrix Desktop is taking too much time than the parameterized hence throwing the TimeOut Error.
In the error if the IP address is also mentioned, then it is usually is a citrix connectivity/network connectivity issue.
We had a similar error without any IP address, we did the following which resolved the issue:
Check if there are any active citrix sessions, if yes clear/terminate all the sessions. Then run the VuGen script from VuGen and dont try manually
Upgrade the ICA client if it is older than 13, we are using 14.x version

TFS Build giving different results according to build requestor

We have a TFS (2013) build defined which runs a project of Selenium tests against the web site in the solution (chromedriver). If run locally, by any developer, three of the tests currently fail. The build agent is on a separate box from the tfs build controller and running under a local admin account.
With the code all checked in, if the build is manually triggered by three of the developers, it works as expected - three tests fail. However, if the build is launched by either of the other two developers, almost all of the tests fail, either with a...
System.InvalidOperationException: unknown error: cannot focus element
or
OpenQA.Selenium.NoSuchElementException: no such element
...type of error.
All developers have the same rights in TFS. Can anyone suggest how the id of the requesting user should be able to influence the results of a build being run remotely and under different credentials? (Any solutions would also be appreciated!)
It would appear that this is as a result of screwed up AD Groups on the network.
Since the originating user's credentials are actually carried over to the build process, rather that the local admin credentials being used, we (eventually) discovered some different AD memberships of groups between the developers which impacted the permissions on some folders on the build box, stopping certain resources from being accessed.
Unfortunately the errors raised by Selenium were complete red herrings and hiding the actual cause - difficult to diagnose until we actually ran the builds locally on the build server under the various developers' credentials.

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...