<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Karthick Srinivasan</title>
    <description>The latest articles on DEV Community by Karthick Srinivasan (@angrybuddha24).</description>
    <link>https://dev.to/angrybuddha24</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F262608%2F8b256a19-2061-4c8e-adc0-5f64b1246de5.jpg</url>
      <title>DEV Community: Karthick Srinivasan</title>
      <link>https://dev.to/angrybuddha24</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/angrybuddha24"/>
    <language>en</language>
    <item>
      <title>50 useful built-in modules in Python</title>
      <dc:creator>Karthick Srinivasan</dc:creator>
      <pubDate>Thu, 05 Jan 2023 05:50:46 +0000</pubDate>
      <link>https://dev.to/angrybuddha24/50-useful-built-in-modules-in-python-1nh0</link>
      <guid>https://dev.to/angrybuddha24/50-useful-built-in-modules-in-python-1nh0</guid>
      <description>&lt;p&gt;Here is a list of 50 useful built-in modules in Python:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;sys - provides access to system-specific parameters and functions&lt;/li&gt;
&lt;li&gt;os - provides functions for interacting with the operating system&lt;/li&gt;
&lt;li&gt;math - provides mathematical functions&lt;/li&gt;
&lt;li&gt;random - provides functions for generating random numbers&lt;/li&gt;
&lt;li&gt;datetime - provides classes for working with dates and times&lt;/li&gt;
&lt;li&gt;json - provides functions for working with JSON data&lt;/li&gt;
&lt;li&gt;re - provides functions for working with regular expressions&lt;/li&gt;
&lt;li&gt;urllib - provides functions for working with URLs&lt;/li&gt;
&lt;li&gt;xml - provides functions for working with XML&lt;/li&gt;
&lt;li&gt;email - provides functions for working with email messages&lt;/li&gt;
&lt;li&gt;hashlib - provides functions for calculating hash values&lt;/li&gt;
&lt;li&gt;hmac - provides functions for calculating HMAC values&lt;/li&gt;
&lt;li&gt;itertools - provides functions for working with iterators&lt;/li&gt;
&lt;li&gt;collections - provides additional data types for working with collections of data&lt;/li&gt;
&lt;li&gt;heapq - provides functions for working with heaps&lt;/li&gt;
&lt;li&gt;bisect - provides functions for working with sorted lists&lt;/li&gt;
&lt;li&gt;array - provides functions for working with arrays&lt;/li&gt;
&lt;li&gt;queue - provides thread-safe FIFO implementation&lt;/li&gt;
&lt;li&gt;struct - provides pack and unpack functions for working with C-style data structures&lt;/li&gt;
&lt;li&gt;threading - provides functions for working with threads&lt;/li&gt;
&lt;li&gt;multipaddress - provides functions for working with IP addresses&lt;/li&gt;
&lt;li&gt;subprocess - provides functions for working with subprocesses&lt;/li&gt;
&lt;li&gt;tempfile - provides functions for working with temporary files and directories&lt;/li&gt;
&lt;li&gt;shutil - provides functions for working with files and directories&lt;/li&gt;
&lt;li&gt;glob - provides functions for working with file patterns&lt;/li&gt;
&lt;li&gt;fnmatch - provides functions for matching file patterns&lt;/li&gt;
&lt;li&gt;fnmatch - provides functions for matching file patterns&lt;/li&gt;
&lt;li&gt;zipfile - provides functions for working with zip archives&lt;/li&gt;
&lt;li&gt;tarfile - provides functions for working with tar archives&lt;/li&gt;
&lt;li&gt;gzip - provides functions for working with gzip files&lt;/li&gt;
&lt;li&gt;bz2 - provides functions for working with bzip2 files&lt;/li&gt;
&lt;li&gt;lzma - provides functions for working with LZMA files&lt;/li&gt;
&lt;li&gt;time - provides functions for working with time&lt;/li&gt;
&lt;li&gt;calendar - provides functions for working with calendars&lt;/li&gt;
&lt;li&gt;locale - provides functions for internationalization&lt;/li&gt;
&lt;li&gt;gettext - provides functions for internationalization&lt;/li&gt;
&lt;li&gt;locale - provides functions for internationalization&lt;/li&gt;
&lt;li&gt;getopt - provides functions for parsing command-line options&lt;/li&gt;
&lt;li&gt;argparse - provides functions for parsing command-line options&lt;/li&gt;
&lt;li&gt;logging - provides functions for logging&lt;/li&gt;
&lt;li&gt;logging.config - provides functions for configuring logging&lt;/li&gt;
&lt;li&gt;logging.handlers - provides additional handler classes for logging&lt;/li&gt;
&lt;li&gt;pprint - provides functions for pretty-printing data structures&lt;/li&gt;
&lt;li&gt;cProfile - provides functions for profiling Python code&lt;/li&gt;
&lt;li&gt;pstats - provides functions for working with profiling statistics&lt;/li&gt;
&lt;li&gt;timeit - provides functions for measuring the execution time of small bits of Python code&lt;/li&gt;
&lt;li&gt;trace - provides functions for tracing the execution of Python code&lt;/li&gt;
&lt;li&gt;unittest - provides a unit testing framework&lt;/li&gt;
&lt;li&gt;doctest - provides a framework for running tests embedded in documentation&lt;/li&gt;
&lt;li&gt;unittest.mock - provides a library for testing in Python&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>emptystring</category>
    </item>
    <item>
      <title>Automating requests in postman which require Authorization</title>
      <dc:creator>Karthick Srinivasan</dc:creator>
      <pubDate>Wed, 13 May 2020 05:59:20 +0000</pubDate>
      <link>https://dev.to/angrybuddha24/automating-requests-in-postman-which-require-authorization-mb1</link>
      <guid>https://dev.to/angrybuddha24/automating-requests-in-postman-which-require-authorization-mb1</guid>
      <description>&lt;p&gt;If sending a request demands new authorization token each and every time, running the requests as a collection might be a little tricky. &lt;br&gt;
