Loading insecure websites using DevTools

Selenium 4: New Features Selenium 4 - New Featues
12 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.93
List Price:  €65.70
You save:  €18.77
£40.56
List Price:  £56.78
You save:  £16.22
CA$68.58
List Price:  CA$96.02
You save:  CA$27.43
A$77.64
List Price:  A$108.71
You save:  A$31.06
S$68.11
List Price:  S$95.36
You save:  S$27.25
HK$391.73
List Price:  HK$548.45
You save:  HK$156.72
CHF 45.57
List Price:  CHF 63.80
You save:  CHF 18.23
NOK kr549.92
List Price:  NOK kr769.93
You save:  NOK kr220.01
DKK kr350.20
List Price:  DKK kr490.31
You save:  DKK kr140.10
NZ$84.59
List Price:  NZ$118.43
You save:  NZ$33.84
د.إ183.59
List Price:  د.إ257.05
You save:  د.إ73.45
৳5,482.81
List Price:  ৳7,676.37
You save:  ৳2,193.56
₹4,167.38
List Price:  ₹5,834.67
You save:  ₹1,667.28
RM238.85
List Price:  RM334.41
You save:  RM95.56
₦64,837.03
List Price:  ₦90,777.03
You save:  ₦25,940
₨13,903.53
List Price:  ₨19,466.05
You save:  ₨5,562.52
฿1,849.58
List Price:  ฿2,589.56
You save:  ฿739.98
₺1,626.79
List Price:  ₺2,277.64
You save:  ₺650.84
B$260.33
List Price:  B$364.49
You save:  B$104.15
R954.12
List Price:  R1,335.85
You save:  R381.72
Лв91.80
List Price:  Лв128.52
You save:  Лв36.72
₩68,931.17
List Price:  ₩96,509.16
You save:  ₩27,577.98
₪187.71
List Price:  ₪262.81
You save:  ₪75.10
₱2,874.32
List Price:  ₱4,024.28
You save:  ₱1,149.96
¥7,736.16
List Price:  ¥10,831.24
You save:  ¥3,095.08
MX$852.34
List Price:  MX$1,193.35
You save:  MX$341
QR182.28
List Price:  QR255.21
You save:  QR72.92
P693.87
List Price:  P971.48
You save:  P277.60
KSh6,673.66
List Price:  KSh9,343.66
You save:  KSh2,670
E£2,407.29
List Price:  E£3,370.40
You save:  E£963.11
ብር2,838.61
List Price:  ብር3,974.28
You save:  ብር1,135.67
Kz41,772.06
List Price:  Kz58,484.22
You save:  Kz16,712.16
CLP$47,953.40
List Price:  CLP$67,138.60
You save:  CLP$19,185.20
CN¥362.08
List Price:  CN¥506.95
You save:  CN¥144.86
RD$2,948.09
List Price:  RD$4,127.56
You save:  RD$1,179.47
DA6,736.50
List Price:  DA9,431.64
You save:  DA2,695.14
FJ$113.64
List Price:  FJ$159.10
You save:  FJ$45.46
Q388.55
List Price:  Q544.01
You save:  Q155.45
GY$10,452.30
List Price:  GY$14,634.05
You save:  GY$4,181.75
ISK kr7,054.58
List Price:  ISK kr9,876.98
You save:  ISK kr2,822.40
DH506.10
List Price:  DH708.59
You save:  DH202.48
L892.28
List Price:  L1,249.26
You save:  L356.98
ден2,888.73
List Price:  ден4,044.46
You save:  ден1,155.72
MOP$403.06
List Price:  MOP$564.32
You save:  MOP$161.25
N$959.92
List Price:  N$1,343.97
You save:  N$384.04
C$1,838.88
List Price:  C$2,574.58
You save:  C$735.69
रु6,672.60
List Price:  रु9,342.18
You save:  रु2,669.57
S/186.40
List Price:  S/260.97
You save:  S/74.57
K189.84
List Price:  K265.79
You save:  K75.95
SAR187.50
List Price:  SAR262.52
You save:  SAR75.01
ZK1,282.68
List Price:  ZK1,795.86
You save:  ZK513.17
L233.55
List Price:  L326.99
You save:  L93.43
Kč1,186.09
List Price:  Kč1,660.63
You save:  Kč474.53
Ft18,503.54
List Price:  Ft25,906.43
You save:  Ft7,402.89
SEK kr544.52
List Price:  SEK kr762.37
You save:  SEK kr217.85
ARS$43,553.58
List Price:  ARS$60,978.49
You save:  ARS$17,424.91
Bs345.95
List Price:  Bs484.36
You save:  Bs138.40
COP$196,325.16
List Price:  COP$274,870.93
You save:  COP$78,545.77
₡25,089.09
List Price:  ₡35,126.73
You save:  ₡10,037.64
L1,233.38
List Price:  L1,726.83
You save:  L493.45
₲369,601.19
List Price:  ₲517,471.24
You save:  ₲147,870.05
$U1,919.32
List Price:  $U2,687.21
You save:  $U767.88
zł202.63
List Price:  zł283.69
You save:  zł81.06
Already have an account? Log In

