Selenium - IDE
The Selenium-IDE (Integrated Development Environment) is an easy-to-use Firefox plug-in for develop Selenium test cases. It provides a Graphical User Interface for recording user actions using Firefox which is used to learn and use Selenium, but it can only be used only with Firefox browser as other browsers are not supported.
However, The recorded scripts can be converted into various programming languages supported by Selenium and the scripts can be executed on various other browsers as well.
Title | Description |
---|---|
Download Selenium IDE | This section deals with how to download and configure selenium IDE |
Selenium IDE Features | This section deals with the features available in Selenium IDE |
Creating Selenium IDE Tests | This section deals with how to create IDE tests using recording feature |
Selenium IDE Script Debugging | This section deals with debugging the selenium IDE script |
Inserting Verification Points | Inserting verification points in selenium IDE is discussed in this section. |
Selenium Pattern Matching | This section deals with how to work with regular expressions using IDE. |
Selenium User Extensions | The Java script that allows user to customize or add new functionality. |
Different Browser Execution | This section deals with how to execute selenium IDE scripts on different browsers. |
Download Selenium IDE:
Step 1 : Launch Firefox and navigate to the URL - http://seleniumhq.org/download/. Under the Selenium IDE section, click on the link that shows the current version number as shown below.
Step 2 : Firefox add-ons notifier pops up with allow and disallow options. User has to allow the installation.
Step 3 : The add-ons installer warns the user about untrusted add-ons. Click 'Install Now'.
Step 4 : The Selenium IDE can now be accessed by navigating to 'Tools' >> 'Selenium IDE'.
Step 5 : The Selenium IDE can also be accessed directly from quick access menu bar as shown below.
Selenium IDE Features:
The Features of Selenium IDE are listed with the help of a simple tool tip as shown below.
The feature of the record tool bar is explained below.
Creating Selenium IDE Tests:
The following steps are involved in creating Selenium tests using IDE
- Recording and adding commands in a test
- Saving the recorded test
- Saving the test suite
- Executing the recorded test
RECORDING AND ADDING COMMANDS IN A TEST
For Demo purposes we will make use of www.ncalculators.com to understand selenium features.
Step 1 : Launch the Firefox browser and navigate to the website - http://www.ncalculators.com/
Step 2 : Open Selenium IDE from the Tools menu and press the record button that is on the top-right corner.
Step 3 : Navigate to "Math Calculator" >> "Percent Calculator >> enter "10" as number1 and 50 as number2 and click "calculate".
Step 4 : User can then Insert a checkpoint by right click on the webelement and select "Show all available commands" >> select "assert text css=b 5"
Step 5 : The recorded script is generated and the script is displayed as shown below.
SAVING THE RECORDED TEST
Step 1 : Save the Test Case by navigating to "File" >> "Save Test" and save the file in the location of your choice. The file is saved as .HTML as default.
The test can also be saved with an extension htm, shtml and xhtml.
SAVING THE TEST SUITE
A test suite is a collection of tests that can be executed as a single entity.
Step 1 : Create a test suite by navigating to "File" >> "New Test Suite" as shown below.
Step 2 : The tests can be recorded one by one by choosing the option "New Test Case" from "File" Menu.
Step 3 : The individual tests are saved with a name alone with saving a "Test Suite".
EXECUTING THE RECORDED TEST
The recorded scripts can then be executed either by clicking "Play entire suite" or "Play current test" button in the tool bar.
Step 1 : The Run status can be can be seen in status pane that displays number of tests passed and failed.
Step 2 : Once a step is executed, user can see the result in "Log" Pane.
Step 3 : After executing each step, the background of the test step turns "Green" if passed and "Red" if failed as shown below.
Selenium IDE Script Debugging:
Debugging is the process of finding and fixing errors in the test script which is a common step of any script development. To Make the process more robust we can make use a plugin "Power Debugger" for Selenium IDE
Step 1 : To Install Power Debugger for Selenium IDE, Navigate to https://addons.mozilla.org/en-US/firefox/addon/power-debugger-selenium-ide/ and click on "Add to Firefox" Link as shown below.
Step 2 : Now launch 'Selenium IDE' and you will notice a new icon, "Pause on Fail" on recording toolbar as shown below. Click on the same to turn it ON. Upon clicking again, it would be turned "OFF".
Step 3 : Users can turn "pause on fail" on or off any time even when the test is running
Step 4 : Once the test case pauses due to a failed step, you can use the usual resume/step buttons to continue the test execution. The execution will NOT be paused if the failure is on the last command of any test case.
Step 5 : We can also use break points to understand what exactly happens during the step. To Insert a break point on a particular step, perform a "Right Click" and select "toggle Break Point" from the context sensitive menu.
Step 6 : Upon inserting the breakpoint, the particular step is displayed with a pause icon as shown below.
Step 7 : When we execute the script, the script execution is paused where the break point is inserted. This will help the user to evaluate the value/presence of an element etc when the execution is in progress.
Inserting Verification Points:
The test cases that we develop also need to check the properties of a web-page. This requires assert and verify commands. There are two ways to insert any verfication points into the script
To Insert any verification point in recording mode, "Right click" on the element and choose "Show all Available Commands" as shown below.
We can also insert a command by performing a "Right Click" and choose "Insert New Command".
After Inserting New command, click 'Command' drop down and select appropriate verification point from the available list of commands as shown below
Below are the mostly used verification commands which will help us to check if a particular step has passed or failed.
- verifyElementPresent
- assertElementPresent
- verifyElementNotPresent
- assertElementNotPresent
- verifyText
- assertText
- verifyAttribute
- assertAttribute
- verifyChecked
- assertChecked
- verifyAlert
- assertAlert
- verifyTitle
- assertTitle
Synchronization points
During Script Execution, the application might respond based on server load, hence it is required for the application and script to be in sync. Below are few commands which we can use to ensure that script and application are in sync.
- waitForAlertNotPresent
- waitForAlertPresent
- waitForElementPresent
- waitForElementNotPresent
- waitForTextPresent
- waitForTextNotPresent
- waitForPageToLoad
- waitForFrameToLoad
Selenium Pattern Matching:
In Selenium IDE, like locators, patterns are a type of parameter which are frequently used by selenium. It allows user to describe patterns with the help of special characters. Many a times, the text that we would like to verify are dynamic in that case pattern matching is very useful.
Pattern Matching is used with all verification points commands - VerifyTextPresent, verifyTitle, verifyAlert, assertConfirmation, verifyText, and verifyPrompt
There are three ways to define a pattern - globbing, regular expressions, and exact.
GLOBBING
Globbing is familiar to most techies who have used file matching patterns in Linux or Windows while searching for a certain file type like *.doc or *.jpg. But globbing in Selenium supports only three special characters: *, ? and [ ].
- * - matches any number of characters.
- ? - matches a single character.
- [ ] - called a character class, lets you match any single character found within the brackets. [0-9] matches any digit
To specify a glob in a selenium command, prefix the pattern with the keyword 'glob:'. For example if you would like to search for the texts "tax year 2013" or "tax year 2014" then you can use "tax year *" glob as shown below.
However the usage of keyword "glob:" is optional while specifies the text pattern because globbing patterns are the default in Selenium.
Command | Target | Value |
---|---|---|
clickAndWait | link=search | |
verifyTextPresent | glob: tax year * |
EXACT PATTERNS
Patterns with the prefix 'exact:' will match the given text as it is. Let us say, the user wants an exact match with the value string, i.e without the glob operator doing its work, one can use the 'exact' pattern as below. In this example the operator '*' will work as a normal character rather then a pattern-matching wildcard character.
Command | Target | Value |
---|---|---|
clickAndWait | link=search | |
verifyValue | exact: *.doc |
REGULAR EXPRESSION PATTERNS
Regular Expressions are the most useful among the pattern matching techniques available. Selenium supports the complete set of reugular expression patterns that Javascript supports. Hence the users are No longer limited by *, ? And [] globbing patterns.
To use RegEx patterns we need to prefix with either "regexp:" or "regexpi:". The prefix "regexpi" is case-insensitive. The glob: and the exact: pattern are the subsets of the Regular Expression patterns. Everything that is done with glob: or exact: can be accomplished with the help of RegExp.
EXAMPLE
For example the following will test if a input field with the id 'name' contains the string 'tax year', 'Tax Year' or 'tax Year'.
Command | Target | Value |
---|---|---|
clickAndWait | link=search | |
verifyValue | id=name | regexp:[Tt]ax ([Yy]ear) |
Selenium User Extensions:
It is easy to extend Selenium IDE by adding customized actions, assertions and locator-strategies This is done with the help of JavaScript by adding methods to the Selenium object prototype. On startup, Selenium will automatically look through methods on these prototypes, using name patterns to recognize which ones are actions, assertions and locators.
Let us add a 'while' Loop in Selenium IDE with the help of JavaScript.
Step 1 : To Add the js file, first navigate to https://github.com/darrenderidder/sideflow/blob/master/sideflow.js and copy the script and place save it as 'sideflow.js' in your local folder as shown below.
Step 2 : Now launch 'Selenium IDE' and Navigate to "Options" >> "Options" as shown below.
Step 3 : Click 'Browse' button under 'Selenium Core Extensions' area and point to the js file that we have saved in Step#1.
Step 4 : Restart Selenium IDE.
Step 5 : Now you will have access to few more commands such as "Label" "While" etc
Step 6 : Now we will be able to create While loop within Selenium IDE and it will be able to execute as shown below.
Different Browser Execution:
Selenium-IDE scripts can only run tests against Firefox as the tool IDE itself a plugin of Firefox. Tests developed using Selenium-IDE can be executed against other browsers by saving it as selenium webdriver or Selenium Remote Control Script.
More on Selenium Webdriver and Selenium Remote Control would be dealt in later chapters.
Step 1 : Open any saved Test in SElenium IDE
Step 2 : Navigate to "File" menu and select "Export Test Suite As" and the options would be listed.
Step 3 : Now let us export the script to "WebDriver" and save it with a name.
Step 4 : The saved webdriver File is displayed as shown below.
We share this information about Selenium RC Procedure very interesting.I'm also working Testing. Your Selenium Information very useful to us.We perhaps Selenium Automation to RC Procedure all think really useful.
ReplyDeleteSelenium Training in Chennai
Nice article about selenium IDE..it was so informative.Thanks for sharing..keep update best selenium training in chennai
ReplyDeletebest selenium training institute in chennai
Thanks for providing the information . The articles in your blog helped me a lot for improving the knowledge on the subject. Also check my small collection on this at selenium Online Training blog
ReplyDeletePerde Modelleri
ReplyDeleteSms Onay
mobil ödeme bozdurma
nftnasilalinir
ANKARA EVDEN EVE NAKLİYAT
TRAFİK SİGORTASI
dedektör
Kurma website
aşk kitapları
Smm panel
ReplyDeleteSmm Panel
iş ilanları
İNSTAGRAM TAKİPÇİ SATIN AL
HIRDAVATÇI BURADA
HTTPS://WWW.BEYAZESYATEKNİKSERVİSİ.COM.TR
Servis
Tiktok Hile
Good content. You write beautiful things.
ReplyDeletevbet
sportsbet
vbet
hacklink
mrbahis
korsan taksi
hacklink
taksi
sportsbet
Good text Write good content success. Thank you
ReplyDeletebetmatik
mobil ödeme bahis
kralbet
kibris bahis siteleri
slot siteleri
poker siteleri
tipobet
betpark
van
ReplyDeleteelazığ
zonguldak
uşak
sakarya
PQ7G
Tokat Lojistik
ReplyDeleteKonya Lojistik
Mersin Lojistik
Karabük Lojistik
Samsun Lojistik
5Hİ16R
810F2
ReplyDeleteVan Evden Eve Nakliyat
Batman Evden Eve Nakliyat
Burdur Evden Eve Nakliyat
Isparta Evden Eve Nakliyat
Diyarbakır Evden Eve Nakliyat
9570A
ReplyDeleteÇerkezköy Buzdolabı Tamircisi
Eskişehir Şehir İçi Nakliyat
Trabzon Şehir İçi Nakliyat
Arg Coin Hangi Borsada
Aptos Coin Hangi Borsada
Denizli Evden Eve Nakliyat
Kars Şehirler Arası Nakliyat
Siirt Şehir İçi Nakliyat
Bitmart Güvenilir mi
F0F55
ReplyDeletebinance indirim kodu %20
E9742
ReplyDeletehttps://referanskodunedir.com.tr/
2CFA2
ReplyDeletesakarya canlı sohbet ücretsiz
ankara canlı sohbet
hatay en iyi rastgele görüntülü sohbet
muğla görüntülü sohbet canlı
samsun kadınlarla rastgele sohbet
canlı sohbet siteleri
kayseri yabancı görüntülü sohbet siteleri
malatya sohbet chat
bayburt görüntülü sohbet canlı
41A0E
ReplyDeletebalıkesir görüntülü canlı sohbet
Kırıkkale Bedava Sohbet Chat Odaları
samsun canlı sohbet
malatya parasız görüntülü sohbet
osmaniye ucretsiz sohbet
rastgele sohbet odaları
chat sohbet
kadınlarla ücretsiz sohbet
balıkesir görüntülü sohbet ücretsiz
7B3A7
ReplyDeleterastgele sohbet siteleri
kütahya canlı sohbet odası
adana görüntülü sohbet uygulama
kadınlarla sohbet et
kastamonu ücretsiz görüntülü sohbet
erzurum en iyi ücretsiz sohbet siteleri
karaman ücretsiz sohbet uygulamaları
kırşehir sesli sohbet siteler
telefonda canlı sohbet
C3711
ReplyDeletesinop kadınlarla görüntülü sohbet
Antalya Kadınlarla Rastgele Sohbet
canlı sohbet siteleri ücretsiz
Hatay Görüntülü Sohbet Canlı
mersin rastgele sohbet siteleri
Kırklareli Canli Sohbet Bedava
sakarya sohbet
Batman Görüntülü Sohbet
niğde canlı sohbet
A05E4
ReplyDeleteBitranium Coin Hangi Borsada
Tumblr Beğeni Hilesi
Tumblr Takipçi Satın Al
Discord Sunucu Üyesi Hilesi
MEME Coin Hangi Borsada
Chat Gpt Coin Hangi Borsada
Sohbet
Parasız Görüntülü Sohbet
Görüntülü Sohbet Parasız
983A7
ReplyDeleteGate io Borsası Güvenilir mi
Threads Yeniden Paylaş Hilesi
Nonolive Takipçi Satın Al
Coin Nasıl Üretilir
Görüntülü Sohbet
Onlyfans Takipçi Hilesi
Bonk Coin Hangi Borsada
Binance'de Kaldıraç Var mı
Bitcoin Oynama
77E4C
ReplyDeletearbitrum
avax
satoshi
safepal
uniswap
poocoin
zkswap
galagames
roninchain
D2A59
ReplyDeleteÇaybaşı
Ağrı
Niğde
Çatalzeytin
Osmaniye
Çüngüş
İzmirli İfşa
Yalova
Saray
62B2CCA0C1
ReplyDeletetelegram cam şov