Installing and Uninstalling Add-ons in Firefox

Selenium 4: New Features Selenium 4 - New Featues
11 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.91
List Price:  €65.68
You save:  €18.77
£40.47
List Price:  £56.66
You save:  £16.19
CA$68.51
List Price:  CA$95.92
You save:  CA$27.41
A$77.48
List Price:  A$108.49
You save:  A$31
S$68.13
List Price:  S$95.39
You save:  S$27.25
HK$391.71
List Price:  HK$548.43
You save:  HK$156.71
CHF 45.59
List Price:  CHF 63.83
You save:  CHF 18.24
NOK kr550.63
List Price:  NOK kr770.92
You save:  NOK kr220.29
DKK kr350.03
List Price:  DKK kr490.07
You save:  DKK kr140.04
NZ$84.59
List Price:  NZ$118.44
You save:  NZ$33.84
د.إ183.59
List Price:  د.إ257.05
You save:  د.إ73.45
৳5,482.14
List Price:  ৳7,675.43
You save:  ৳2,193.29
₹4,166.70
List Price:  ₹5,833.71
You save:  ₹1,667.01
RM238.95
List Price:  RM334.55
You save:  RM95.60
₦62,835.43
List Price:  ₦87,974.63
You save:  ₦25,139.20
₨13,901.61
List Price:  ₨19,463.37
You save:  ₨5,561.75
฿1,851.47
List Price:  ฿2,592.21
You save:  ฿740.74
₺1,629.79
List Price:  ₺2,281.84
You save:  ₺652.04
B$258.27
List Price:  B$361.60
You save:  B$103.33
R961.74
List Price:  R1,346.51
You save:  R384.77
Лв91.64
List Price:  Лв128.31
You save:  Лв36.66
₩68,881.10
List Price:  ₩96,439.05
You save:  ₩27,557.95
₪189.07
List Price:  ₪264.71
You save:  ₪75.64
₱2,877.02
List Price:  ₱4,028.06
You save:  ₱1,151.03
¥7,738.45
List Price:  ¥10,834.45
You save:  ¥3,096
MX$855.86
List Price:  MX$1,198.27
You save:  MX$342.41
QR182.16
List Price:  QR255.04
You save:  QR72.88
P691.87
List Price:  P968.68
You save:  P276.80
KSh6,723.65
List Price:  KSh9,413.65
You save:  KSh2,690
E£2,403.50
List Price:  E£3,365.09
You save:  E£961.59
ብር2,843.66
List Price:  ብር3,981.35
You save:  ብር1,137.69
Kz41,738.73
List Price:  Kz58,437.56
You save:  Kz16,698.83
CLP$47,621.97
List Price:  CLP$66,674.57
You save:  CLP$19,052.60
CN¥362.26
List Price:  CN¥507.20
You save:  CN¥144.93
RD$2,946.71
List Price:  RD$4,125.63
You save:  RD$1,178.92
DA6,722.05
List Price:  DA9,411.41
You save:  DA2,689.36
FJ$113.84
List Price:  FJ$159.39
You save:  FJ$45.54
Q388.60
List Price:  Q544.08
You save:  Q155.47
GY$10,450.72
List Price:  GY$14,631.85
You save:  GY$4,181.12
ISK kr7,051.58
List Price:  ISK kr9,872.78
You save:  ISK kr2,821.20
DH506.54
List Price:  DH709.20
You save:  DH202.65
L891.33
List Price:  L1,247.93
You save:  L356.60
ден2,887.76
List Price:  ден4,043.10
You save:  ден1,155.33
MOP$403.15
List Price:  MOP$564.45
You save:  MOP$161.29
N$953.60
List Price:  N$1,335.12
You save:  N$381.51
C$1,838.47
List Price:  C$2,574.01
You save:  C$735.53
रु6,662.39
List Price:  रु9,327.88
You save:  रु2,665.49
S/184.06
List Price:  S/257.70
You save:  S/73.64
K189.83
List Price:  K265.79
You save:  K75.95
SAR187.50
List Price:  SAR262.52
You save:  SAR75.01
ZK1,289.99
List Price:  ZK1,806.09
You save:  ZK516.10
L233.45
List Price:  L326.86
You save:  L93.40
Kč1,185.36
List Price:  Kč1,659.60
You save:  Kč474.24
Ft18,487.45
List Price:  Ft25,883.91
You save:  Ft7,396.45
SEK kr544.30
List Price:  SEK kr762.07
You save:  SEK kr217.76
ARS$43,604.59
List Price:  ARS$61,049.92
You save:  ARS$17,445.32
Bs346.40
List Price:  Bs484.99
You save:  Bs138.58
COP$195,320.69
List Price:  COP$273,464.60
You save:  COP$78,143.90
₡25,002.29
List Price:  ₡35,005.20
You save:  ₡10,002.91
L1,233.13
List Price:  L1,726.48
You save:  L493.35
₲370,137.26
List Price:  ₲518,221.78
You save:  ₲148,084.52
$U1,925.98
List Price:  $U2,696.53
You save:  $U770.54
zł202.69
List Price:  zł283.79
You save:  zł81.09
Already have an account? Log In

