Selenium c# MSTest Specflow execute tests to another device - selenium

in my job we have a .NET custom application for testing, we are sending API Requests to another PC where the IIS Express web server is up and running with 81 port. after that test execution starts.
Now I've implemented the MSTest+Specflow project with selenium c# / VS19. on my local machine, it works perfectly, executing/extending reports.
I'm interested in which way can be achieved to send API Request or something to another PC that will starts executing tests. (I have access to that computer with RDP), I don't wanna connect via RDP every time I want to execute tests. for example, sending API Requests via postman to that IP address which will start execution automatically will be perfect.

Related

Is it possible to close remote web driver connection and initiate a new one for long running tests in Selenium Serenity

We have a remote test execution framework working fine against a cloud vendor for real browser/mobile device testing. When tests grown complicated with several steps and a lot of examples/test data under a scenario, the connection is lost between the remote site and local client resulting in test failures/errors.
Looks like when the framework is ran, it initiates driver and opens a single http connection (long lived) and a new session is initiated for every test scenario in the same connection. Also framework is doing a lot of SYNC calls in background for keeping that connection alive.
We have tried headless mode, disabling screen/video at the cloud providers end, but still fails if there is any interruption in public cloud connection.
The core reason would be unstable internet connectivity to hold for long running test cases. We don't have the budget to explore private cloud offerings. The only solution would be somehow instruct serenity to close and initiate a new connection for long running tests.
Does anyone has any idea if this can be achieved in Serenity? Any one already explored the same?

Captcha is present when running selenium automated tests on Windows server

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?

Robot Framework executing test on RDP client

I have my robotframework setup on my PC.
I would like to connect to a remote windows client, have it open a browser and access a URL.
Verify that the pages has loaded.
Pretty basic but since I am new to RF, I wanted to know how that would work.
For Linux machines, I would use the SSHLibrary and just execute commands (wget) but for the windows machine, I need to use the browsers.
Do I need RF installed on the destination client RDP?
Do I need the webdrivers for each browser on the client RDP?
How would I go about logging in the Windows machine through RDP?
After Logging in with RDP, I run the same "open broswer" with broswer and URL?
Thanks!!!
The use case you describe - a browser to be opened & controlled on a remote machine, is precisely what Selenium solves.
Though in day-to-day work or debugging we are usually starting a local browser, SE is preliminary designed for remote execution. So head to www.selenium.dev, and focus on the Grid - that's the component you are after.
I'm that approach, answers to your specific questions:
no, you need Robot Framework and selenium library on the local machine, and only selenium & webdriver on the remote.
you don't need the drivers on the client - the selenium library is all you communicate with in your code; you need them installed in the remote only.
on the local you will get the logs of the webdriver commands execution; actual browser manipulation logs are only on the remote and the hub (but these are really debugging ones, everything high-level for the functional execution is local).
you don't really log into RDP with this approach (RDP is totally out of the picture here), and yes - your code is the same as running on local browser - Open Browser, Get Text, etc - but, executed on a remote machine.
If you want to see why 1) and 2), head to the answer over here (shameless plug 🙂)

Using Electron based app as a web server

I'm developing a cross-platform application (Windows/Linux/macOS), which:
Should be able to run locally as a desktop application
Should be able to run on a remote machine, preferably with the same UI as on local.
So far Electron looks good enough for the first bullet.
The question is about the second one. I'd like to reuse both the logic and the UI from the local scenario for the remote scenario. In other words, I'd like to use Electron based application as a web server and connect to it via browser.
Is there any way to do that?
You can create a remote web server without Electron, just with Node.js, and deliver a web page like a PHP server for example.
But if you want to deliver a complete remote UI and manage the window remotely, that's VERY complicated to do... That needs to configure a lot of things and manage connections between client and server, using asynchronous keyboard & mouse and encryption to secure the communications.
You want a hybrid app I think, like a few of them that out out there (i.e. Slack). Generally there's a web app plus an Electron client version with some shared UI code but it's not Electron all around. The main point of electron is to be a local web server acting as a desktop app. You could certainly keep it all node though.

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?