Selenium Day2- Working with text field, button ,dropdown, CSS locator, Synchronization( implicit & Explicit wait ) & Exceptions

Selenium WebDriver:
-----------------------------------

Environment for WebDriver:
--------------------------
1.JDK
(java -version)
2.Editor
i.e notepad, notepad++, eclipse, netbeans etc.
3.Language Binder
webdriver java libraries needed
4.Browser Drivers
firefox > geckodriver
chrome  > chromedriver

-----------------------------------------------------------
WebDriver functions/methods covered
1.get()  > for opening any url starting with http
2.getTitle()   > for getting current page title
3.click()   > for clicking on any web object
4.sendKeys()  > for typing any text in text field.
5.Select class > for working with dropdown
6.findElement() > for searching any element with specified property
7.findElements() > to find all/mutiple elements with same property
8.isDisplayed, isEnabled(), isSelected  > for getting status whether element displayed ,enabled & selected respectively
9.getAttribute()  > for getting any specific property

----------------------------------------------------------------------------------
CSS Selector:
-------------

1.CSS with ID:
--------------
tagname#id

2.Css with name/value/type/any prop
------------------------------------
tagname[name/value/type='value of that prop']

3.CSS with class
-----------------
tagname.classname


https://opensource-demo.orangehrmlive.com/index.php/auth/login
---------------------------------------------------------------
Synchronization Problem:
------------------------
Matching Speed between two things. In our case Selenium &
AUT(OrangeHRM)

1.Thread.sleep(Not recommended)
    >Its feature of Java
    >Takes whole time
2.Implicitwait
    >Global wait
    >Takes only required time
    >waits only for visibilty of element
3.ExplicitWait
    >Applicable only for specific Element/window/alert
    >Takes only required time
    >waits for Varies combinations i.e visibilty,invisibity
    of element ,alert, frame, attribute etc.
    >Pooling time is 500ms
4.FluentWait


------------------------------------------------------------------------
Exceptions occured in WebDriver
1.IllegalStateException   > due to improper setting of driver path
2.NosuchElementException  >if element is not available on page with specified property
3.TimeOutException        >if element is not displayed in specified time due to explicite wait



Comments