Here is the code snippet I am using: @Value("${app.user.root}") private String userRoot; This code helps me to fetch a constant value from my application.properties file. Within my GetMapping method, I need to redirect to the error page and pass a S ...
In my recent project, I encountered an issue with a NodeJs program that receives periodic data from a Java code. The problem is that sometimes only the header of the data makes it through, while other times both the header and the body successfully pass. H ...
I am encountering an issue with a call: $.get("${pageContext.request.contextPath}/maze/View/${maze}", function(response){drawMaze(response);}); within a JSP file. This call triggers the following Java code: protected ...
This project serves as a demonstration, utilizing the Page Object Pattern and Data-driven framework for implementation. Within this project, concepts of inheritance and constructors are applied. The configuration file config.prpoerties contains details s ...
When utilizing the executeScript() method from the JavascriptExecutor interface in Selenium WebDriver, what do arguments[0] and arguments[1] signify? Additionally, what is the function of arguments[0] in the following code snippet. javaScriptExecutor.ex ...
I have a piece of code that retrieves all the data from the JSONPlaceHolder REST API and converts it into an array. Afterwards, I collect input from text fields in my program to create a JSON Object with that information. Now, I want to send this JSON Obje ...
In my Java method, I am trying to create a wait for a specific XPath. If the wait times out, instead of throwing an error, I want to return either null or the element if it is found. To achieve this, I can use try/catch and handle an exception that indicat ...
I am faced with the challenge of parsing a JSONArray that may or may not include an "attachmentPoint" element. Here is an example of the JSONArray structure: [{"entityClass":"DefaultEntityClass","mac":["86:2b:a2:f1:2b:9c"],"ipv4":["10.0.0.1"],"ipv6":[], ...
In my setup, I have a Spring REST backend that communicates with an Angular frontend. For authentication, the frontend sends a POST request to the "/login" URL with the username and password in the request JSON body. The backend responds with an OK code, ...
I've been working on an app and I'm facing some challenges with handling data that contains diacritics or other UTF-8 characters. The specific characters causing issues for me are: ă-Ă-â-Â-î-Î-ş-Ş-ţ-Ţ. Initially, there is an input fiel ...
One interesting aspect of my work involves a genetic class parameter public static <T> T parse(String json, Class<T> clazz) { T result = null; result = mapper.readValue(json, clazz); return result; } Imagine there is a JSON object l ...
I'm experiencing an issue with this error. I created a favicon parser from URLs using the following code: public class FavIconParser { public static String extractUrl(String url) { StringBuffer sb = new StringBuffer(); Pattern p = Pattern.compile ...
I attempted to develop a Java program to monitor the availability of reserved spots on this website: However, when I examine the page source using Chrome or Edge, only <cbn-root></cbn-root> is displayed in the body section. Yet, utilizing Chro ...
I have been using PhantomJs in conjunction with Selenium for headless automation and it was functioning perfectly until today. However, I encountered the following exception when trying to initialize the PhantomJs driver: The code snippet that led to the ...
We are facing a challenge in producing a unique string format: "/Date()/". It is important to note that backslashes do not function as escape characters in this case; rather, they represent the literal string. Our .NET team member suggested using syntax ...
I have a desire to create a button within a web browser that, when clicked, will either copy the current URL address into a file or open another web browser and paste it there. Being new to programming, I am unsure of which language to use for this task. ...
I have a situation where I am trying to trigger an Ajax javascript function from my jsp file, with the intention of loading a servlet for further processing. The issue I am facing is that even though I am able to pass values from the jsp to the ajax functi ...
I am currently exploring ways to establish communication between PHP and Java. My goal is to have PHP pass an ID parameter to a Java file, where Java will process the ID and return an array back to PHP. I have researched various methods such as PHP/Java ...
Having trouble switching frames properly. The project is a maven project with the following pom.xml: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.o ...
Currently, my Selenium code is working perfectly fine. However, I am looking to convert this code into HtmlUnit. I know I can use the HtmlUnitDriver like WebDriver driver = new HtmlUnitDriver(); I want to make it purely HtmlUnit. Below is the code that I ...
Looking to extract data from a JSON file that contains objects with dynamic fields. Take, for example, the "items" section which includes objects with unique identifiers like “1c68b853-2a07-4409-ad61-8650212f3260” along with additional attributes. Ther ...
As we transition our web application from Glassfish 3 to Glassfish 5, an error appeared during the migration process for a particular request. [2019-09-17T15:57:30.732-0600] [glassfish 5.0] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=241 _ThreadNa ...
I am struggling to locate visible elements on a web application page using Selenium. Specifically, I need to identify a clickable row and then click on it. The challenge lies in the fact that these elements are dynamically generated and do not appear in ...
Exploring json handling for the first time using retrofit to interact with an API. The unique ID "f9dcf2ef-8647-46c1-b1cc-7e2bb6c3caa2" varies whenever the username in the URL {username} is changed. { "status": 200, "foundmatch": true, "requested": ...
As an Automation Quality Assurance engineer, I utilize Eclipse, Java, and Selenium for the majority of my automation tasks. Currently, I am creating scripts that involve generating a unique number as one type of user (user 1) and then searching for that sp ...
I need to pass the boolean value returned by my controller method to the view, where I can display an alert message based on this flag. Here is my controller code: @RequestMapping(value = "/testing", method = RequestMethod.POST) public Boolean testing(@Re ...
I am encountering an issue while attempting to send a List of data as JSON from my Spring Controller. The error message "Could not find acceptable representation" is being thrown. Below are the snippets of code from different parts of my application: pom. ...
My code looks like this: $.ajax({ type : 'POST', url : 'classfication_of_productjson.html', dataType : 'json', data : { "search_bunrui_code ...
It is important to note that the following two URLs should be considered equivalent: http://localhost?asdf=1&qwer=2 http://localhost?qwer=2&asdf=1 However, when using the 'equals()' method from the URL class, they are identified as different. How ...
After examining the JSON String that I was expecting, here is what it looks like: { "startDate": "2013-01-01", "columns": "mode , event", "endDate": "2013-02-01", "selection": { "selectionMatch": "123456789012", "selectionT ...
After updating my Chrome browser to version 78, I encountered an error when trying to run any automation code. To resolve the issue of timeout while connecting to ChromeDriver and related test frameworks, ensure that ports are protected from access by mal ...
I need to programmatically click on a button with the text "Settings", ignoring the letter case. Here is my code snippet: WebDriverWait wait = new WebDriverWait(driver, THIRTY_SECONDS); return wait.until(ExpectedConditions.presenceOfElementLocat ...
Related Question: Exception is NULL always I'm facing an unusual issue involving an IOException object that I haven't been able to resolve. The code in question is as follows: try { // This section may not be critical, but it could be related to the ...
For my Java Spark project, I need to access a third-party API The API endpoint for a GET request is: I am seeking guidance on how to connect to this API using Java Spark and handle the response Upon attempting to access the API, the response returned wa ...
I need some help with a specific issue I'm encountering. I have retrieved a JSON string from MongoDB and I am trying to extract all the values of 'photo' and store them in an ArrayList. Despite finding examples online, I haven't been successful in making ...
Within my data object, there is a combination of primitives and data objects from external libraries that I am utilizing in my project. Although I can use the @JsonView annotation to control which data is returned to the browser during Ajax calls, this app ...
Recently, I have started learning about Selenium Web driver and Grid 2. While attempting to execute a test case, I encountered an exception: Exception in thread "main" org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find ...
Is there a specific way to determine if certain texts are present on a webpage? It would be ideal to check multiple texts at once. For instance, checking for "client", "customer", and "order" in the page content. Below is an example of the HTML code snip ...
I am working on a webpage that displays various coordinates (longitude, latitude), and I need to create a Java class to sort these coordinates. My plan is to send the coordinates to a Java servlet before displaying them on the webpage. The servlet will th ...
I am attempting to parse JSON on Android, and after parsing the JSON, I want to convert the inputted ID in Edittext to a char array. However, I am encountering a NumberFormatException. I don't think this is a silly question, but where could the prob ...
It's my first time trying out POJO and Lombok in combination with Rest Assured for handling complex JSON data. I opted for this approach due to the extensive number of fields present in the JSON structure. Here is an illustration of the JSON format: ...
Greetings, Currently, I am engaged in a project that involves allowing the user to import/export program data into a JSON file. The data is of type TreeMap<String, List<Observation>>, where Observation is a class containing LocalDate date and ...
Looking to conduct document clustering using JSON String data containing various key-value pairs of String and Number types. The goal is to cluster documents based on similar types of keys and values. For example, consider the following JSON Document: {" ...
Just started using the selenium framework and created a method to check for the presence of an element. Here is the method I came up with: public class WebUtlities { WebDriver driver; public void waitforElement(WebElement element) { W ...
Looking to automate SAP Fiori (Browser) using Selenium in Java. Are there any external tools that need to be installed or specific SAP configurations that need to be enabled in order to successfully read elements within the Fiori interface? Attempts have ...
When trying to input a salary into a tax calculator website, I encountered an issue where an arrow_up or arrow_down key needed to be pressed in order for the tax amounts to be calculated instead of using the enter key. Despite researching online and findin ...
When attempting to deserialize a JSON field with values of 0, 1, or null into a "Boolean?" data type, the following custom Annotation is used: @Retention(AnnotationRetention.RUNTIME) @JsonQualifier annotation class BooleanType class BooleanAdapter { @ ...
Looking for assistance with masking specific fields in JSON request and response logs. I want to be able to print the JSONs in the log while avoiding displaying certain secured fields. Here is an example: Original JSON: {"username":"user1","password":"12 ...
Upon completing the registration process on the website, I am sent my login credentials via email in the following format: some text / login: [email protected] / password: example123 / some text I am struggling to extract and copy just the l ...
Working with two classes that have a one-to-one relation, I have successfully retrieved their data and displayed it in HTML using REST service and AngularJS. However, when attempting to display the airport ID on the asset page using {{asset.airport.id}}, n ...
I am looking for a way to manage this exception in Java and Selenium. In my current code, I have implemented the following: Alert alert = driver.switchTo().alert(); alert.accept(); driver.findElement(By.xpath("//*[@id="btnGoCon ...
Take a look at this piece of code: public class MyClass { public static enum MyEnum { ENUM_A("This is option A"), ENUM_B("This is option B"); private String description; private MyEnum(String desc) { this.description = desc; } ...
My application features a 3D map of a city with an "Add building" button. Upon clicking this button, a model of a building should be inserted into the map. However, all I see is a selection marker at the intended location without the actual building appea ...
I implemented the selenium framework and included this dependency. However, I encountered an issue where the browser wasn't being invoked due to Chrome version 116. <dependency> <groupId>io.github.bonigarcia</groupId> <art ...
My current situation involves the following structures: public class Zoo{ int id; String name; List<Animal> animalList; List<Bathroom> bathrooms; } public interface Animal{ //animal has some common methods, but is mostly for naming ...
My character encoding is currently set to ISO-8859-1. I'm utilizing an AJAX call with jQuery.ajax to communicate with a servlet. After serialization by jQuery, the URL appears as follows: https://myurl.com/countryAndProvinceCodeServlet?action=getPro ...
I'm looking for some clarification on the interview question related to the pom.xml file: Aside from managing dependencies in Selenium, what other purposes does the pom.xml file serve? ...
When attempting to make an httprequest within an ajax call, I keep encountering an internal error. However, I have confirmed that the http request call is correct outside of the ajax call. What could be causing this issue? Below is the code snippet: http ...
Utilizing the Streaming API provided by Jackson for parsing JSON strings, I have a requirement to recognize "YES" as a boolean type. JsonFactory f = new JsonFactory(); Following that, I proceed with: JsonParser jp = f.createJsonParser(jsonString); Then ...
I'm trying to extract specific fields from a JSON object. Here is an example of the JSON data- { "id": "100000224942080000", "name": "Tech Geeky", "first_name": "Tech", "last_name": "Geeky", "link": "https://www.facebook.com/tech.geeky", ...
Requirement: I need to update fields on a URL and click a button using Selenium. (See screenshot of webpage & HTML details below) Problem: An error is being returned as displayed below Error Message: Exception in thread "main" org.openqa.selenium.Elemen ...
When logging in to Yahoo mail, the cursor automatically focuses on the Yahoo ID text field. I need to confirm whether the cursor is indeed focused on the Yahoo ID field. Here is the HTML code for the text field: <input name="login" id="username" maxlen ...
I am trying to interact with an iframe video on a webpage. Here is the code snippet for the video: <div class="videoWrapper" style="" xpath="1"> <iframe width="854" height="480" src="xxxxxxx" frameborder="0" allow="autoplay; encrypted-media" all ...
Upon clicking a button labeled "Go" in my code, a new window is opened. Strangely, when checking the task manager, I notice that there are two instances of IE running. However, despite this, the method getWindowHandles() fails to retrieve the handle of the ...
Can anyone help me figure out how to change the text of a button when it is hovered over? Approach: if (button.isHover()){ button.setText("new message"); } I'm open to either a css fix or a code solution! ...
I have been assigned a task that involves working with multiple observables in a specific way: The goal is to emit two observables (obs1 & obs2), process their results, and then call another observable (obs3). It's important that while processing the resu ...
Is there a way to determine the size of a list in a velocity template? I am currently working with version 1.4 of Velocity. List<String> list = new ArrayList<String>(); ...
I'm in the midst of a project automating tasks, where I have designed a basic program to generate testing reports and capture screenshots. package ReportTest; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; im ...
In my current project, I am dealing with a lengthy JSON text that contains movie titles. I need to extract these titles from the following pattern: ((((((( .","title":" AND ","type":" ))))))) After researching other solutions, I came across one appro ...
After completing a form and clicking the submit button, I aim to delay checking for the newly inserted data in my view until the call is made. I'm exploring ways to make this work. Upon inspecting the page markup, it seems that the view refreshes automati ...
Is there a way to retrieve an Integer instead of a Long from JSON data? When working with JSON in Java, I encounter an issue where the parser returns numbers as type Long, but I need them to be Integer. I attempted casting the long value to an integer, h ...
I'm currently working on a large Liferay project and have encountered a specific issue: Whenever something in the system is loading or processing, I need to change the cursor to a waiting GIF. While this is simple when using Ajax, there are many instances ...
When I upload an excel file from my UI using an ajax-post call and try to read it from my backend Restful service Java code, I am encountering issues in printing the excel file contents correctly. Although the file name and other attributes are printing co ...
Is there a method in Eclipse debugger to determine if a Selenium element is stale? org.openqa.selenium.StaleElementReferenceException: The element has become stale and is no longer attached to the page document. ...
Recently began using wiremock and encountered a situation where I need to mock a GET request with a specific json response. When including the json in the expected response like this; .withBodyFile("product.json")) I'm getting an error saying java. ...