Selenium Webdriver in ASP.NET Core MVC - selenium

I wanted to know if it possible to create a web driver object and keep it somewhere in ASP.NET Core MVC so that I can access the web driver again (maybe in startup)?
Basically, what I am trying to do is: when the user clicks a button in my webpage, it will open the web driver and start performing task and disable the button.
The user can go to other pages but the driver will be running in background because chrome driver is running separately in the server.
The task will download a csv to the server, and once done the the "Start" button will be reactivated and the user can download the csv.
I would like to get your suggestion, how I can achieve this?
Thank you so much.

Related

Robot Framework: Resuming a session after closing the web browser

I'm writing a series of tests with Robot Framework, that involve the supposed user closing the web browser (Chrome) during a session of the tested web-service and then re-opening the browser, automatically resuming the session.
My issue is, that with the Close Browser - Open Browser -combination in Robot Framework a fresh browser is always opened every time, and thus the user is logged out of the service and session is ended.
I tried getting and adding the cookies with the built-in Selenium keywords, but I was unable to resume the session that way. Doing the task manually works as intended.
Apparently it is not possible to attach Selenium to an existing browser session created launched for example by a custom Python keyword.
Is this something that is possible in Robot Framework and what kind of solution should I look for? Thank you.

Opening NX/Catia using Selenium

Is it possible to open NX/CATIA using Selenium. I know we have Sikuli.jar file to interact with Desktop. But after opening the NX/CATIA application, can we do some actions like creating some model or drawing and then saving.
Basically i have a web based Application which is controlled by Selenium. Now i have a step to open with NX/CATIA from web Based Application and then perform some actions
Thanks in Advance.

How to bring browser to front using Selenium WebDriver?

I've a test where it handles login system popup using Robot of Java. But because of some issues, other applications or browser instance come to front and Robot could not perform actions on system popup of Windows.
Hence before interacting with system popup using Robot, I want to bring that browser to front on machine. I tried following but it did not help -
((JavascriptExecutor)driver).executeScript("window.focus();");
Could you please suggest how I can bring it to the front?

Is it possible to use Selenium from within a web app?

I am building a web site in Django that would scrape data from some site, so people could enter the site, set custom data filters and view scraped data in friendly format.
The problem is that requests and beautiful soup modules will not be enough for the scraping purposes, since I will also need some automation to be done (loading javascript or clicking buttons).
Since Selenium requiers a webdriver to be downloaded and put into a path, is it possible to use it from within web app? Like hosting the webdriver somewhere?
I am also open to solutions other than Selenium, if there are any.
I think what you would want is a selenium grid server.
https://www.seleniumhq.org/docs/07_selenium_grid.jsp
Basically you host it on some remote server and then you can connect to it and spin up web drivers remotely and use them in code as needed. It also comes with a handy interface for checking on current browser instances and even taking screenshots or executing scripts from the web ui.

Selenium Golang binding without server

There are many selenium webdriver binding package of Golang.
However, I don't want to control browser throught server.
How can I control browser with Golang and selenium without selenium server?
You can try github.com/fedesog/webdriver which says in its documentation:
This is a pure go library and doesn't require a running Selenium driver.
I would characterize the Selenium webdriver as a client rather than a server. Caveat: I have used the Selenium webdriver (Chrome version) from .Net and I am assuming it is similar for Go.
The way Selenium works is that you will launch an instance of it from within code, and it creates a live version of the selected browser (i.e. Chrome) and your program retains control over it. Then you write code to tell the browser to navigate to a page, inspect the response, and interact with the browser by filling out form data, clicking on buttons, etc. You can see what is happening on the browser as the code runs, so it is easy to troubleshoot when the interaction doesn't go as planned.
I have used Selenium to upload tens of thousands of records to a website that has no API and only a graphical user interface. Give it a chance.