Set Value On Custom WebView Problem!

Hi, I am new here, and I was looking forward to finding someone to help me …

I want to control any website automatically via the webview, and I have done the search and succeeded in completing the following …


Use this code to click on the item


Use this code to focus on Textbox


This is to enter a value for Textbox

But when I use the last code, that is the result
Screenshot_4

The text is just as floating.
And when I click post, it gives me a notification that there is no text
I tried a lot and tried more than one java script code …
Also, I tried to focus first on Textbox and then do that step, but there was no result
And I tried to focus, then press Paste from the keyboard … and it worked ,
But I want to control it automatically from the blocks

I need help ,plz :smiling_face_with_three_hearts:

1 Like

any one can help me ?

I recommend to use id instead of class name.

1 Like

But in facebook for example , no id for use …
That is why I am using Class name …

The problem is that everything (Click and Focus Events) works except the text box ( Value Event )

There is no other solution? :frowning:

Can you show a screenshot of inspect element?

Yes Sure

when i used id in facebook ( id=“uniqid_1” ) , i had nothing

and i blogger , no id to use …

:face_with_head_bandage:

Was your query like this?

document.getElementById("uniqid_1").value = "value to set";

You can also try:

yes , it was .

but not work

Use the last line in another block, except switch “.value” with “.placeholder” and the string to an empty string.

i tried this with class name & id , but not working

@hammerhai meant this:

document.getElementById("uniqid_1").placeholder = "value to set";

Hello @Sara_Wilson,

Sorry for keeping you waiting for a response. Try typing something into the textarea yourself and then take another screenshot of the elements tab.

Thanks (:

yes , i tried that …

but not working :frowning:

Then read @hammerhai 's previous post.

you mean like that ?

Yes! Now just repeat the same process for Facebook and we can continue from there.

Sorry for late reply

I should’ve been more clear @Sara_Wilson, I need you to type in the textarea of Facebook, then take a screenshot of the elements. My apologies.

1 Like

The value that I set is now on the line in the second box

However, this line does not contain an ID or Class Name

Use this as your replacement for setting the text in that field…

var statusInput = document.querySelector('input[data-sigil=" mentionsHiddenInput"]');
if (statusInput != typeof undefined || statusInput != null) {
    var isStatusInputHidden = statusInput.hidden
    var statusInputName = statusInput.name
    if (isStatusInputHidden && statusInputName != typeof undefined && statusInputName == "status") {
        statusInput.value = "Your text"
    }
}

Yes I know it’s a lot, however most of it is for validating to make sure we’re actually changing the correct field. Let me know if it works!

1 Like