Transcript

Hello everyone in this video session I am going to explain part 15 of selenium four that is installing and uninstalling add ons that is extensions in Firefox browser. So in Selenium three we don't have any methods are commands to install or uninstalled add ons that are extensions Okay, we can call anything in Firefox browser these options were options or methods or commands for installing or uninstalling add ons are extensions in Firefox browser are not available in Selenium three in Selenium four. Okay, we got two new comments or methods introducing Selenium four guys that is install extension is one of the methods That got introduced new limbs rhenium for under one is an install extension method. Okay there are two methods introduced in Selenium for for installing and uninstalling add ons or extensions in Firefox browser. Okay. So using these two methods, we can install an uninstaller by Firefox browser add ons or extensions in the Firefox browser.

So let me practically demonstrate this okay how to install and start using this extensions in Firefox browser using the stone methods so that we open this first thing guys you need to create a Maven project and you need to configure this Maven project with Selenium four. And the other thing is like you need to also have the dependency for the WebDriver manager Okay, which I already covered in the past How to create a Maven project and how to configure this project with Selenium for now currently we have the alpha version okay and the WebDriver manager in the already covered this thing in the first video of this video series A Selenium for new features video series Okay, you can go through that if you're not you're not aware of this okay. Assuming that you have created a Maven project and configured that with Selenium core and other things, then create a new clause here right click on this package and say new class they will say 13 so that this public static Weidman, Now firstly write down the basic stuff okay.

Since we have to use these two commands or methods in the Firefox browser. I will be creating a object for this Firefox driver class okay. Firefox driver likes important then WebDriver manager Firefox driver dot setup set the basic steps guys for making your test run smooth driver dot manage dot window dot maximize maximizing the browser window then implicitly waiting okay i'm just giving some implicit wait time for the test to not fail okay this all these four steps are like a basic steps to make your test run smooth after this the Firefox browser will be open and maximize then I would like to install a Firefox browser extension but there are several extensions in Firefox case if you can go to the Firefox and say add ons or something to add ons.mozilla.org you will come here as you can see here there will be good number of add ons as you see Foxy dab YouTube Audio a lot of extensions are there in Firefox add ons.

Okay, and just search for Selenium ID So this is a 1% new ideas click on the Selenium ID and this is a Selenium ID add on in Firefox browser. So if you want to install directly the Selenium ID from the browser itself, okay, you have to click on this Add to Firefox button as you are already aware of. Okay, bye guys. Instead of installing it from the web page I want to install this particular Selenium ID extension using my Selenium automation script. Okay, using these two commands using these two commands, I should be in a position to install and uninstalled this Selenium ID add on now Okay, using Selenium automation script, I want to install this Selenium ID plugin or add on our extension. So for that guys, how to download this extension Okay, I have to download the Selenium IDE add an extension for that.

