Open avargaslopez24 opened 5 years ago
Good find. Looking at the old code I think I can add it back, but if you tell it to pin to a monitor that does not exist it will move the browser off the screen and it will be lost.
It depended on a function to get monitor count that does not exist in .net core 2.
Looking at the code, a workaround may be just make it a user defined value rather than a function call. Something along the lines of forcing users to set a canopy.screenmonitorCount value of non 1 before calling pintoMonitor?
Otherwise it's not a huge deal since I believe most users are running their UI tests headless making this a minor inconvenience.
ah yes I could check that.
Any update on this? pinToMonitor
is still in the documentation but not defined.
Will .NET Core 3.0 support this?
@olivercoad
let pinToMonitor n =
let n' = if n < 1 then 1 else n
if System.Windows.Forms.SystemInformation.MonitorCount >= n' then
let workingArea = System.Windows.Forms.Screen.AllScreens.[n'-1].WorkingArea
browser.Manage().Window.Position <- new System.Drawing.Point(workingArea.X, 0)
browser.Manage().Window.Maximize()
That is the old code. I dont know if System.Windows.Forms.SystemInformation.MonitorCount is in .net Core 3.0 or System.Windows.Forms.Screen.AllScreens
For now I will remove from documentation
I don't know if this was an intentional reversion or not, but pinToMonitor is no longer defined in the source code. It does still show up on the website documentation however.