Q: How to get at controls of type or name #53
Replies: 3 comments 2 replies
-
Ah, yes, 💡 right along the lines what I am after, after digging a bit further into the documentation documentation... |
Beta Was this translation helpful? Give feedback.
-
Maybe spoke too soon, or my current setup is insufficient. I adopted the package references, starting with context. But getting exception. I am trying to respond
Exception thrown while attempting the dev tools context. var context = await Wrapper.Browser.CreateDevToolsContextAsync();
var ctrlUsername = await context.QuerySelectorAsync<HtmlInputElement>("...");
var ctrlPassword = await context.QuerySelectorAsync<HtmlInputElement>("...");
var btnSubmitLogin = await context.QuerySelectorAsync<HtmlInputElement>("...");
var cbRememberMe = await context.QuerySelectorAsync<HtmlInputElement>("...");
await context.DisposeAsync(); Not even to the query selector part yet, but I am fairly confident my query strings are accurate. The only questions might be how to operate a In terms of my browser window setup. I have verified, I am loading the desired target address. I have the WPF Window instance being created, and the wrapper instance has the Browser control named, both are not null. But when I try to engage through the Browser instance, that is when it gets thrown. My aim is for the browser window to remain hidden, pretty much, but I might like to show the window when engaging with it. Is that supported, or maybe because it is hidden, some instances are falling from scope, and thus being disposed of prematurely (?). |
Beta Was this translation helpful? Give feedback.
-
Problem sorted. Key notes:
From there forward, rinse and repeat, the results are only as good as the document being queried, so know thy domain, and so forth. |
Beta Was this translation helpful? Give feedback.
-
I see the leading indicator tends ot be
id
where possible, and that's a good start. However, I have a case where I need bytype
and then byname
, both of which I have inspected toward, and verified, at least for the moment. Is it possible to identify such controls, maybe by injecting some sort of selector?Beta Was this translation helpful? Give feedback.
All reactions