Tips for automating a javascript web application even without the need for the website or browser to be open

I am currently working on developing a JavaScript-based web application. The webpage I have created consists of just one button, which when clicked, retrieves data from another website and saves it to my Mongo database.

My goal is to automate this process of clicking the button so that the entire data retrieval and storage operation happens without any manual input. Essentially, I want this task to be performed automatically at predefined intervals (e.g., every day at 6 PM).

Although I have heard about Selenium as a potential solution for automating this task, I am unsure if it can achieve what I need. Furthermore, I have attempted to use the tool by downloading a '.jar' file but have been unable to get it to work. Any guidance or assistance would be greatly appreciated!

Answer №1

It is possible to automate button clicks using selenium, but keep in mind that selenium simulates human interaction by opening a web browser. While this method can be effective, it may consume more resources than desired.

Instead of relying on GUI automation, have you considered setting up the data retrieval process to run through a console command or another method that can be easily automated?

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Occasionally I encounter the message: "Error: Server unexpectedly terminated with status 1."

I created an automated test to check the login page, with testing data stored in a JSON file. Here is the code in index.js: const fs = require("fs"); fs.writeFileSync("testReport.json", "{}", "utf-8"); const { login } = require("./tests/login"); const au ...

Method for capturing a screen grab in cucumber using a tag name

The code snippet below is written in Selenium/Java, and my goal is to parameterize it by adding the tag name for which the screenshot needs to be taken: @Then("^Take Screenshot$") public void tearDown() { // Take a screenshot at the end of every tes ...

Passing multiple parameters in URL for APIs using Next.js

Is there a way to pass multiple parameters and retrieve results from the next.js API? I found the documentation very helpful, you can check it out here /api/posts/[postId].js The above setup works fine, but I want to know if it's possible to pass an ...

JSON Eval function encountered an identifier that was not anticipated

Here is a code snippet that I found for rating a page. It works perfectly on my local machine, but once I upload it to the server, it throws a syntax error. function rtgAjax(elm, ratev) { var cerere_http = get_XmlHttp(); // get XMLHttpRequest object ...

Include and remove JSON data items within ng-repeat loop

I am in the process of creating a dynamic page where users can add multiple locations to their contact information. Currently, my code looks like this: <div class="input-append" ng-repeat="location in newPartner.partner_location"> <input clas ...

What is the best way to format or delete text enclosed in quotation marks within an anchor tag using CSS or JavaScript?

I have encountered an issue with a dynamically generated login form. When I select the 'Forgot Password' option, a new 'Back to Login' message appears along with a separating '|' line. Removing this line is proving challenging ...

Retrieve a list of IDs specifically for the array objects that have been modified in Mongodb

In this instance, I am showcasing a snippet from my "messages" collection. {[ _id: xxx, shipment: { _id: xxx }, messages: [ { _id: 123, origin: 'driver' isRead: false, ... }, { _id: 234, ...

Utilizing JavaScript for validation on an ASPX page within Visual Studio

After entering an email ID in a textbox, the email validation process is initiated. However, it seems that there is an issue where the entire function may not be executed properly. <head runat="server"> <title></title> ...

What's the best way to streamline login steps in Selenium Cucumber and eliminate redundancy in feature files?

In my automation project, I am using Selenium along with Cucumber and writing the scripts in Java. One of the feature files contains 4-5 login steps that are repeated in every scenario. Below is an example of the login process that appears multiple times: ...

Utilizing jQuery AJAX to Send an HTML Array to PHP

In my current HTML forms and jQuery AJAX workflow within the Codeigniter Framework, I've encountered a common issue that has yet to be resolved to suit my specific requirements. Here's the situation: HTML - The form includes an array named addre ...

The integration of cypress-cucumber-preprocessor with multiple testing frameworks appears to be experiencing compatibility issues

I am trying to set up a connection between Cypress and Cucumber, and I came across this plugin: https://www.npmjs.com/package/cypress-cucumber-preprocessor However, I am having trouble with my implementation as it seems to be missing. I have also added th ...

Applying specific style properties in styled-components can vary based on certain conditions

Is it possible to apply multiple properties at once? const Button = styled.div` color: blue; opacity: 0.6; background-color: #ccc; ` I want to apply styles for the active state without having to specify conditions for each property individually. Ho ...

When using Typescript with Mongoose, you may encounter the error message "Property 'x' does not exist on type 'Document'"

Here is my custom Mongoose model used in conjunction with TypeScript: import mongoose, { Schema } from "mongoose"; const userSchema: Schema = new Schema( { email: { type: String, required: true, unique: true, lowerc ...

Guidelines on maintaining an active getSelection with JavaScript

I need help figuring out how to change the font size of selected text within a div without losing the highlight/selection when I click a button. Can someone assist me in keeping the text highlighted while also resizing it upon clicking the button? ...

An exception was thrown: Access to the property '__qosId' is prohibited due to permission denial

While attempting to automate email sending on Microsoft Outlook/Hotmail, I encountered an issue with Firefox Webdriver. It was working fine until the login stage, where it started throwing the exception org.openqa.selenium.WebDriverException: Permission de ...

Optimizing Instagram Performance with Selenium's Multiprocessing

Greetings everyone, I hope you're all doing well. I'm currently working on running multiple Instagram accounts simultaneously using Multiprocessing and Selenium. I need assistance with the process of logging into different accounts for each creat ...

What would be the counterpart of setLocale in Yup for the zod library?

How can I set default custom error messages for Zod validation? If I want to use i18n for error messages in Yup, I would do the following: import { t } from "i18next"; import * as yup from "yup"; import "./i18next"; yup.setL ...

Implementing a Jquery check based on a checkbox

Hey, I'm having an issue with a condition. When I uncheck the checkbox, it doesn't uncheck. I've tried to make a block display, but the JavaScript isn't working. I attempted to add: document.getElementById("Reload").style.display = "b ...

Angular encountered an issue while attempting to differentiate '[object Object]'. The permissible types for differentiation are limited to arrays and iterables

I need help iterating through an Object received from a service call and displaying it in a table using *ngFor. Unfortunately, I encounter the following error during this process: Error trying to diff '[object Object]'. Only arrays and iterables ...

Guide on generating a multi-select dropdown list using numbers in JavaScript or React.js

In my current project simulation, I am tasked with choosing an option that corresponds to a number (1, 2, 3, 4, 5, 6....). For example, selecting option number 3 will dynamically generate 3 input elements. ...