Unable to start the AndroidDriver

This chunk of code is giving me trouble:

WebDriver driver;

driver = new AndroidDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

I keep encountering this error:

The type org.openqa.selenium.remote.service.DriverService$Builder cannot be resolved. It is indirectly referenced from required .class files

Any suggestions on how to resolve this issue? I've already included selenium and appium java client jars in the build path->Libraries.

Answer №1

It appears that the android driver is being called incorrectly. To properly initialize an Android driver, please use the code snippet below:

AppiumDriver driver;
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

Ensure that Selenium server and the Appium Java client jar file are included in your classpath for this to work correctly.

Answer №2

It appears that you have the older version of Selenium standalone server jar installed. I recommend updating to the latest version, specifically "selenium-server-standalone-2.48.2", in order to resolve your issue.

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

Unable to view PhantomJS webpages in desktop mode; they consistently display in mobile mode

I've been struggling to resolve this issue using various resources, but haven't come across any that address my specific problem. My current project involves developing an automated Python script to log in to my Facebook account and utilize its ...

What is the most effective method for identifying elements on Google Translate using Selenium?

In the past, the class names used to be somewhat meaningful such as .tlid-open-source-language-list, but now they seem to consist of random combinations like VfPpkd-Bz112c-LgbsSe VfPpkd-Bz112c-LgbsSe-OWXEXe-e5LLRc-SxQuSe yHy1rc eT1oJ qiN4Vb KY3GZb szLmtb ...

Python Selenium is able to locate elements by their class_name successfully, but encountering issues with locating the same element using XPATH

I am currently extracting reviews from individual hotel pages on TripAdvisor in order to retrieve the star rating for each hotel. Link to the TripAdvisor hotel review page The specific HTML code for the div containing this information is as follows (I ha ...

Tips for managing the onblur event using selenium automation framework

I want to trigger an onblur event when I click away using JavaScript. I tried the following code: ((JavascriptExecutor)getDriverProvider().executeScript("document.getElementByXpath('xpath here').onblur();"); However, it doesn't seem to wo ...

Using AJAX to send a request with an image to a Spring MVC controller

I am attempting to utilize AJAX to send an image: function uploadImage() { var image = document.getElementById('image').files[0]; var formData = new FormData(); formData.append('image', image); $.ajax({ url: &ap ...

Utilizing Selenium with Java: Extracting Data from a Single Dropdown Menu (Time Selection)

Hey there: I am facing an issue with extracting data from a calendar field. I am trying to extract the information (HH.MM.AM/PM) from a single date field, but so far, it has been unsuccessful. This is the code snippet I have been using: WebElement currT ...

Using Selenium Webdriver with Python for navigating through classified ads on leboncoin, encountering difficulty in selecting a dropdown list and input box

Continuing my journey on the Python/Selenium learning curve. Selenium Webdriver - Python - leboncoin - Issue with selecting a button containing an accent After successfully logging in to the site and selecting the button, I aim to populate the fields for ...

Issue with Protractor locating element even though everything appears to be in order

I'm having trouble locating this element with Protractor. It's really frustrating me. I double-checked in the dev console and the element definitely exists. Any suggestions on why it's not being found? <download path="api/backup_jobs/e ...

Exploring Selenium testing with Maven scope

Exploring the impact of 'scope' in a pom.xml file for a Selenium project dependency. Here, we will compare two examples: <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId&g ...

Choose an option from a dropdown menu using the <span> tag in Selenium

I've been attempting to choose an option from a dropdown list, here is the HTML snippet for reference. Trying to choose 'Health Care' from the dropdown. <span class="select2-container select2-container--default select2-container--open" s ...

How can Python, Selenium, and Parsel be used to extract text from a DIV element, even if it contains a varying number of

Currently in my Python and Selenium project, I am utilizing an xpath class selector to locate a specific div that contains text I need to extract. The challenge arises when this div may either be empty (which I have handled) or contain anywhere from 1-3 s ...

Python's Selenium now has a Firefox web driver option available

I'm having trouble using Selenium 3.0.1 with Firefox 48 on OS X in Python 3. When I try to initialize the Firefox webdriver, it throws an error. from selenium import webdriver driver = webdriver.Firefox() The error message is as follows: ---------- ...

Attempting to identify and automatically fill out a form using RSelenium

I am currently facing an issue with detecting and populating elements in an embedded form on my website using RSelenium. The form code is: <div id="form"> <form accept-charset="utf-8" method="POST" novalidate=""> ...

Ways to incorporate several source folders to your pom.xml file

I encountered an error stating "package org.testng.annotations does not exist" while attempting to compile multiple source directories using Maven. In my case, I am performing webdriver tests and all test files are importing import org.testng.annotations. ...

Enhancing Android app efficiency by improving performance in accessing Json file data from various classes

As I delve into utilizing Json files for my app, the question arises regarding the most efficient method to store and access this data across multiple classes. Currently, I am working with a Json file containing various currency conversion rates. The chal ...

Utilizing Xpath and CssSelectors for identical tags, attributes, and elements

Creating Selenium tests for multiple buttons with identical code: <div class="item"> <div class="head"> <a class="title caps_style primary-color-text"href="https://www.www.www/link/link-link-complex-api-testing" target="_blank">Ra ...

Python Selenium Webdriver: Iterating through data with a for loop

I am attempting to extract text from a specific website link. I want the information that is available on this webpage: . In order to do so, I have written code to retrieve this text like below: driver = webdriver.Chrome(driverLocation) driver.get('h ...

Guide to verify the appearance of a Facebook popup when clicking a button using Selenium

As I create a step definition for a Cucumber Scenario, in the When clause I click on a button that triggers a popup window for sharing on Facebook. I am wondering whether the driver will automatically focus on the popup window? Or do I need to access it ...

When executing Parallel Testing and encountering a java.lang.NullPointerException, it is recommended to invoke another

Encountering a challenge while running Parallel Tests using Java, Selenium, and TestNG. Two test methods are searching Google for different keywords, and I am looking to create a third method to avoid duplicating code. public class googleTestClass extends ...

Retrieve the content of the element if it exists

Is there a way to extract the text of a web element if it is visible on the screen? The application I am currently automating sometimes shows an unexpected error alert along with an error code. I am looking to develop a listener that can capture the text ...