Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better control over browser's position and size is needed #1

Open
jakub-g opened this issue Nov 17, 2014 · 4 comments
Open

Better control over browser's position and size is needed #1

jakub-g opened this issue Nov 17, 2014 · 4 comments

Comments

@jakub-g
Copy link

jakub-g commented Nov 17, 2014

Currently the robot starts the requested browser, maximizes it, and calibrates itself by measuring the viewport offsets of the browser wrt the OS screen.

This is however very suboptimal in certain cases. For instance, I may want to start dev tools and don't want the browser to be full screen for that reason. Also, I may want to resize a virtual machine's window.

A solution could be

  1. a mechanism for tracking the movements of the browser window,
  2. calibration should not be automatic but manual (perhaps behind a command line flag): SJR starts the browser, the user positions it how it fits him, presses the button in the page to start the calibration.

Solution 2 seems probably easier to implement and more robust.

@divdavem
Copy link
Contributor

For info, solution 1 is already implemented: the computed viewport offset is not relative to the screen, but to the browser window, so if the browser window is simply moved in the screen, the positions should still be computed correctly.
The only remaining problem is when passing from the maximized state to a non-maximized state, which changes the position of the viewport inside the browser window (probably due to the border which is different).
@jakub-g Your suggestion (solution 2) to solve this issue is interesting.
Another (simpler) possibility would be to have a command line option allowing to choose whether the browser should be maximized or not.

@jakub-g
Copy link
Author

jakub-g commented Nov 18, 2014

But I think the implementation of 1) is fragile since e.g. Chrome displays a yellow warning bar at the top of the browser, if I close this bar, then the viewport position relative to browser window changes, and robot will malfunction.

I think the suggestion 2) is better than command line flag to maximize the viewport (but this flag perhaps also could be added): by manually starting the calibration, the user has the greatest flexibility to do anything he needs with the browser window.

The other issue is e.g. with IE displaying a bar at the bottom of the browser asking "do you want IE to be a default browser" etc. which when displayed, makes calibration fail.

I think the feature could sit behind a command line flag (--auto-calibration) and that flag probably should default to false, in many case it's useful to be able to do something before calibration, and having to pass the flag which is almost always wanted is boring.

@jakub-g
Copy link
Author

jakub-g commented Nov 18, 2014

Having said that, it was a good try in the first place to automate the calibration, but we didn't know the issues that arise when the thing is automated; right now it seems it's better to avoid automation since it can lead to problems, and just one click needed from the user is not a big issue IMO.

@divdavem
Copy link
Contributor

divdavem commented Jul 7, 2015

@jakub-g You can have a look to the new robot-server which does the calibration just before each test which needs it (during the call to getOffset).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants