Highlighted
Absent Member.
Absent Member.
1148 views

DomEmbeddedElement how to input password

bank password input ,
recoder  DomEmbeddedElement

I try TypeKeys("111222") ,PressKeys("111222")  ReleaseKeys("111222")   have no effect.

setText("") is Error

FindDomEmbeddedElement("//BrowserApplication//BrowserWindow//OBJECT[@id='_ocx_passwordChar']")

how could ?

0 Likes
7 Replies
Highlighted
Absent Member.
Absent Member.

RE: DomEmbeddedElement how to input password

anybody could reply???
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: DomEmbeddedElement how to input password

Hi,

DomEmbeddedElement is the class in Internet Explorer for embedded plug-ing (like Adobe Flash).
If it is a Flash control Silk Test does not have any object recognition inside the Flash container.
Here you can use TypeKeys and Click to interact with the individual controls inside the Flash control.

I assume the problem why TypeKeys does not enter text in the password file is because the password field does not have the focus.
This means the password file does not the blinking cursor.

To focus the password field, find out how a user would focus it:
1) Either by pressing the Tab key (maybe multiple times to focus the text field that you want).
2) or by clicking on the text field

To perform option 1) with Silk Test use FindDomEmbeddedElement(...).TypeKeys("<Tab>")
To perform option 2) with Silk Test use FindDomEmbeddedElement(...).Click with a relative position so that it will click the password field.

Once the password field has the focus using TypeKeys to type you password should work as expected.

Please note: If FindDomEmbeddedElement(...).TypeKeys still does not work try to use FindBrowserWindow("//BrowserApplication//BrowserWindow").TypeKeys instead.

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: DomEmbeddedElement how to input password

Thanks , and i try DomEmbeddedElement has the focus ,but FindDomEmbeddedElement(...).TypeKeys or FindBrowserWindow("//BrowserApplication//BrowserWindow").TypeKeys all not work ; when i try FindDomTextField(..) has the focus then used FindBrowserWindow("//BrowserApplication//BrowserWindow").TypeKeys,it work! but FindDomEmbeddedElement(...).TypeKeys not work, if only DomTextField cound TypeKeys work?
0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: DomEmbeddedElement how to input password

Hi,

It is possible that you need to set the TypeKeys argument "ensureFocus" to false. For example:

//Manually give input focus to the embedded object via a Click
FindDomEmbeddedElement("//BrowserApplication//BrowserWindow//OBJECT[@id='_ocx_passwordChar']").Click()

//Type the expected text
FindDomEmbeddedElement("//BrowserApplication//BrowserWindow//OBJECT[@id='_ocx_passwordChar']").TypeKeys("myText", 0, false)


You may want to consider entering a sleep statement between the Click and the TypeKeys action. This will allow you to visually confirm that the Click method transfers input focus to the correct element or if you need to provide coordinates to click the DomEmbeddedElement at a specific point.

I hope this helps.
-Robert
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: DomEmbeddedElement how to input password

  very Thanks!

  [ ] sleep(5)
  [ ] WebBrowser.BrowserWindow.FindDomTextField("INPUT[@id='messageCode']").Click(MB_LEFT, 39, 6)
  [ ] WebBrowser.BrowserWindow.FindDomTextField("INPUT[@id='messageCode']").Click(MB_LEFT, 93, 9)
  [ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").Click(MB_LEFT, 12, 16)
  [ ] WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TextClick("ATL 10.00")
  [ ] sleep(5)
  [ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TypeKeys("111222")
  [ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TypeKeys("1",0.5,false)
  [ ] // WebBrowser.BrowserWindow.TypeKeys("1",0,false)
  [ ] // WebBrowser.TypeKeys("111222")//,0.5,false)
  [ ] Desktop.TypeKeys("1",0,false)
  [ ] sleep(5)
all  i had try, is not work.
when WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TextClick("ATL 10.00") , it had a  focus on TextField, Cursor blink。 when execute  ...(..).TypeKeys   the cursor disappears, not input anything .

I try DomTextField() ,if the focus on DomTextFieldWebBrowser.BrowserWindow.TypeKeysTypeKeys("1") or  Desktop.TypeKeys("1",0,false) would work.

the DomEmbeddedElement(), the focus on DomEmbeddedElement,  all type TypeKeys   not work...

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: DomEmbeddedElement how to input password

very Thanks!

  [ ] sleep(5)
  [ ] WebBrowser.BrowserWindow.FindDomTextField("INPUT[@id='messageCode']").Click(MB_LEFT, 39, 6)
  [ ] WebBrowser.BrowserWindow.FindDomTextField("INPUT[@id='messageCode']").Click(MB_LEFT, 93, 9)
  [ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").Click(MB_LEFT, 12, 16)
  [ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TextClick("ATL 10.00")
  [ ] sleep(5)
  [ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TypeKeys("111222")
  [ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TypeKeys("1",0.5,false)
  [ ] // WebBrowser.BrowserWindow.TypeKeys("1",0,false)
  [ ] // WebBrowser.TypeKeys("111222")//,0.5,false)
  [ ] Desktop.TypeKeys("1",0,false)
  [ ] sleep(5)

all type TypeKeys i had tyr,is not work.

when execute WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TextClick("ATL 10.00") ,the fous on DomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']"),  the cursor blinking on it. when execute  TypeKeys line, the cursor disappears.

and i try DomTextField, when the fous on DomTextField, WebBrowser.BrowserWindow.TypeKeys("1",0,false) or Desktop.TypeKeys("1",0,false) ..all type TypeKeys could input something in 

but i try DomEmbeddedElement,the fous on it  also, all type TypeKeys  counld not input anything ...

I don't know how to fix it

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: DomEmbeddedElement how to input password

very Thanks!
[ ] sleep(5)
[ ] WebBrowser.BrowserWindow.FindDomTextField("INPUT[@id='messageCode']").Click(MB_LEFT, 39, 6)
[ ] WebBrowser.BrowserWindow.FindDomTextField("INPUT[@id='messageCode']").Click(MB_LEFT, 93, 9)
[ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").Click(MB_LEFT, 12, 16)
[ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TextClick("ATL 10.00")
[ ] sleep(5)
[ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TypeKeys("111222")
[ ] // WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TypeKeys("1",0.5,false)
[ ] // WebBrowser.BrowserWindow.TypeKeys("1",0,false)
[ ] // WebBrowser.TypeKeys("111222")//,0.5,false)
[ ] Desktop.TypeKeys("1",0,false)
[ ] sleep(5)
all type TypeKeys i had tyr,is not work.
when execute WebBrowser.BrowserWindow.FindDomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']").TextClick("ATL 10.00") ,the fous on DomEmbeddedElement("OBJECT[@id='_ocx_passwordChar']"), the cursor blinking on it. when execute TypeKeys line, the cursor disappears.
and i try DomTextField, when the fous on DomTextField, WebBrowser.BrowserWindow.TypeKeys("1",0,false) or Desktop.TypeKeys("1",0,false) ..all type TypeKeys could input something in
but i try DomEmbeddedElement,the fous on it also, all type TypeKeys counld not input anything ...
I don't know how to fix it
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.