Postman provides us an option to parameterize the access token generation process by adding a pre-request script and environment variables.&lt;/p&gt;

&lt;p&gt;Parameterize the authorization at the collection level with the below code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;tokenUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;url&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;clientId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;clientSecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;scope&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;&amp;lt;&amp;gt;&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;getTokenRequest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;tokenUrl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;auth&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;basic&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;basic&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;username&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;urlencoded&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;urlencoded&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;grant_type&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;scope&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;scope&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;]&lt;/span&gt;

    &lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sendRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;getTokenRequest&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;jsonResponse&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
        &lt;span class="nx"&gt;newAccessToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;jsonResponse&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;access_token&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;jsonResponse&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;newAccessToken&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;

    &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;globals&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;accessToken&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;newAccessToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;environment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;accessToken&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;newAccessToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;pm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;variables&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="kd"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;accessToken&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;newAccessToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>apitesting</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>postman</category>
    </item>
    <item>
      <title>Eclipse IDE Shortcuts - A quick reference guide</title>
      <dc:creator>Karthick Srinivasan</dc:creator>
      <pubDate>Mon, 11 May 2020 10:05:25 +0000</pubDate>
      <link>https://dev.to/angrybuddha24/eclipse-ide-shortcuts-a-quick-reference-guide-53gg</link>
      <guid>https://dev.to/angrybuddha24/eclipse-ide-shortcuts-a-quick-reference-guide-53gg</guid>
      <description>&lt;p&gt;Basic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl + M - Max and Min the current window