Transcript

Hello everyone, in this video session, I am going to explain part 11 of selenium for that is loading insecure websites using dev tools. So if you if you try to load some insecure websites like this, okay, who said fake ID? port certificates certificate is already expired. Okay, let me open this in a Chrome browser, this insecure website I am trying to access here. And I am going to get some error. Okay, security error, I'm getting certificate date invariant, that is a certificate got expired, it's saying.

So. So in such cases where we are not able to access the application, an application is not loading in place of the application, we are getting this certificate error saying that it's expired. So if you still want this application to be load, okay, if you still want this application to be loaded, despite of the certificate error if you want to load this insecure website, then Using this dev tools, we can do the race. So how to ignore the certificate errors using the dev tools. I am going to explain this current video session. So, before that guys before I practically demonstrate we have to find out about this gate Dev Tools method.

Okay. We are going to use this get deltas method guys, which is going to return this deltas class. So, so there is something about this gate doodles. Okay. So let me explain. What is that something in Selenium three.

In Selenium three. We have this chrome driver medically extending this remote WebDriver installation Selenium three, the chrome driver use is Directly extending the remote WebDriver right we show that so go to Selenium HQ dot o RG go to this download and if you come here there is something like Java and Selenium WebDriver version 3.14 that is Selenium three, this click on this Java doc and search for this chrome driver class and then click here. So now as you can see here this chrome driver class is directly extending this remote web driver. But coming to Selenium four, but coming to Selenium four it's different it is okay in Selenium for Chrome driver class is extending chromium driver class, which is actually extending the extending the remote WebDriver. In Selenium three chrome driver classes directly extend extending this Remote WebDriver whereas in Selenium for Chrome driver is extending the chromium driver which is extending the remote web driver okay.

So here chrome driver is extending the chromium driver in this Selenium four. So let's see that in the code actually. So, let me open Eclipse ID. And here we have a Mavin project guys, which is already created and it has it is already configured with this Selenium four, okay, alpha version of the Selenium four which is so far the latest as of today. So this Maven project is already configured with the Selenium four and other required stuff here. Okay, so assuming that you have this Maven project configured with the Selenium for us, it's not you can go to the video one of this Selenium for new features video series, we have clearly explained how to create a Maven project and how to configure it with Selenium for another request.

Okay. So hoping that you have created a Maven project with this by configuring it with the Selenium for another required stuff Okay, let's right click on this package name and say class and in this classes demo, we have something like 10 now, I will use something like 11 okay and select public static void Main. And now we have a demo level class inside that we have this main method inside that let me write a sample statement like this WebDriver driver is equal to new chrome driver, okay. For the most on this WebDriver and in Portage and who are the most on this chrome driver and in Portage, Now guys, this is Selenium for Okay in this project we have Selenium for this project is configured in Selenium for so we have imported this WebDriver from Selenium for and this chrome driver class from Selenium for Okay, now, for the mode on this chrome driver class, press the Ctrl key on your keyboard.

Hold it up. Hold the key, for the most is the Ctrl key on your keyboard and hold it and then left click mouse left click on this hyperlink kind of thing, okay. And you do that it will take you to the chrome driver class of selenium four. You can see here from driver class here is extending the chromium driver. Okay. Chrome driver classes here, extending the chromium driver, as I said here in selenium, Google Chrome driver is not directly extending the remote repair instead of Chrome driver is extending the chromium driver.

