Though your safer option would be the second method. Once you have found your window, it's very easy to edit the text in it, the hard part is finding it. To find one particular text box on a web browser, you have to know exactly what you're looking for (probably most accomplishable using EnumWindows). This is a tricky thing for a beginner, so I suggest you learn some basics first.
Though, on second thought, I'm not entirely sure how controls in web browsers work, so the second method may not work at all.
**how to solve invalid keystore error in android studio here is error report----------------------->
here is error report--------> error:Error:java.lang.RuntimeException: com.android.ide.common.signing.KeytoolException: Failed to read key palash from store "D:\MyApplication3.idea\workspace.xml": Invalid keystore format ...