[SOLVED] Get Webdocument from Form?

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
mrt
Posts: 257
Joined: Mon Mar 16, 2020 11:31 am

[SOLVED] Get Webdocument from Form?

Post by mrt » Thu Mar 23, 2023 9:10 am

Dear all,

in a generic project I have no DOM object, but only the form, e.g.

Code: Select all

/form[@processname='chrome']
How can I get the WebDocument by using this form?

In this 13 years old thread, a suggestion is made with

Code: Select all

Form webBrowser = "pathToWebBrowserForm";  
WebDocument doc = webBrowser.FindSingle("//webdocument");
but it does not seem to work (anymore?):
getdocument-control-method-is-gone-t1153.html

Any ideas?
Last edited by mrt on Thu Mar 23, 2023 12:37 pm, edited 1 time in total.

mrt
Posts: 257
Joined: Mon Mar 16, 2020 11:31 am

Re: Get Webdocument from Form?

Post by mrt » Thu Mar 23, 2023 12:37 pm

Don't know what I did wrong, got it working now with:

Code: Select all

WebDocument webDoc = MyRepo.Instance.Chrome.Self.FindSingle<WebDocument>("//webdocument[1]");