Using window().fullscreen() to open the Browser Window in Full Screen

Selenium 4: New Features Selenium 4 - New Featues
8 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$49.99
List Price:  $69.99
You save:  $20
€46.84
List Price:  €65.59
You save:  €18.74
£40.08
List Price:  £56.11
You save:  £16.03
CA$68.77
List Price:  CA$96.29
You save:  CA$27.51
A$77.57
List Price:  A$108.61
You save:  A$31.03
S$67.98
List Price:  S$95.18
You save:  S$27.19
HK$391.47
List Price:  HK$548.09
You save:  HK$156.61
CHF 45.44
List Price:  CHF 63.62
You save:  CHF 18.18
NOK kr550.52
List Price:  NOK kr770.78
You save:  NOK kr220.25
DKK kr349.57
List Price:  DKK kr489.42
You save:  DKK kr139.85
NZ$84.34
List Price:  NZ$118.08
You save:  NZ$33.74
د.إ183.58
List Price:  د.إ257.04
You save:  د.إ73.45
৳5,470.71
List Price:  ৳7,659.43
You save:  ৳2,188.72
₹4,176.24
List Price:  ₹5,847.07
You save:  ₹1,670.83
RM239.12
List Price:  RM334.79
You save:  RM95.67
₦64,837.03
List Price:  ₦90,777.03
You save:  ₦25,940
₨13,875.73
List Price:  ₨19,427.14
You save:  ₨5,551.40
฿1,838.09
List Price:  ฿2,573.47
You save:  ฿735.38
₺1,625.07
List Price:  ₺2,275.24
You save:  ₺650.16
B$261.61
List Price:  B$366.28
You save:  B$104.66
R951.73
List Price:  R1,332.50
You save:  R380.77
Лв91.56
List Price:  Лв128.20
You save:  Лв36.63
₩68,725.22
List Price:  ₩96,220.81
You save:  ₩27,495.59
₪189.45
List Price:  ₪265.25
You save:  ₪75.79
₱2,860.16
List Price:  ₱4,004.45
You save:  ₱1,144.29
¥7,719.58
List Price:  ¥10,808.04
You save:  ¥3,088.45
MX$847.97
List Price:  MX$1,187.23
You save:  MX$339.25
QR181.87
List Price:  QR254.64
You save:  QR72.76
P688.94
List Price:  P964.57
You save:  P275.63
KSh6,648.67
List Price:  KSh9,308.67
You save:  KSh2,660
E£2,424.79
List Price:  E£3,394.91
You save:  E£970.11
ብር2,836.22
List Price:  ብር3,970.94
You save:  ብር1,134.71
Kz41,866.62
List Price:  Kz58,616.62
You save:  Kz16,750
CLP$48,936.71
List Price:  CLP$68,515.31
You save:  CLP$19,578.60
CN¥361.88
List Price:  CN¥506.66
You save:  CN¥144.78
RD$2,946.48
List Price:  RD$4,125.31
You save:  RD$1,178.83
DA6,722.93
List Price:  DA9,412.64
You save:  DA2,689.71
FJ$113.51
List Price:  FJ$158.92
You save:  FJ$45.41
Q387.68
List Price:  Q542.78
You save:  Q155.10
GY$10,436.32
List Price:  GY$14,611.69
You save:  GY$4,175.36
ISK kr7,041.59
List Price:  ISK kr9,858.79
You save:  ISK kr2,817.20
DH505.94
List Price:  DH708.36
You save:  DH202.41
L894.84
List Price:  L1,252.84
You save:  L358
ден2,883.38
List Price:  ден4,036.97
You save:  ден1,153.58
MOP$402.04
List Price:  MOP$562.89
You save:  MOP$160.85
N$948.82
List Price:  N$1,328.43
You save:  N$379.60
C$1,834.68
List Price:  C$2,568.70
You save:  C$734.02
रु6,672.62
List Price:  रु9,342.21
You save:  रु2,669.58
S/187.54
List Price:  S/262.58
You save:  S/75.03
K189.46
List Price:  K265.26
You save:  K75.80
SAR187.52
List Price:  SAR262.55
You save:  SAR75.02
ZK1,259.85
List Price:  ZK1,763.89
You save:  ZK504.04
L233.06
List Price:  L326.30
You save:  L93.24
Kč1,184.38
List Price:  Kč1,658.23
You save:  Kč473.85
Ft18,455.66
List Price:  Ft25,839.41
You save:  Ft7,383.74
SEK kr544.55
List Price:  SEK kr762.42
You save:  SEK kr217.86
ARS$43,452.58
List Price:  ARS$60,837.09
You save:  ARS$17,384.51
Bs345.19
List Price:  Bs483.29
You save:  Bs138.10
COP$195,545.84
List Price:  COP$273,779.82
You save:  COP$78,233.98
₡24,976.48
List Price:  ₡34,969.07
You save:  ₡9,992.59
L1,230.59
List Price:  L1,722.93
You save:  L492.33
₲368,897
List Price:  ₲516,485.32
You save:  ₲147,588.31
$U1,944.69
List Price:  $U2,722.73
You save:  $U778.03
zł202.91
List Price:  zł284.09
You save:  zł81.18
Already have an account? Log In

