Having trouble interacting with buttons using HtmlUnitDriver, but no issues clicking buttons with FirefoxDriver

I am currently facing an issue with my code that utilizes Selenium HtmlUnitDriver. While I am able to access the website and click on the "except cookies" button, I am encountering difficulties in clicking the "play demo" button. This is puzzling because I am able to click on all buttons when using FirefoxDriver.

Prior to this, I was unable to access any elements using HtmlUnitDriver until I implemented the following: WebDriver driver = new HtmlUnitDriver(BrowserVersion.FIREFOX, true);

If anyone can offer assistance, it would be greatly appreciated as I am determined to make HtmlUnitDriver work for me.

Answer №1

It's possible that this is a typo since there appears to be no space between Pl and ay. In your code block, it should look like this:

//CLICK DEMO BUTTON
wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//button[text()='Play Demo ']"))).click();
System.out.println("DEMO BUTTON CLICKED");

To account for the missing space, you can use the following:

wait.until(ExpectedConditions.elementToBeClickable(By.xpath("//button[normalize-space()='Play Demo']"))).click();

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

Customize the Material UI InputBase component using date and time pickers styling

I have been working on customizing a date time picker option in material ui. After creating a styled Input that I liked, I attempted to use it as a base for my design. When I added the type="datetime-local" prop to the component, it provided the ...

"Utilizing the background feature in a unique, customized compound control

I've created a unique compound control that merges elements from both a Button and a ProgressBar. It features a background attribute defined in my attrs.xml file as follows: <?xml version="1.0" encoding="UTF-8" ?> <resources> <dec ...

Replacing the $http.get function in AngularJS

Here is the code snippet I am currently working with: $http.get(url).success(function(response,status,header,config) { $scope.mymodel = response; } I need to verify the http status and trigger a function accordingly. Modifying all 100 instances of ht ...

Determine the distinct values from two arrays and store them in a separate array using JavaScript

In my scenario, I have two arrays in JavaScript as shown below: First array: count_array[0].left= 0; count_array[0].width= 33; count_array[0].id= 1; count_array[1].left= ""; count_array[1].width= ""; count_array[1].id= 2; count_array[2].left= ""; count_a ...

Struggling to make UiAutomator function properly - unable to locate classes and missing UiAutomator2 driver

Currently, I am utilizing Idea and Android Studio to write my tests with Appium. In order to incorporate UIautomator into my project, I have included a dependency statement in the build.gradle file: compile group: 'androidx.test.uiautomator', na ...

Reveal concealed roster using JavaScript

I am looking for a way to toggle the visibility of items in a list when an input is clicked. The challenge I'm facing is that the page should load with the list hidden, but the code only functions correctly if the list starts out visible. function ...

``The issue concerning the preloading layer on the website``

My experience with the website www.wirecreation.net is sometimes marred by an issue during the initial load. It seems that there is a margin of a few pixels on the gray div containing the logo and progress bar at times, but other times it appears with zero ...

JavaScript errors due to miscalculations Incorrect calculations lead

Here is the formula I am using in my Javascript code: total = parseFloat(unit * rate) + parseFloat(rateamount) + parseFloat(((unit * rate) + (rateamount)) * (tax/100)); The values for the variables are as follows: unit = 5, ra ...

Using a for loop to cycle through an array and generate sibling div elements

I'm attempting to display the content of the gameTwo array in two child divs under the game2 element. However, the issue I'm facing is that the loop creates a child of a child on the second iteration. Could someone provide guidance on how I can a ...

What is the best way to convert a JSON string received from Angular into a Java Object within a Spring

I am currently utilizing WebSocket to create a chat application. Below is the code from my Angular application that sends a MessageModel object to the backend after converting it into a JSON string: sendMessage(message: MessageModel){ let data = JSON.str ...

Encountered an issue while attempting to assess Jackson deserialization for this specific

I am currently in the process of establishing a many-to-many relationship between movies and users. However, I encountered an error while attempting to save a movie: 2017-12-01 16:12:43.351 WARN 17328 --- [nio-8090-exec-5] .c.j.MappingJackson2HttpMessageC ...

Running jQuery scripts through PHP

$("#bt-potrdi").click( function(e) { e.stopPropagation(); $("#belina").css({"z-index":200}); $("body").addClass("ext"); $("#vpisok_frame").css({"z-index":250}).fadeIn(200); }); Upon clicking the button, the ...

Navigating the use of PHP variables in JavaScript

Whenever I select an option from the menu, a Javascript function changes the input value based on a PHP variable. Below is an example of how I assign values from 1 to n to each option: $i = 0; foreach($videos as $val) { echo '<option value=&ap ...

Have you ever wondered why JSON organizes data objects in the format {"city":[{"com.getcity.@FAE87A"}]

String city = request.getParameter("name1"); HttpSession session = request.getSession(); try { ConnectToDb db = new ConnectToDb(); con =db.getConnect(); pstmt = con.prepareStatement("select Name, CountryCode, District, Population from city whe ...

Accessing a parent class constructor object in NodeJS from the Child Class

I'm currently working on creating a Controller Class that will handle the initialization of all my routes using ExpressJS. Below is a simple example of what I have so far: class Test extends Controller { constructor(App) { const Routes = [ ...

Can Redux enable real-time data synchronization across various devices?

In an office setting, there are two computer systems running a shared web application. One system is assigned to the employee while the other is for the admin. When the employee logs in, they see their schedule on their dashboard. Conversely, when the admi ...

Modify a single component of ListView

Looking to update a specific item (ImageView) in a ListView row, I attempted using the onItemClickListener within the provided View. While this did work, I encountered an issue where scrolling caused other rows in the ListView to also change unexpectedly. ...

Utilizing Vue.js to retrieve database information and populate input fields through select options

In my Laravel 8 and Vue 3 application, I have a Student Component with a datalist that lists all the students. My goal is to populate the input fields with the specific student information when clicking on a student. I attempted to use Vue select, which i ...

Unable to retrieve HTML content through a Node.js server

I created a HTML webpage that includes .css, images and JavaScript files. However, when I start my node server using the command below: app.get('/', function(req, res){ res.sendFile(__dirname + '/index.html'); }); The webp ...

What is the best way to retrieve state from a selector after refreshing the page?

In my React JS boilerplate code, I have a container component that retrieves data (such as a list of schools) using sagas into a reducer. The state set by the reducer is then read by a selector function on the render page to display to the user. Sample ...