Now let's move ahead. Again, do the same thing over the mouse on this chromium driver, press, press, press and hold the Ctrl key on your keyboard and click this chrome driver left click the mouse left click this chrome driver. Now you can see here we have been taken to the chromium driver class which is extending the remote web driver. Okay, premium Time passes extending the remote WebDriver. And in this chromium driver class if you go down a bit Okay, you will find a method known as give to get deltas method which will return you the dibbles Okay, we need just Delta's class days variable of this delta class for that we need to call this method okay of this chromium driver. So, we have to this get get derivatives method which will return you as the deltas class.

But guys this get to tools method inside which class chromium driver class, okay, get Delta's methods inside which class inside the chromium driver class, okay. But guys, since chrome driver is extending this chromium driver, we can also use this get dev tools with this chrome driver. Okay. Even though the get Dev Tools method is belongs to the chromium driver, since Chrome, the chrome driver is extending the chromium driver, we can use the data tools method with a chrome driver also. Okay, so That's the thing we have to know. Okay, these are things we have to know before proceeding guys.

So let me start practically demonstrating how to load insecure website using dev tools. Okay, so let's start this let's write some basic steps like WebDriver manager dot chromedriver dot set up. Then I will say driver dot manage maximize the browser window. Driver dot manage dot timeout start implicitly wait for some time. Time unit dot seconds done right now guys, before I open any insecure applications, let me okay do few things like ignore the certificate and at all. Okay, the first step here is we have to first create a demo session in order to use that to do your first created doodle session.

First we need to do tools right we need to do tools and only we can create a session. So let's okay let's do something like this cast the driver okay with the chrome driver class as this driver with this chrome driver class then you will get this a double dose method okay? Get double dose method you are able to use this get DevTools method it's chrome because chrome driver is class is extending which class chromium driver where this get method is available. Okay. So this is the index and for the mouse on get tools, it will return you the devils class. Now we got the deal tools.

Okay, using this dev tools. We are going take notice certificate error, import this to dues from Selenium. Now, first thing is that before actually we go to the site, ignoring certificate and all the first thing that we need to do is we have to create a digital session. Okay, we have to create a digital session then only we can Notice I forget and all okay create Dev Tools session for that what do you have to do? How to take this doodles dot create session Okay, it will create the doodle session once the doodle session is created, we have to enable the security guys okay. We have to enable the security for that we have to say Dev Tools dot send the command send command is one of the commands of this Dev Tools using which we can provide any comments we can issue the comments here okay.

So something like security dot one of the commands that I want as a good is security dot enable, okay. So this is a command and if I provide this command in the Send method will execute it Okay, the comments in our issue the commands will be used which methods and methods so here command is security or tenable, which enable the security of the application Now the next thing when the security is enabled then we have to ignore the certificate errors okay. So for that we have to use again do to dot again we have to use a command a send command and we need to issue the command life security dot okay said ignore certificate errors okay how to use this command security dot set ignore certificate errors we have to go through okay. So this will ignore the certificate errors even though you get some certificate errors on Rosing okay it will be ignored.

Now, once these three steps are done, let's load and inspect your website. So here I already explained this is an insecure website when you try to load this insecure website here. You are getting this certificate expired error, right. So I am going going to give the same thing here. Driver dot, which is giving the insecure website and before loading this insecure website have ignored the certificate error using this code. So if I run this, okay, if I run this the certificate will be error will be ignored and the original application will be loaded.

You can see that in the script now. Okay, this is possible with the help of the doodle space. Okay, the Chrome Dev Tools, we are able to do this enabled to ignore the certificate and load the application. Do you see the application has been loaded because we have ignored the certificate error. Okay, so this is how guess we can use dev tools. That is Chrome dev tools for ignoring the certificate errors.

This is one of the new feature in Selenium for guys. So that's it guys. In the next video session, I am going to explain Another new feature of selenium for that is your knowledge longer need any driver is suitable sir WebDriver manager is okay. So earlier you have to use you have to download some chrome driver DFC or IE driver, ESC and so on, okay to create to learn the browser signed on in selenium, but okay, I'm observing this from few days like, okay with the help of the Selenium four alpha three version and without any need of any driver as you develop a WebDriver. Manager, I will, I am able to, I'm able to learn the browsers, okay. We will launch and use the browsers.

So I will explain about these things in detail in the next video session. So that's it, guys. See you 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.