|
| 1 | +## Selenium Driver with the Python from scratch with examples |
| 2 | + |
| 3 | +## Need to install |
| 4 | +<b>Python<br> |
| 5 | +Selenium ------------------> <i>pip instll selenium</i><br> |
| 6 | +Chromedriver---------------><i>https://chromedriver.chromium.org/getting-started<i><br> |
| 7 | +</b> |
| 8 | + |
| 9 | +<hr> |
| 10 | + |
| 11 | +## Selenium basics 1 |
| 12 | + (i) basics of the selenium web driver small commands<br> |
| 13 | + (ii) minimize and maximise the functionality<br> |
| 14 | + |
| 15 | +<hr> |
| 16 | + |
| 17 | +## Selenium basics 2 |
| 18 | +Navigation commands mainly use to move previous page(<-) and forward page(->) page |
| 19 | +(i) driver.back()<br> |
| 20 | +(ii) driver.forward()<br> |
| 21 | + |
| 22 | +<hr> |
| 23 | + |
| 24 | +## Selenium basics 3 |
| 25 | +Demonstrating the condtional function is_selected, is_enabled, is_displayed() mainly for validation purpose<br> |
| 26 | + (i) is_enabled()<br> |
| 27 | + (ii) is_selected()<br> |
| 28 | + (iii) is_displayed()<br> |
| 29 | + |
| 30 | +<hr> |
| 31 | + |
| 32 | +## Selenium basics 4 |
| 33 | + |
| 34 | +<b>Demonstrating the Waits in selenium web driver</b><br> |
| 35 | + |
| 36 | +Explicit Wait command, the WebDriver is directed to wait until a certain condition occurs before proceeding with executing the code. |
| 37 | +Setting Explicit Wait is important in cases where there are certain elements that naturally take more time to load |
| 38 | +<br> |
| 39 | +Implicit Wait directs the Selenium WebDriver to wait for a certain measure of time before throwing an exception. |
| 40 | +Once this time is set, WebDriver will wait for the element before the exception occurs |
| 41 | +<br> |
| 42 | + |
| 43 | +<hr> |
| 44 | + |
| 45 | +## Selenium basics 5 |
| 46 | +Input Box And Text Box fucntionality using selenium driver <br> |
| 47 | + |
| 48 | +(i) send_keys() to add the message or input into input_box/textarea<br> |
| 49 | +(ii) submit button to submit. <br> |
| 50 | + |
| 51 | + |
| 52 | +<hr> |
| 53 | + |
| 54 | +## Selenium basics 6 |
| 55 | +In this web page we will select the checkbox and radio types of input |
| 56 | +using <br> |
| 57 | + element.click()<br> |
| 58 | +And also check whenever there is a iframe we need to go into iframe using (optional)(Note: we are selecting radio buttons in frame that's why required to go iframe)<br> |
| 59 | + (i)switch_to.frame('frame_id') --> to select the elements in the specific sections<br> |
| 60 | + (ii)switch_to.default_content() --> switch to normal mode always is best practice<br> |
| 61 | + (This two are mostly used in the automation testing perspective. "In safty place like the tracsaction for ex, slack transcation they use nested iframes.)<br> |
| 62 | + |
| 63 | +<hr> |
| 64 | + |
| 65 | +## Selenium basics 7 |
| 66 | +Lets select from the drop down plane with the help of the selenium web driver command by 3 ways as follow: <br> |
| 67 | +Step 1) Select the element using the element = select(driver.find_element()) <br> |
| 68 | +Step 2) Select the value using the following three ways we have <br> |
| 69 | + (i)element.select_by_visible_text("") <br> |
| 70 | + (ii)element.select_by_value("") <br> |
| 71 | + (iii)element.select_by_index() <br> |
| 72 | +<hr> |
| 73 | + |
| 74 | +## Selenium basics 8 |
| 75 | +''' |
| 76 | +We are trying to interact with the links and mainly simply we can get them using the By function <br> |
| 77 | + |
| 78 | +Let's getting the No of the links, all link text, partial link text so we get hands on find_elements function too. <br> |
| 79 | + |
| 80 | + |
| 81 | +another ways to find |
| 82 | +(i) By.LINK_TEXT --> complete text for single element <br> |
| 83 | +(ii) By.PARTIAL_LINK_TEXT --> partial text is enough for finding individual work <br> |
| 84 | +''' |
| 85 | + |
| 86 | +<hr> |
| 87 | + |
| 88 | +## Selenium basics 9 |
| 89 | + |
| 90 | +Let us check how we can handle the alerts and popups on the website using selenium websdrive in python |
| 91 | +<br> |
| 92 | +we can driver.switch_to.alert()<br> |
| 93 | +where multiple things there accept using .accept()<br> |
| 94 | +where multiple things there accept using .dismiss() |
| 95 | +<br> |
| 96 | +another ways to find <br> |
| 97 | +(i) By.LINK_TEXT --> complete text for single element<br> |
| 98 | +(ii) By.PARTIAL_LINK_TEXT --> partial text is enough for finding individual work |
| 99 | +'''<br> |
| 100 | +<hr> |
| 101 | + |
| 102 | +## Selenium basics 10 |
| 103 | +Handling the Windows tab using selenium webdriver with Python<br> |
| 104 | + |
| 105 | +Basics which is necessary to understand.<br> |
| 106 | + |
| 107 | +<hr> |
| 108 | + |
| 109 | +## Selenium basics 11 |
| 110 | + |
| 111 | +handle the scroll in a web page using the python with selenium<br> |
| 112 | + |
| 113 | +<hr> |
| 114 | + |
| 115 | +## Selenium basics 12 |
| 116 | + |
| 117 | +handle the mouse hower or touch on mobile screen actions through the selenium web driver commands<br> |
| 118 | + |
| 119 | + |
| 120 | +## Selenium basics 13 |
| 121 | + |
| 122 | +Double Click action using mouse handling on python selenium<br> |
| 123 | + |
| 124 | +## Selenium basics 14 |
| 125 | + |
| 126 | +perform some more functionality around ActionChain<br> |
| 127 | + |
| 128 | + |
| 129 | +<h3 align="left">Connect with me:</h3> |
| 130 | +<p align="left"> |
| 131 | +<a href="https://www.linkedin.com/in/mohitpeshwani/" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/linked-in-alt.svg" alt="mohit peshwani" height="30" width="40" /></a> |
| 132 | +<a href="https://instagram.com/coding_nightmare" target="blank"><img align="center" src="https://raw.githubusercontent.com/rahuldkjain/github-profile-readme-generator/master/src/images/icons/Social/instagram.svg" alt="coding_nightmare" height="30" width="40" /></a> |
| 133 | +<a href="https://www.figma.com/@mohitpeshwani" target="blank"><img align="center" src="https://logowik.com/content/uploads/images/figma.jpg" alt="mohit peshwani" height="30" width="40" /></a> |
| 134 | +</p> |
0 commit comments