Transcript

Hello everyone. In this video session, I am going to explain part 13 of selenium four that is using window dot fullscreen command to open the browser window and fullscreen this Okay, this is a new feature in Selenium four where you can open the browser window not only nice nice mode, but also in the full screen mode. Okay, using this command, we can open the browser window in full screen mode. So it will Selenium three we have the option to open the browser window in maximized mode. But in Selenium four, they have introduced a new option known as full screen mode. Okay, so what is the difference between this maximize mode and the full screen mode?

I'm going to explain now. Okay, open in a browser like Chrome as you can see here. There is some This option here, right This option is nothing but full screen option guys. So for example, if you have this browser like this, okay, this is not the maximized mode. If you click on this squared option here on the browser, it will maximize this is maximize, but coming to the full screen, there is a difference between the maximize and full screen guys. So you can select these three dots and you can come here in the Chrome browser and select this fullscreen option.

Okay, when you select that, you see the navigation is also not getting displayed. Okay, so it's like even the taskbar of my Windows is also not displayed. Okay, a lot of things codes are hidden only the browser is being shown like like watching a movie in full screen mode. Okay, so where you will not see any desktop. Okay, desktop related items like Taskbar and browser navigation bar and so on. So on.

Okay. So this is only the browser is visible here. This is the difference guys in Maximizer. You will see the taskbar of this windows This is a maximized mode right this is a Taskbar of the Windows you can see this options no okay and you can see the browser navigation options, but in full screen mode it will be like this person for example guys for example, if you get a requirement where you have to test your application in full screen mode, okay not in maximized mode. So, your your application you need to test in full screen mode for that, selenium is providing this command known as window dot fullscreen okay. This command is window dot fullscreen content is being provided by Selenium fourth to open the browser window in full screen mode as I just now shown, so let me practically demonstrate okay using his example let me practically demonstrate how to test an application in full What is in this comment?

Right? So for that let's create we have to have a Maven project which is already configured with Selenium for as you can see, this is a Maven project here and it has formed XML file and I have already added this Selenium for dependency tax, which is alpha alpha three version which is as for latest as for now, okay. And there are other dependencies like WebDriver, manager and all okay, so you need so if you want to understand how to create this Maven project and how to configure this Maven project with Selenium for dependencies and other stuff, okay, that are required. Watch my first video of this Selenium for new new feature series. And come back here is assuming that you have created a Maven project and configured that with Selenium four and other Selenium four and other things. So let's create a new class here.

So so far, I created up to 11. So let me create some demo class like the will create a new Class demo well, and select this public static void Main option. And inside this right let's write down the stuff like WebDriver manager dot chromedriver dot setup. Okay, then WebDriver driver is equal to new chrome driver, this will open the Chrome browser and this will give you the executable path for the chrome driver. Okay, so Hover the mouse and import this WebDriver interface and this chrome driver class then generally will say driver dot manage dot window dot maximize we'll say okay till Selenium three we have only this option of maximize but there is a new method added here guys, you can not only test in maximize mode in Selenium four but also they have given another method for testing the okay application in full screen mode okay apart from maximize, we also have a full screen command in Selenium for Okay, full screen.

So this will Whatever browser that is open, it will open in full screen mode. Now after this, then let's just say application, whatever that you want to test this right away, write it here. Okay? So give the application URL. Let's say I want to open the sample application in nice I want to test whether this application functionality is working fine in full screen mode, say okay, copy this application URL and paste it into this then driver dot sorry, let me open this application. I would like to do a small test where I would like to enter some text into this text field inspect this text field.

It has a locator like name is called q i will use a CMD driver dot find element by dot name. So and this Q dot sendkeys let me type some text into the textbox. That is a liquid type. QA folks come into the text field. Such textbox feed After that, I would like to click the search button inspect this has two button guys. It has input tag and it has the value attribute as such, so I will create some CSS selector also say Ctrl F will copy the search.

And I will say input value is equal to such the CSS selector is using which I am locating the search button, copy the CSS selector for this search button and then say driver dot find element by dot CSS selector. And here view dot click. That's it. This is a test I want to test in full screen mode of the Chrome browser guys. So for that, I've used this a dot window dot fullscreen command here anyhow, so let me run this. So instead of opening in maximized mode, the browser window will be opened in full screen mode.

Okay. You can feel the difference. As you already mentioned, the browser window is open now it will switch to the full screen mode. You see after switching to the full screen mode it will type text into the text field and click on the search button. You see the test has been performed in full screen mode when you hover like this you will get some options okay that like exhaustion, escape the full screen mode you will get this option. So just move the mouse to the top you will get this click on that it will come to the normal mode.

Okay, so these are ways we can execute some Selenium for automation tests in full screen mode. Okay, so this is one of the new future of selenium for where you can open a browser window in full screen mode. So that's it guys. In the next video session I am going to explain a new feature Another new feature of psyllium for that is switching to the parent frames Okay, is Selenium three we don't have direct switching to the parent frame, but this parent frame method has been introduced in the Selenium four onwards. So I am going to radically demonstrate and in detail explain how Do this switch so parents frame okay in the next video session. So that's it guys.

See in the next video session. Thank you. Bye

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.