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
€47.98
List Price:  €67.18
You save:  €19.19
£39.89
List Price:  £55.85
You save:  £15.96
CA$70.14
List Price:  CA$98.21
You save:  CA$28.06
A$76.87
List Price:  A$107.62
You save:  A$30.75
S$67.31
List Price:  S$94.24
You save:  S$26.93
HK$389.14
List Price:  HK$544.83
You save:  HK$155.68
CHF 44.67
List Price:  CHF 62.54
You save:  CHF 17.87
NOK kr553.51
List Price:  NOK kr774.97
You save:  NOK kr221.45
DKK kr357.84
List Price:  DKK kr501
You save:  DKK kr143.16
NZ$85.68
List Price:  NZ$119.95
You save:  NZ$34.27
د.إ183.61
List Price:  د.إ257.07
You save:  د.إ73.46
৳5,972.22
List Price:  ৳8,361.58
You save:  ৳2,389.36
₹4,221.07
List Price:  ₹5,909.84
You save:  ₹1,688.76
RM223.35
List Price:  RM312.71
You save:  RM89.36
₦84,627.22
List Price:  ₦118,484.88
You save:  ₦33,857.66
₨13,887.22
List Price:  ₨19,443.22
You save:  ₨5,556
฿1,722.96
List Price:  ฿2,412.28
You save:  ฿689.32
₺1,727.27
List Price:  ₺2,418.32
You save:  ₺691.05
B$289.99
List Price:  B$406.01
You save:  B$116.02
R907.60
List Price:  R1,270.71
You save:  R363.11
Лв93.82
List Price:  Лв131.35
You save:  Лв37.53
₩70,211.45
List Price:  ₩98,301.65
You save:  ₩28,090.20
₪185.71
List Price:  ₪260.01
You save:  ₪74.30
₱2,946.36
List Price:  ₱4,125.14
You save:  ₱1,178.78
¥7,736.95
List Price:  ¥10,832.35
You save:  ¥3,095.40
MX$1,021.22
List Price:  MX$1,429.79
You save:  MX$408.57
QR182.26
List Price:  QR255.18
You save:  QR72.92
P683.46
List Price:  P956.90
You save:  P273.44
KSh6,472.14
List Price:  KSh9,061.51
You save:  KSh2,589.37
E£2,482.01
List Price:  E£3,475.01
You save:  E£993
ብር6,118.22
List Price:  ብር8,566
You save:  ብር2,447.77
Kz45,640.87
List Price:  Kz63,900.87
You save:  Kz18,260
CLP$48,886.48
List Price:  CLP$68,444.99
You save:  CLP$19,558.50
CN¥362.07
List Price:  CN¥506.93
You save:  CN¥144.86
RD$3,012.01
List Price:  RD$4,217.06
You save:  RD$1,205.04
DA6,712.40
List Price:  DA9,397.90
You save:  DA2,685.50
FJ$113.77
List Price:  FJ$159.29
You save:  FJ$45.51
Q385.78
List Price:  Q540.13
You save:  Q154.34
GY$10,455.70
List Price:  GY$14,638.82
You save:  GY$4,183.11
ISK kr6,980.70
List Price:  ISK kr9,773.54
You save:  ISK kr2,792.83
DH502.76
List Price:  DH703.91
You save:  DH201.14
L910.90
List Price:  L1,275.33
You save:  L364.43
ден2,951.80
List Price:  ден4,132.76
You save:  ден1,180.95
MOP$400.70
List Price:  MOP$561.01
You save:  MOP$160.31
N$906.31
List Price:  N$1,268.91
You save:  N$362.60
C$1,838.97
List Price:  C$2,574.70
You save:  C$735.73
रु6,749.45
List Price:  रु9,449.77
You save:  रु2,700.32
S/189.51
List Price:  S/265.32
You save:  S/75.81
K201.21
List Price:  K281.71
You save:  K80.50
SAR187.68
List Price:  SAR262.77
You save:  SAR75.08
ZK1,382
List Price:  ZK1,934.92
You save:  ZK552.91
L238.86
List Price:  L334.42
You save:  L95.56
Kč1,216.06
List Price:  Kč1,702.59
You save:  Kč486.52
Ft19,746.05
List Price:  Ft27,646.05
You save:  Ft7,900
SEK kr551.69
List Price:  SEK kr772.42
You save:  SEK kr220.72
ARS$50,176.71
List Price:  ARS$70,251.41
You save:  ARS$20,074.70
Bs345.34
List Price:  Bs483.50
You save:  Bs138.16
COP$219,443.60
List Price:  COP$307,238.59
You save:  COP$87,794.99
₡25,456.77
List Price:  ₡35,641.51
You save:  ₡10,184.74
L1,262.95
List Price:  L1,768.23
You save:  L505.28
₲390,155.46
List Price:  ₲546,248.87
You save:  ₲156,093.40
$U2,130.69
List Price:  $U2,983.14
You save:  $U852.45
zł208.13
List Price:  zł291.40
You save:  zł83.27
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.