add `windowById` helper
See original GitHub issueas @kevinsawicki points out here https://github.com/electron/spectron/issues/6:
ChromeDriver seems to treat each <webview> tag as a separate window so you should be able to use the windowByIndex helper to focus a webview by location in the DOM and then you can call other helpers and it will be scoped to that window.
if you have multiple webviews, then working with just the index is very error prone. Would it be possible get the webview based on its id? Something like: windowById('#my-webview)
?
Or could we maybe already achieve this with a couple of promises? I tried but couldn’t make it work. Any idea’s?
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Calibration and align batch operations | PixInsight Forum
windowById (): invalid view identifier. Click to expand. ... There is a bug at line 250 of BatchPreprocessing-helper.js. The line read:
Read more >electronjs - Bountysource
I'm trying to find a way of effectively testing for IPC events being sent/received on either the main or renderer processes. Looking at...
Read more >Is it a good practice to combine design patterns in JavaScript
I have my helper function (this function is just an example): var someElement = byId('id');. Of course I can create HelpersModule in ...
Read more >How to check if a window is valid? - wxWidgets Discussion ...
Or, as alternative: Is there a way to install some sort of global "Hook" with wich I can automatically add EventHandlers for ...
Read more >Automated Malware Analysis Report for https://sites.google.com/site ...
Valid Accounts, Graphical User Interface1, Winlogon Helper DLL ... getElementById(a)}window.byId=d;function g(a){return ... Please add a description.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am also having the same issue.
Currently I am locating a particular element’s id contained by the targeted
webview
by iterating over all window handles.I’m using something like that:
But processing this way seems rather awkward, inefficient and also error prone (duplicate element ids in two different webviews is authorised).
webdriverio window() call is able to retrieve a window by using the
tab name
attribute but I do not know if there is a way to associate atab name
to awebview
element.Nothing I can think of initially but I think something could be added, will have to investigate further.