I can't use subscribewith in kotlin - kotlin

i can use subribeOn and obseveOn but it say Unresolved reference: subscribeWith when i try to use subscribewith so can someone help me?enter image description here

Related

asking for Selenium *find_element_by_class_name

I have tried to get the text from the helpful and unhelpful button but I couldn't succeed:
for example: I want to get "6013" for helpful points and "320" for unhelpful points:
my code is:
product_helpful.append(container.find_element_by_class_name('css-0').text)
product_not_helpful.append(container.find_element_by_class_name('css-0').text)
you can check the picture for your reference:
enter image description here
Use the title attribute to target the helpful vs unhelpful portion of the code
product_helpful.append(container.find_element_by_css_selector('[title="Helpful"] span').text)
product_not_helpful.append(container.find_element_by_css_selector('[title="Unhelpful"] span').text)
Note that for this you must use the find_element_by_css_selector method from the WebElement.

How to replace findViewById in kotlin? (Exoplayer and RTMP)

I'm working with Exoplayer RTMP player but I'm facing this problem.
This is the screenshot and I don't know how to replace findViewById.
I am new to kotlin and really don't know how to replace this. How do I do this?
In Activity :
mEditText = findViewById(R.id.edittext_id)
In fragment :
mButtonContinue = requireView().findViewById(R.id.button_id)
With Kotlin you can directly call the ID of your XML and be done with it, without using findViewById
In your case you can juste use simple_player.player = player
Kotlin doc

How to use findElementsByIosNsPredicate?

Appium 1.6
IOS9.3
I used to find iOS element like:
findElementByIosUIAutomation(".tableViews()[0].cells()[1].collectionViews()[0].cells()[0]")
But in XCUITest, how to use findElementsByIosNsPredicate like that? How to write the predicate string ?
Please help me !
Probably, you can try to use something like:
XCUIApplication().tables.element(boundBy: 0).cells.element(boundBy: 1).collectionViews.element(boundBy: 0).cells.element(boundBy: 0)
But I strongly recommend adding accessibilityIdentifier to the UI elements and use it directly:
XCUIApplication().cells["cellAccessibilityIdentifier"]

ScalaTest+Selenium equivalent of .getText()

I'm new to Selenium and ScalaTest, but I'm having issues finding Selenium+ScalaTest's counterpart to .getText()
For example, when I use selenium-java, I can retrieve text "Cat" by:
driver.findElement(By.id("firstHeading")).getText()
from:
<h1 id="firstHeading" class="firstHeading" lang="en">Cat</h1>
However, I can't figure out how to do this with ScalaTest, and my googling skills have failed me. Any help would be greatly appreciated, thank you!
I've figured out one working solution:
id("firstHeading").element.text should be ("Cat")
This lets me extract the text from an element by the id "firstHeading". Please let me know if there is a better/more acceptable approach. Thanks!

How can i use id to do action on an object of an android using Robotium tool?

I tried to use id to click on the object in an android application but when i enter solo.clickOnImageButton(R.id.action_menu_search); It is showing an error, that action_menu_search cannot be resolved or not a field. How can i use the id of an object to click on the same.
Thank you in advance,
With regards,
David Gayler
Use solo.clickOnView(solo.getView(int id));
Method clickOnImageButton takes parameter as index, not id, so you should use method, which Renas has mentioned.