Ctrl + Space - Intellisense (Autosuggestion)
Ctrl + 1 - Autocorrects and suggests more options (used mostly during compilation errors)
Alt + Up Arrow / Down arrow - to move a line up/down
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Debug mode:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;F5 - Go into the function (step into)
F6 - does the function call and goes to the next function(step over)
F8 - Go ahead and execute the rest of the program (used when step into sysout for eg.)
Inspect - to see what is the current value while debugging
Watch - add an expression like num * 3 or num * sum - to see what value it gives
Double click on a variable's value to change it during the execution
To activate conditional break point, double click on the break point in the breakpoint window and check 'conditional' and 
enter the condition in the text box below (use when we have to debug from the middle elements of an array)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Shortcuts:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl+Shift+L - to see the list of shortcuts in eclipse
Ctrl+Shift+R  - to search for any resource (for searching java classes and directly go there - just user written)
Ctrl+Shift+T - to search for any resource (for searching java classes and directly go there - user written + in built classes)
For the above two searches, just type the capital letters in the class, it will search quickly (For Eg. AL for ArrayList)
Ctrl+/ - Comment/uncomment the entire piece of code
F4 - Double click on a class name and press F4 to see the type hierarchy of classes in the type hierarchy window
(to see the inheritance relationships and all the methods it has)
Ctrl + T - to quickly see the type hierarchy of classes in the same window (doesn't show the methods that class has)
Ctrl + O - to quickly see the methods and variables that class has in the same window (doesn't show the type hierarchy of classes)
Ctrl + D - to delete the current line
Ctrl + L - to go to a particular line
Ctrl + Q - to got the point of last edit
F3 - place the cursor on a particular class and press F3 to go to that class (similar to Ctrl + Left click)
Toggle breadcrumbs - to see the complete path of a file (folder name, package name etc.--&amp;gt; shows jars as well)
Mark occurences - highlight a variable to see whereall it's used
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Refractoring:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl+Shift+M - to extract a method seperately 
Ctrl+Shift+I - to inline that method (opposite of Ctrl+Shift+M)
Alt+Shift+R - to rename a variable and all it's references (use instead of find and replace)
Alt+Shift+L - to extract a local variable
Alt+Shift+I - to inline that variable (opposite of Alt+Shift+L)
Alt+Shift+T - to extract a constant (not a  direct shortcut)
Alt+Shift+C - to change the signature of a method (will add or remove the arguments and will pass the values provided wherever the method is called)
Alt+Shift+V - to move a method from one class to another class
Ctrl+Shift+F - to format the text
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Code generation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Alt+Shift+S - to generate getters and setters (not a  direct shortcut) - select the variables to just generate for the selected ones and not all
use the above shortcut to generate toString methods as well - we can select the required code style as well
use the above shortcut to generate equals and hashcode methods as well
use the above shortcut to generate constructors as well
use the above shortcut to generate override and implement methods as well
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Auto formatting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window-preferences-type 'format'-code style-format- customize the format
window-preferences-type 'save'- editor -save actions - select options accordingly to auto format whenever we save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Views:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl+Alt+H - to view call hierarchy (where the method is called)
F4 - to view type hierarchy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>tutorial</category>
      <category>productivity</category>
      <category>tools</category>
    </item>
    <item>
      <title>Handling Bootstrap Dropdowns in Selenium</title>
      <dc:creator>Karthick Srinivasan</dc:creator>
      <pubDate>Sat, 09 May 2020 11:49:52 +0000</pubDate>
      <link>https://dev.to/angrybuddha24/handling-bootstrap-dropdowns-in-selenium-2aei</link>
      <guid>https://dev.to/angrybuddha24/handling-bootstrap-dropdowns-in-selenium-2aei</guid>
      <description>&lt;p&gt;Handling dropdowns usually involves 4+ lines of code and there are chances of code duplication. Below is the code which makes it easier for us to handle all kinds of dropdowns (single select, multi select, starting with //select tag, starting with //div or other tags etc.) in 2 lines.&lt;/p&gt;

&lt;p&gt;Below is the code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.qa.TestCase&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.List&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.concurrent.TimeUnit&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.stream.Collectors&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openqa.selenium.By&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openqa.selenium.WebDriver&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openqa.selenium.WebElement&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.openqa.selenium.chrome.ChromeDriver&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.testng.annotations.Test&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;io.github.bonigarcia.wdm.WebDriverManager&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;HandleBootStrapDropDownUsingStreams&lt;/span&gt; 
&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="nc"&gt;WebDriver&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Test&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;bootStrap&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;throws&lt;/span&gt; &lt;span class="nc"&gt;InterruptedException&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;WebDriverManager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;chromedriver&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;setup&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;driver&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;ChromeDriver&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;manage&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;window&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;maximize&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;manage&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;deleteAllCookies&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;manage&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;timeouts&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;pageLoadTimeout&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TimeUnit&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SECONDS&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;manage&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;timeouts&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;implicitlyWait&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;TimeUnit&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SECONDS&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;get&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"https://www.jquery-az.com/boots/demo.php?ex=63.0_2"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElement&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;By&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;xpath&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"//button[@class='multiselect dropdown-toggle btn btn-default']"&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;&lt;span class="na"&gt;click&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;

        &lt;span class="nc"&gt;By&lt;/span&gt; &lt;span class="n"&gt;bootStrapDropDown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;By&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;xpath&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"//ul[contains(@class,'multiselect-container')]//li//a//label"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="nc"&gt;HandleBootStrapDropDownUsingStreams&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;printBootStrapDropDownValues&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bootStrapDropDown&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

        &lt;span class="nc"&gt;HandleBootStrapDropDownUsingStreams&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;selectValueFromBootStrapDropDown&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bootStrapDropDown&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"HTML"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;HandleBootStrapDropDownUsingStreams&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;selectValueFromBootStrapDropDown&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bootStrapDropDown&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"CSS"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="nc"&gt;HandleBootStrapDropDownUsingStreams&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;selectValueFromBootStrapDropDown&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bootStrapDropDown&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Angular"&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;//Function to Select a Value from BootStrap Drop Down using Streams.&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;selectValueFromBootStrapDropDown&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;By&lt;/span&gt; &lt;span class="n"&gt;locator&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;WebElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dropDownValues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElements&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locator&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;dropDownValues&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;filter&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getText&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;matches&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;)).&lt;/span&gt;&lt;span class="na"&gt;forEach&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;click&lt;/span&gt;&lt;span class="o"&gt;());&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;

    &lt;span class="c1"&gt;//Function to Print BootStrap Drop Down Values using Streams.&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;printBootStrapDropDownValues&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;By&lt;/span&gt; &lt;span class="n"&gt;locator&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;WebElement&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;dropDownValues&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;driver&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;findElements&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;locator&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
        &lt;span class="n"&gt;dropDownValues&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="o"&gt;().&lt;/span&gt;&lt;span class="na"&gt;map&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;getText&lt;/span&gt;&lt;span class="o"&gt;()).&lt;/span&gt;&lt;span class="na"&gt;collect&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Collectors&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toList&lt;/span&gt;&lt;span class="o"&gt;()).&lt;/span&gt;&lt;span class="na"&gt;forEach&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;out&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;println&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;values&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>selenium</category>
      <category>java</category>
      <category>automation</category>
      <category>testing</category>
    </item>
    <item>
      <title>Downloading Maven jars inside a project folder</title>
      <dc:creator>Karthick Srinivasan</dc:creator>
      <pubDate>Fri, 08 May 2020 08:27:35 +0000</pubDate>
      <link>https://dev.to/angrybuddha24/downloading-maven-jars-inside-a-project-folder-2hh4</link>
      <guid>https://dev.to/angrybuddha24/downloading-maven-jars-inside-a-project-folder-2hh4</guid>
      <description>&lt;p&gt;Sometimes our environment will not support maven repo to download jars. So we can use our project's root directory as repo and add our jars over there by using the structure mentioned in the below in our pom.xml&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;repository&amp;gt;
    &amp;lt;id&amp;gt;in-project&amp;lt;/id&amp;gt;
    &amp;lt;name&amp;gt;In Project Repo&amp;lt;/name&amp;gt;
    &amp;lt;url&amp;gt;file://${project.basedir}/libs&amp;lt;/url&amp;gt;
&amp;lt;/repository&amp;gt;

&amp;lt;dependency&amp;gt;
    &amp;lt;groupId&amp;gt;dropbox&amp;lt;/groupId&amp;gt;
    &amp;lt;artifactId&amp;gt;dropbox-sdk&amp;lt;/artifactId&amp;gt;
    &amp;lt;version&amp;gt;1.3.1&amp;lt;/version&amp;gt;
&amp;lt;/dependency&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>selenium</category>
      <category>automation</category>
      <category>testing</category>
      <category>java</category>
    </item>
    <item>
      <title>Selenium Chrome (version 80 &amp; 81) warnings</title>
      <dc:creator>Karthick Srinivasan</dc:creator>
      <pubDate>Thu, 07 May 2020 13:37:51 +0000</pubDate>
      <link>https://dev.to/angrybuddha24/selenium-chrome-version-80-81-warnings-2e2f</link>
      <guid>https://dev.to/angrybuddha24/selenium-chrome-version-80-81-warnings-2e2f</guid>
      <description>&lt;p&gt;Since the release of Chrome version 80, we all have been getting the 'Timeout warning'. It repeats itself until the browser is opened. Do you want to get rid of selenium chrome driver warnings? &lt;/p&gt;

&lt;p&gt;Here is the simple solution.&lt;br&gt;
Add the below line of code while setting up the driver properties.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;System.setProperty("webdriver.chrome.silentOutput", "true"); 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's a known bug in the versions 80&amp;amp;81 of Chrome browser. Though it will be fixed in upcoming releases, if you don't want to downgrade to version 79 or below, this will help. &lt;/p&gt;

</description>
      <category>selenium</category>
      <category>automation</category>
      <category>testing</category>
      <category>java</category>
    </item>
  </channel>
</rss>
