reduce the size of the selenium frame - selenium

I do I reduce the size of the selenium frame, in order to increase the frame of the website I am testing?

You can start the Selenium server in a multiwindow mode:
-multiWindow: puts you into a mode where the test web site executes in a
separate window, and selenium
supports frames
http://seleniumhq.org/docs/05_selenium_rc.html#server-options

If you want to resize the window once you've done multiWindow mode, you can also do getEval("window.resizeTo(X, Y); window.moveTo(0,0);") where X and Y are the width and height of the window you want.

Related

Selenium Window Size Not Changing While Using Device Emulation

I'm trying to change the window size using chrome option while using device emulation but it has no impact on width but works for height.
chrome_options.add_argument("--window-size=400,600")
chrome_options.add_argument('--log-level=3')
chrome_options.add_experimental_option('excludeSwitches', ['enable-logging'])
mobile_emulation = { "deviceName": "iPhone 6/7/8 Plus" }
chrome_options.add_experimental_option("mobileEmulation", mobile_emulation)
also tried
browser.set_window_size(400, 600)
is there something missing? or am I doing it wrong?
You can not set a selenium driver window width to 400.
AFAIK minimal computer screen width is 512.
To use smaller window width you can simulate mobile device screen sizes.
There are several discussions about this issue, for example here

Increase bootstrap grid width beyond 1170px

Is there a way to increase the width of the Bootstrap 3 grid to beyond 1170? My users often use devices that support 1920 x 1080 resolution. I want to maintain the responsiveness (in case the window is not maximized) but whenever the window is > 1600px in width, I want the grid system to be as wide as 1600px.
Is there a way to add another "step" to the grid system for windows wider than 1600px? Preferably without using LESS, just by adding some Custom CSS to override original Bootstrap rules?
Allow me to answer the question myself. I needed to change my search keywords to find the answer. It was mentioned in this issue on Bootstrap's GitHub issue tracker (last comment). It is a CSS file called BootstrapXL which basically adds a new "x-large" grid level to Bootstrap 3 for devices beyond 1600 px in width (i.e. Full HD monitors with the window maximized).

xaml minimum application screen size

how can I set a minimum size in an universal app (win 10) for the application window? in my project I have only object with Page tag, not Window. I want that the screen of the application can't be resized less off a certein value.
thanks a lot
In the Package.appxmanifest of a Windows 8.1 Universal app, you could set a minimum width, to one of 3 pre-defined values. Setting minimum values on your page will not prevent your application from resizing. Setting maximum values will not prevent resizing either, but it will result in black borders when the application frame is larger than your set dimension. It's worth mentioning that 320 px is the absolute minimum width on 8.1 and on Windows 10 (for phones).
In Windows 10 UWP this property is no longer available. You should AdaptiveTriggers to handle your UI layout on Windows 10.
If you want to check the minimum resize dimensions, keep the scaling of your pc in mind. My laptop scales at 125%, a screenshot of the minimum dimension for the desktop client is 627x441 (~500x350 at 100%) including the space used for the app bar. But it's more common to just use AdaptiveTrigger and 720 pixels as the cut-off between phone and tablet.
you are working on a universal app, you shouldn't set a minimum width . It should be working on every resolution and device.
you should instead use visual state manager and adaptive triggers.
best of luck !

Selenium: resize window in a tiling window manager

I'm using a tiling window manager i3 to run selenium tests. Sometimes I run tests using Chrome & Firefox besides PhantomJS. I realize that one cannot resize an i3 window that's tiled, so I wonder what, if any, workarounds are there to resize window, or detecting if the window is currently tiled and setting it floating?
I realize that one option would be setting chrome and firefox to always run floating in i3 config, but that would impede my regular workflow.
You actually can resize tiled windows, either with the mouse or with the resize command:
resize <grow|shrink> <up|down|left|right|height|width> [<px> px [or <ppt> ppt]]
This grows or shrinks the window in the given direction. With the optional parameters you can specify by what amount the window should be resized. The first argument - <px> px - is used for floating windows and defaults to 10 px. The second argument - <ppt> ppt is for tiled windows and gives the amount in percentage points of the parent container, it defaults to 10 ppt.
In the default configuration there is a resize mode that can be reach with Mod+r (with Mod being either Alt or Super, depending on the choice when first starting i3). While in this mode, windows - floating and tiled - can be grown with Down or Right and shrunken with Up and Left.
For example: Say, you have a container with 3 equally wide windows side-by-side - each taking 33.33 % of the containers width. If you run resize grow width on the middle one, it will be resized to take 43.33 % of the parent container, while the windows to either side will be shrunken to 28.33 %.
As for setting a window to floating, you can always do that with the command floating enable, so there is actually no need to query the current floating state.
If you really want to, you could query this information from i3's IPC interface.
Proof of concept:
Use i3-msg -t get_tree to retrieve the JSON-encoded layout tree (this gets you the whole JSON in one line, so maybe you want to put it through json_xs, json_pp or some similar program for more human-friendliness).
Get the ID of the current window with xdotool getactivewindow
Look in the tree for a node with attribute "window": <WINDOWID>
Check whether the attribute "floating" is set to "user_on" (or possibly "<ANYTHING>_on", I am not sure about that)

How to detect if d3d device can be created for a certain width / height in windowed mode?

My game is in window mode which allows users to resize the game
window almost freely, which means the the ratio of the width/height,
and the size of the window can be arbitrary (though the window has
largest and smallest restrictions)
To make the render result be displayed nicely, a same size d3d
device would be preferred to create (thus the back-buffer pixel can
be matched with the screen pixel and we could get a ratio right and
clear image)
Though I can get the Caps and the supported enumerated resolution
list, I am not sure if a windowed resolution can be accepted by d3d
system. (e.g. we have 1024x768 /800x600 in the Caps, but we need to
create 1000x700 back-buffer)
My question is, how can I make sure if a certain resolution can be created and what's the practical way to handle the problem.
Thank you very much!
In windowed mode you can create any resolution swap chain (subject to some maximum size constraints which will be greater than any supported screen resolution). It's only in full screen mode that you are constrained to creating swap chains of sizes that are on the enumerated resolution list.