I will right click on this Add to Firefox button and save link Yes. So now I'm going to save this extension Selenium ID extension into my downloads folder on my machine. Save got saved into my downloads folder that's fine nowadays. So, how to use this command first command that is install extension for installing the Selenium IDE extension that I saved into my machine using the Selenium automation script. So, I have to first caste this WebDriver J's file using the Firefox driver class how to cast a driver like this this driver I have to cast cast using the Firefox driver class then dot dot install okay you see there are two methods Tommy install extension and installment extension methods. These are newly introduced in Selenium for for installing and studying the add ons or extensions in the Firefox browser.

So let's do the install extension first. So when you choose the install extension here it is asking you for the path okay. This this method need to be passed with a path to see this part need to be passed out to pass apart but that you have to say Parts dot get and then replace all this stuff with the double quotes and then put a semicolon here here you need to provide the path of the downloaded Selenium ID extension file. Okay so it's the the file is there in my downloads folder let's go to the Downloads folder in my machine so this is a file that we have saved from the website right Firefox add on extension This is so right click on this and say properties This is a path where this particular file is saved in my nation copy this and put it here and say double slash and then copy the file name with the extension Okay, the extension name with the extension.

Now, this get command of this belongs to Java is past dot get belonged to Java okay. You say Java, so it returns you another thing like path okay? But p is equal to fine So import this from Java again this this is also from Java. So copy this P and put it into the second style extension, okay, this is nothing but the path guys part of this Selenium IDE extension file that is saved in my downloads folder of my machine. Okay. Now if I run this, if I run this code, this install extension commander method of selenium four will install this Selenium ID in the open new instance of the Firefox browser during the Selenium ID automation is used Okay, let's run this and see whether that is getting this happening or not.

Just observe carefully against it will be very fast. So you see Selenium IDE extension is not there. Now, after a while you got it. Okay, this was not there initially when the Firefox browser got launched after a while it got installed. Okay. So you can even add some thread dot kind of things, okay.

And we just before this, I have some thread dot sleep kind of things so that you can observe that Let's do something like five seconds of wait time for the mouse and then okay. Taking time Yes Give it at some time raise at those declarations, that's fine. Now. So this is for installing nice and after installing, I will again say thread dot sleep and uninstall here Okay, same syntax, how to cancel driver to get that method then say dot uninstall extension, but here for uninstall extension for an install extension, you have to get the extension ID How can you get the extension ID? Okay this is not possible here Yes, okay. Cannot get an extension it simply okay.

So after installing okay. Okay when you are installing this Selenium ID extension using this install extension method, this method will return some string this thing an executable okay? This is nothing but the extension ID. So when you are installing some Selenium IDE it will return you the extension ID. So I will print this extension ID and output and use it in an extent. Okay, System dot out dot println you'll understand it So, copy this and do this and print it okay, I am printing the extension ID on installing this required Selenium ID extension using the Selenium Okay.

Now let's run this code and observe that this time it will wait for five seconds before installing. You can clearly see what's happening now. So it will open the Firefox browser first, maximize it and after a while after five seconds it will install here you see no Selenium ID extension is there here. There's not there. After five seconds you'll see that you see after five seconds we go to the Selenium ID Okay and close it guys you see something got printed in the output that is nothing but we have this is extension it we printed it Okay, so install extension command will return the extension ID and we are printing that this is the extension ID guys copy this and again enable this thread dot sleep here after installing and waiting for five seconds before uninstalling them as a Firefox driver driver dot uninstall and you have to provide this in the dub the double quotes you have to provide this Okay, the string is expecting the string like this you have to provide Okay, now to copy this into the double quotes of this uninstall extension method.

Now after that after uninstalling it I'll wait for some time and then I'll say driver dot close and close the browser. Okay. Let's save time see whether this is an extension installing the extension that is led by an extension. I After that it's run install. Okay, let's see. Let's run it and see.

Okay, it should happen. the Firefox browser got launched in Shelly there is no Selenium ID here after a while. This is Eleni Mary got installed. After some time, it will be uninstalled is about uninstalled. And after some time, it will close the browser. You see, this is what has happened.

Okay, this is how to use install, extension and install like extension commands for installing the Firefox browser extensions or add ons or uninstalling the Firefox browser extensions or add ons in using Selenium automation code. So that's it guys. In the next video session, I'll explain other pending topics on Selenium for androids new features. 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.