How to simulate click on button Flutter WebView - flutter

I am using the package webview_flutter. How can I simulate a button click? I tried using the controller to run some javascript:
controller.evaluateJavascript("$('.mybuttonclass').click()")
Unfortunately It seems we cannot use JQuery here as I received a '$ not found error'. Is there a possible workaround?

Try
document.getElementById("myButtonId").click()
Or getElementsByClassName

Related

Using flutter_inAppWebView, how do I programmatically close the web view?

I'm using flutter_inappwebview and I've got it working, but I want to programmatically close the web view and trigger onCloseWindow to emit an event.
I'm tried importing things like dart:html as html to try to use html.window.close but my linter doesn't seem to like that. I get Error: Not found: 'dart:html and Error: undefined name windowon top of a warning:Avoid using web-only libraries outside Flutter web plugin packages.`.
How do I close this window to trigger onCloseWindow?

Rename in Ionic select button cancel and ok

I am working with the Ionic Framework.
In all of my forms i am using the ionic select do display some options.
It works perfectly. But its showing 2 buttons in english: cancel and okay.
I would like to rename this buttons in another names due to the language.
Where can i do this? I looked and searched the whole directory but could not find anything. It looks like the ionic is building them somehow. Or do i need some more js to rename this?
From the manual at https://ionicframework.com/docs/api/components/select/Select/
By default, the two buttons read Cancel and OK. Each button's text can be customized using the cancelText and okText attributes:
<ion-select okText="Okay" cancelText="Dismiss">
...
</ion-select>
okText actually didn't work with my Ionic 5.4.4 version. I used doneText instead and worked just fine.

How to scroll through a UIACollectionView and click on a button?

I'm trying to perform a scrollTo method within UIACollectionView control , but with no much success so far , I've tried to use TouchAction.
Any idea how I can perform a scrollTo ?
java_client 2.2.0
appium 1.3.6
IOS 8.1
First just look for the String on the bottom of the screen where you want to scroll. And then use scrollTo(String)

using protractor mouseMove to click on a drop-down

I am using the following to get protractor to click on a drop-down menu.
ptor.actions().mouseMove(
ptor.findElement(protractor.By.xpath("//a[#tooltip='Portfolios']"))
).click();
However this does nothing which is to say that the drop-down does not get clicked and no errors are displayed.
What am I missing here ?
For the benefit of those who landed on this page. The solution is to use .perform at the end.
here is the working version
ptor.actions().mouseMove(
ptor.findElement(protractor.By.xpath("//a[#tooltip='Portfolios']"))
).click().perform();
Actually you don't have to use actions, with actions you can not select option that is not currently visible in the screen.
use this:
element(by.xpath("//a[#tooltip='Portfolios']")).click();
I suppose you should only use perform, like:
ptor.actions().mouseMove(
ptor.findElement(protractor.By.xpath("//a[#tooltip='Portfolios']"))
).perform();

iOS plugin for PhoneGap not called when click

I use an iOS plugin for PhoneGap, my plugin works fine when I call him directly, the problem is when I called my plugin at the click event
callNativePlugin('success');//Working fine
$(".Button").on('touchstart',function(){
callNativePlugin('success');//Not working
});
Are you sure that the ".Button" selector is matching an HTML element in the page?
i.e. does this work?
$(".Button").on('touchstart',function(){
alert("touchstart worked");
callNativePlugin('success');//Not working??
});
yes, in fact the problem was a simple javascript conflict that prevented the execution of the event click.
Thank you