How to write a selector for an element with a class that has a $ sign

I am working on automating mobile tests. Basically I am trying to select a new date in the Android emulator using APPIUM with Eclipse (HELIOS) with JAVA. Class name for timer:

android.widget.RadialTimePickerView$RadialPickerTouchHelper

As you can, there is a dollar sign ($). If I use the following syntax.

List timeButtons = driver.findElements(By.xpath("//android.widget.RadialTimePickerView$RadialPickerTouchHelper"));

I get an error with an invalid XPATH / CSS selector.

+4
source share
3 answers

Your XPath is not valid. There is no item android.widget.RadialTimePickerView$RadialPickerTouchHelper. Do you want something like

driver.findElements(By.xpath("//div[@class='android.widget.RadialTimePickerView$RadialPickerTouchHelper']"));

You will want to replace the part DIVwith the element that contains this class.

0
source

, , , , .

List <WebElement> allElements = driver.findElements(By.classname("android.widget.RadialTimePickerView$RadialPickerTouchHelper"))

0

I don't know if that would work. The project was minimized. If I come across the same situation, then I will try this solution.

0
source

Source: https://habr.com/ru/post/1655971/


All Articles