<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Lokesh sharma on Medium]]></title>
        <description><![CDATA[Stories by Lokesh sharma on Medium]]></description>
        <link>https://medium.com/@lokeshsharma596?source=rss-56cf31abfff2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*OVRUGvKIciqsBqWPToQj_w.jpeg</url>
            <title>Stories by Lokesh sharma on Medium</title>
            <link>https://medium.com/@lokeshsharma596?source=rss-56cf31abfff2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 13:42:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lokeshsharma596/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[React JS]]></title>
            <link>https://medium.com/@lokeshsharma596/react-js-bf0be0de621c?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf0be0de621c</guid>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Sat, 11 Jan 2020 09:06:46 GMT</pubDate>
            <atom:updated>2020-01-19T08:05:14.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*acB7EdIeWDFW0caX.jpg" /></figure><h3>1. How React JS Works?</h3><p>React is divided into <em>two</em> major APIs. First, there’s the React DOM. This is the API that’s used to perform the actual rendering on a web page. Second, there’s the React component API. These are the parts of the page that are actually rendered by React DOM.</p><p>Actual Dom →(Create Virtual dom) -<strong>&gt;changes-&gt;(</strong>Create New Virtual Dom)</p><p>When we make any change in our component than react js create a virtual dom for it and compare it with old virtual dom and check where the changes happen. and update actual dom only at certain location. So no full page reload.</p><p>React does so by “mounting” (adding nodes to the DOM), “unmounting” (removing them from the DOM), and “updating” (making changes to nodes already in the DOM).</p><h3>2. What are components?</h3><p>Components are the building blocks of any React app and a typical React app will have many of these. Simply put, a component is a JavaScript class or function that optionally accepts inputs i.e. properties(props) and returns a React element that describes how a section of the UI (User Interface) should appear.</p><p>Two Types of components:</p><p><strong>Functional Comonent:</strong></p><pre><strong>const</strong> Greeting = () =&gt; <strong>&lt;h1&gt;</strong>Hello World today!<strong>&lt;/h1&gt;</strong>;</pre><p><strong>Class Component:</strong></p><pre><strong>class</strong> Greeting <strong>extends</strong> React.Component {<br>  <strong>render()</strong>{<br>    <strong>return</strong> &lt;h1&gt;Hello World Today!&lt;/h1&gt;;<br>  }<br>}</pre><h3><strong>3. NPM Commands:</strong>(www.npmjs.com)</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c760a75989cd545b2841961bcba7dff0/href">https://medium.com/media/c760a75989cd545b2841961bcba7dff0/href</a></iframe><h3>4. Props:</h3><h3>5. State:</h3><p>State is similar to props but it is private and only availabe in component.</p><p>we can only use states in class componenets.</p><p>States are modifiable but props are not.</p><p>Two types you can create states:</p><ol><li><strong>Without constructor</strong></li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ed9b9777ce53c049f2d6bb024a494a8/href">https://medium.com/media/4ed9b9777ce53c049f2d6bb024a494a8/href</a></iframe><p><strong>2. With constructor:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e5252ae149f7503b60d243b97d32d1de/href">https://medium.com/media/e5252ae149f7503b60d243b97d32d1de/href</a></iframe><h3>6. Event Handling:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*usCHtwMAJf4vxLbynm9pAA.png" /></figure><h3><strong>In Class Components:</strong></h3><p>Always use arrow function.(no need to bind this keyword)</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e1c4074a81bdc6aae643bf4f92f097e/href">https://medium.com/media/0e1c4074a81bdc6aae643bf4f92f097e/href</a></iframe><p>if you directly make normal function, You are able to call it but <strong>this</strong> keyword is undefined in it so for access you have to create constructor and also bind <strong>this </strong>keyword .</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/108c440e3a3345198c57dbf8e7989303/href">https://medium.com/media/108c440e3a3345198c57dbf8e7989303/href</a></iframe><p><strong>with state:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fdf77c1ebb2e2e255a1d0c4cfe4e862/href">https://medium.com/media/7fdf77c1ebb2e2e255a1d0c4cfe4e862/href</a></iframe><h4>In Functional Components:</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c03b42360afa9b8ea4ed02ce14dab67d/href">https://medium.com/media/c03b42360afa9b8ea4ed02ce14dab67d/href</a></iframe><h3>Prevent Default Behaviour:</h3><p>You can not return false to prevent default behaviour in react you have to explicitly call it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f164854822b1c4d469f00760513ea088/href">https://medium.com/media/f164854822b1c4d469f00760513ea088/href</a></iframe><h3>Update State using setState:</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c860e18893ce8f2883b42de72680c981/href">https://medium.com/media/c860e18893ce8f2883b42de72680c981/href</a></iframe><h3>7. Hooks:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J128MoR7yZfdmk8rsOwRkQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p25Cykb1IYX3JOo4-a4edg.png" /></figure><p><strong>useState Hook:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f9c1039250c075652a881eda6d5926a0/href">https://medium.com/media/f9c1039250c075652a881eda6d5926a0/href</a></iframe><p><strong>useEffect Hook:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RecJ30teAd0TDcMMALB2EA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AcGu3cEZIm9cDHID3ObeBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vszB8TIWcBzKxBwkQZihNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*MDyS2WhCL5iHCT4d9g2XYQ.png" /></figure><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2124e1d86094d00e228644b3a1a0d0fc/href">https://medium.com/media/2124e1d86094d00e228644b3a1a0d0fc/href</a></iframe><p>useEffect run on every update .but if we want to run it for only certain updates than we write that in a array.here [count]</p><p>Easy and Better way o write:</p><p>//error in code correct it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c8d88edb07fd6e82edc8f7c3256130d/href">https://medium.com/media/3c8d88edb07fd6e82edc8f7c3256130d/href</a></iframe><p><strong>Custom Hook:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1jmS18ECd2ojwsYIFjysg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf0be0de621c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PIPENV]]></title>
            <link>https://medium.com/@lokeshsharma596/pipenv-99a720e6bfd8?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/99a720e6bfd8</guid>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Sat, 14 Dec 2019 06:57:57 GMT</pubDate>
            <atom:updated>2019-12-14T06:57:57.358Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JejLEOpDwfnrX_XG.jpg" /></figure><p><a href="https://docs.pipenv.org/">Pipenv</a> is Python’s officially recommended package management tool. It combines the functionality of Pip and Virtualenv.</p><p><strong>pip + virtualenv = pipenv</strong></p><p>You will need to have Python and pip installed on your system before installing Pipenv.</p><pre>sudo apt-get install python3<br>sudo apt-get install python3-pip</pre><p>install pipenv using pip3</p><pre>pip3 install pipenv</pre><p>go to project folder and</p><pre>pipenv install django</pre><pre>pipenv shell</pre><p>This will create a virtual environment if one doesn’t already exist.</p><p>create a pipfile.</p><p>pipfile is replacement of requirements.txt file</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=99a720e6bfd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basics Before Starting with JS]]></title>
            <link>https://medium.com/@lokeshsharma596/basics-before-starting-with-js-95f2cff1cdd3?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/95f2cff1cdd3</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Sat, 14 Dec 2019 06:55:23 GMT</pubDate>
            <atom:updated>2019-12-23T11:44:22.977Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/739/0*rHvSYHXzcsnSBIgs" /></figure><h3>1. What is DOM?</h3><p>The <strong>Document Object Model (DOM)</strong> defines the <strong>logical structure</strong> of documents and the way a document is <strong>accessed</strong> and <strong>manipulated</strong>.</p><p>JavaScript interacts with HTML document indirectly by interacting with the <strong>DOM</strong>. With the document object model, JavaScript gets all the power it needs to create dynamic HTML.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*gP4loQpY1-BR_2b2.jpg" /></figure><h3>2. Page Load Timing process:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*VrMzh2W_V5lxor2C" /></figure><ol><li>A page load begins when a user selects a hyperlink, submits a form, or types a URL in a browser. This is also referred to as the <strong>initial request</strong> or the <strong>navigation start</strong>. The user’s action sends a <strong>request</strong> across the network to the web application server.</li><li>The request reaches the application for processing. (The request may take some time to start being processed. This could be the result of <strong>request queuing</strong> or it could be other factors.)</li><li>The app finishes processing and sends an HTML <strong>response</strong> back across the network to the user’s browser. This is sometimes referred to as <strong>response start</strong> or <strong>first byte</strong>.</li><li>The user’s browser receives the HTML response and starts to process the Document Object Model, or <strong>DOM</strong>.</li><li>The DOM finishes loading; this point is known as <strong>DOM ready</strong>. Using the DOM, the user’s browser starts to render the page.</li><li>The page finishes rendering in the user’s browser and the <strong>window load event</strong> fires. (For pages that use <a href="https://docs.newrelic.com/docs/browser/single-page-app-monitoring/get-started/welcome-single-page-app-monitoring">asynchronous loading</a>, some elements may continue to load after the window load event occurs.)</li></ol><p>3. JS <strong>it’s single threaded</strong>. That means, code execution will be done one at a time.</p><p><strong>4. What is SSR?</strong></p><p>Server Side Rendering, also called SSR, is the ability of a JavaScript application to render on the server rather than in the browser.</p><p><strong>5. HMR:</strong></p><p>Hot Module Replacement (HMR) exchanges, adds, or removes <a href="https://webpack.js.org/concepts/modules/">modules</a> while an application is running, without a full reload.</p><p><strong>6. Webpack:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aMxqcRAi8abqsgOql8RlnQ.png" /></figure><p>Webpack is an open-source JavaScript module bundler. It is a module bundler primarily for JavaScript, but it can transform front-end assets like HTML, CSS, and images if the corresponding loaders are included. Webpack takes modules with dependencies and generates static assets representing those modules</p><p><strong><em>7. automatic code splitting-</em></strong> which basically means that a page will never load unnecessarily. Every time a file is being imported it automatically gets bundled and served within each page.</p><p><strong>8. Babel: </strong>Babel is a free and open-source JavaScript compiler.</p><p><strong>9. React: </strong>ReactJS is an open-source JavaScript library which is <strong>used for</strong> building user interfaces specifically for single page applications. It’s <strong>used for</strong> handling view layer for web and mobile apps. <strong>React</strong> also allows us to create reusable UI components.</p><p><strong>10. Next Js: </strong>React Framework used for Server side rendering.</p><p><strong>11. Mounting in React:</strong></p><p>The main job of React is to figure out how to modify the DOM to match what the components want to be rendered on the screen.</p><p>React does so by “mounting” (adding nodes to the DOM), “unmounting” (removing them from the DOM), and “updating” (making changes to nodes already in the DOM).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95f2cff1cdd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Command Line Arguments In Python]]></title>
            <link>https://medium.com/@lokeshsharma596/command-line-arguments-in-python-d412c739d53c?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d412c739d53c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Tue, 10 Dec 2019 04:17:18 GMT</pubDate>
            <atom:updated>2019-12-10T04:17:18.550Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PoQAqKyCfCajVmKnlgRNiA.jpeg" /></figure><p>The command line arguments in python can be processed by using either ‘sys’ module.</p><ul><li>The sys.argv takes the command line arguments in the form of a list.</li><li>The first element in the list is the name of the file.</li><li>The arguments always come in the form of a string even if we type an integer in the argument list. We need to use int() function to convert the string to integer.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa4a5dda2c7a74c61a060c3c880e912f/href">https://medium.com/media/fa4a5dda2c7a74c61a060c3c880e912f/href</a></iframe><p>Practice:Find sum of all command line arguments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d412c739d53c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Model Inheritance Styles in Django]]></title>
            <link>https://medium.com/@lokeshsharma596/model-inheritance-styles-in-django-698296f5de06?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/698296f5de06</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[inheritance]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Sun, 08 Dec 2019 13:05:50 GMT</pubDate>
            <atom:updated>2019-12-10T05:37:49.114Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/743/0*loj8X0CGj0Xv_9SN" /></figure><h3><strong>1. Abstract Base Class Inheritance:</strong></h3><p><strong>This style is used when you only want parents class to hold information that you don’t want to type out for each child model.</strong></p><p><strong>models.py</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c3b4900b196ed5c2d0b16fdae0eaacb1/href">https://medium.com/media/c3b4900b196ed5c2d0b16fdae0eaacb1/href</a></iframe><p><strong>admin.py</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6fb11187a2230d3d73117e0e8eadf54f/href">https://medium.com/media/6fb11187a2230d3d73117e0e8eadf54f/href</a></iframe><p>When we migrate these changes than two tables created in database.</p><p>in <strong>Customer Table </strong>we have name,email,address and <strong>Phone</strong> fields.</p><p>in <strong>Staff Table</strong> we have name,email,address and <strong>position</strong> fields.</p><p>Base class Table is not created in This inheritance.</p><h3>2.Multi Table Model Inheritance:</h3><p><strong>This style is used if you are sub-classing an existing model and need each model to have its own database table.</strong></p><p><strong>models.py</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9e993ad53d605f48073c649c88107f44/href">https://medium.com/media/9e993ad53d605f48073c649c88107f44/href</a></iframe><p><strong>admin.py</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/884e04a0894aa9c81cfb8acc3b36c55b/href">https://medium.com/media/884e04a0894aa9c81cfb8acc3b36c55b/href</a></iframe><p>Base class table is also created in this inheritance.</p><p>it will create a one to one field model relationship for Restaurant table from Place table.</p><h3>3. Proxy Model Inheritance:</h3><p><strong>This style is used, if you only want to modify the Python level behaviour of the model, without changing the model’s fields.</strong></p><p>You Inherit from base class and you can add your own properties except fields.</p><p>base class should not be abstract class.</p><p>we can not use multiple inheritance in proxy models.</p><p>The main use of this is to overwrite the main functionalities of existing model.</p><p>it always query on original model with overridden methods.</p><p><strong>Conclusion:</strong></p><p><strong>Abstract Base Class:</strong>No table for base class ,Only for derived class</p><p><strong>Multi Table:</strong>Create table for both base and derived class .</p><p><strong>Proxy Model:</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=698296f5de06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WebServices Introduction :Notes]]></title>
            <link>https://medium.com/@lokeshsharma596/webservices-introduction-notes-50ce1e52ec1f?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/50ce1e52ec1f</guid>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Fri, 06 Dec 2019 06:34:31 GMT</pubDate>
            <atom:updated>2019-12-06T06:48:31.835Z</atom:updated>
            <content:encoded><![CDATA[<h3>WebServices Introduction :Notes</h3><h3>API:</h3><ul><li>Application programming interface</li><li>Communication between two application happen with api.</li><li>Api-locally available(Like selenium api(selenium communicate with google chrome))</li></ul><h3>WebServices:</h3><ul><li>Web Services are over the network api.</li><li>Enable Communication between applications available over the web</li><li>When we request on http protocol and get response on http protocol than called web services.</li><li>webservices Provides a standard protocol/format for communication.</li><li>All web services are api but not all api are web services.</li></ul><h3>Why we Use Webservices:</h3><ul><li>platform independent communication(Two application written in different languages can talk with help of webservices)</li><li>Don’t want to expose business logic to outer world.</li></ul><p>example1:</p><p>App1: Written is Java ,Over a linux platform ,and uses Oracle db</p><p>App2: Written in Python,Over windows platform,and uses mysql db</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*KpQWmWAPEcbDuypwjYhq0Q.png" /></figure><ul><li>Data transfer happens in <strong>JSON/XML</strong> format.</li><li>Unique <strong>AUthentication Key/Token Key</strong> Required for communication.</li><li>Request Json Payload — -→← — Response JSON Payload</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/0*tyJWo2l-TzrB2IHY" /></figure><h3>How Web Services Work:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*hQBthpyjaJ5fycIYoNWTig.png" /></figure><p>Two types:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/381/1*pga1-rqoxQ1ItdJdHY_ToQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*6hsYxyyKuG00BMQGVE292w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/575/0*EPvZqIK3-CFWJLfN" /></figure><h3>What is WSDL and UDDI?</h3><p><strong>WSDL:</strong></p><p>Before Using the web service consumer want to know:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*X2BIOCeNJte_f6RHInyWFg.png" /></figure><p>For that</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/529/1*xtZ2dpN3zoAlid8eoEYpqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*gWX8ugZWlZURAt80PnfztA.png" /></figure><p>Example : <a href="https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl">https://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl</a></p><p><strong>UDDI: </strong>How consumer can get this WSDL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*oPMVWoyRJ8uVrYxhrmd7JQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*2afc0jcib-PjV6HRM6G0xg.png" /></figure><h3><strong>SOAP Web Services:</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*D_8LUcNwFPTiU3wkEE7JVA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*-PlJiNfYX-8Cy7x1L98JIA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*n15rOiPzFI9_hSI6iMUqOg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*mE0dvsYkbcRgBYuxXESbAA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*Ir1cRiveIh362mJyeWuAmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*Ox672i2zER8U8aEiIZt9lw.png" /><figcaption>Envelope</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*PkqdYjkOGCWSfLEn_t0CTg.png" /><figcaption>Header: it is optional</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*TSz3_JHWog6WCOTmKGK6HA.png" /><figcaption>Body</figcaption></figure><h3>Rest Web Services:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RUoYFAXz9rMzqLYkvDeBlA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NKtKVowHv1XClqjBhXRe8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AHDsmzIawsZzrHiihW7eCQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*5juYIAJBxKb4PfkS2RQ3EQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*TCQ8RhMz42LVLNjnzbBh_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*AO4heYcv4N7kOtJVD7TqGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*oljAMRu4xg1NZwCGcZahcw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pRG6B_8LLeSLO0-vPGKniA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*hmSN7QlBvXrjNiY2XAzEWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*wBCJZf1HMNnerRzP-mJG2A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*_LigjtJHvz67rP44KwkwXA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*BGRAmc8zXf9AoT7N-9bSHw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*Q1OYU0T6w0N-GWpE7RYt2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*TKoTrWoqt-Gsk9JQ3PjghQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*Z1vDAurz_LXZutT0eP4nSw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*bHnA9yIMFOoPS-TP0kGVAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*vk6VXroJ2Or3dbcCRPywIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*pMhAZ7SHdX0_y4BtIXdWog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*Xu3mBHkRHsaWufx_xnBcCA.png" /></figure><p>EXTRA:</p><p><strong>WSDL to Document Coversion:</strong></p><p>many websites/tools there which can easily convert it.(<a href="https://tomi.vanek.sk/">https://tomi.vanek.sk/</a>)</p><p><strong>Compare two WSDL:</strong></p><p>many websites/tools available.</p><p>Summary:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*1NcoZMu5FGk_VPdMiY-szQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*h3vGyfAF2u8xFlj4YJ6Yug.png" /></figure><p>Resources: <a href="https://www.youtube.com/playlist?list=PLhW3qG5bs-L9E2KV6vVdB-YTk-sRxmRAB">https://www.youtube.com/playlist?list=PLhW3qG5bs-L9E2KV6vVdB-YTk-sRxmRAB</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50ce1e52ec1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File Handling in Python]]></title>
            <link>https://medium.com/@lokeshsharma596/file-handling-in-python-e9c2868ef3cd?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9c2868ef3cd</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[file-handling]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Tue, 26 Nov 2019 14:16:56 GMT</pubDate>
            <atom:updated>2019-11-26T14:16:56.832Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*CSNc00Zrpo6Bf-rl.png" /></figure><h3>Python File Modes:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/0*CZMzQqblpb9It2IS" /></figure><p><strong>Open and Read:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4248b570aad8f2a4eef771002255db64/href">https://medium.com/media/4248b570aad8f2a4eef771002255db64/href</a></iframe><p>Python reads files by using cursor,This is like cursor you see when you are typing.After a file is read,the cursor is at the end.</p><p>Truncate means erase all data from file and move cursor to initial loaction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r2cXGTT9HPX9eETr.png" /></figure><h3>Seek() and tell():</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6af42385cdc2d5131cd5a4e7f31281be/href">https://medium.com/media/6af42385cdc2d5131cd5a4e7f31281be/href</a></iframe><h3>Reading:</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b4693beb799746b11698b372416be16/href">https://medium.com/media/8b4693beb799746b11698b372416be16/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e21a5798cf4ecc9c91995f28ced6a574/href">https://medium.com/media/e21a5798cf4ecc9c91995f28ced6a574/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/389519b6059d8de0d11abd9388e03684/href">https://medium.com/media/389519b6059d8de0d11abd9388e03684/href</a></iframe><h3><strong>Context manager:</strong></h3><p>After Performing file operations in making always release resource. If they are not released then it will lead to resource leakage and may cause the system to either slow down or crash. It would be very helpful if user have a mechanism for the automatic setup and teardown of resources.In Python, it can be achieved by the usage of context managers which facilitate the proper handling of resources. The most common way of performing file operations is by using the <em>with</em> keyword.</p><p>it automatically close the file after execution.</p><p>it automatically close file when exception occour.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b4693beb799746b11698b372416be16/href">https://medium.com/media/8b4693beb799746b11698b372416be16/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9c2868ef3cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Variables Scope in Python:]]></title>
            <link>https://medium.com/@lokeshsharma596/variables-scope-in-python-be33afe9cc9d?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/be33afe9cc9d</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[variables]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Thu, 21 Nov 2019 09:15:56 GMT</pubDate>
            <atom:updated>2019-11-21T09:15:56.238Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*GKc0JvmFbLq23_-b.jpg" /></figure><ol><li><strong>Global Variables:</strong></li></ol><p>A variable declared outside of the function or in global scope is known as global variable. Global variable can be accessed inside or outside of the function.</p><p><strong>2. Local Variables:</strong></p><p>A variable declared inside the function’s body or in the local scope is known as local variable.Local variable can be accessed only inside function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/842277c7b7645aafec14721d4dfa4056/href">https://medium.com/media/842277c7b7645aafec14721d4dfa4056/href</a></iframe><p><strong>3. Global Keyword:</strong></p><ul><li>We use global keyword to read and write a global variable inside a function.</li><li>Use of global keyword outside a function has no effect</li></ul><p>We able to access global variable inside function without using Global Keyword.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1cd1a42971921c20b2ab15f279ac0171/href">https://medium.com/media/1cd1a42971921c20b2ab15f279ac0171/href</a></iframe><p>But when we modify this variable inside function then it gives error.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb4b0340a26e0732ee87b4f9878ef4a8/href">https://medium.com/media/cb4b0340a26e0732ee87b4f9878ef4a8/href</a></iframe><p>This is because we can only access the global variable but cannot modify it from inside the function.</p><p>For Resolving this we use global keyword:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5f4ad739cdbe9c183f3a42386e19284b/href">https://medium.com/media/5f4ad739cdbe9c183f3a42386e19284b/href</a></iframe><p><strong>4. NonLocal Variables:</strong></p><p>Nonlocal variable are used in nested function whose local scope is not defined. This means, the variable can be neither in the local nor the global scope.</p><p>We use nonlocal keyword to create nonlocal variable.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6f13e3085e71aef485ad71b383a6f496/href">https://medium.com/media/6f13e3085e71aef485ad71b383a6f496/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be33afe9cc9d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Robot Framework 03: Setup and TearDown Methods]]></title>
            <link>https://medium.com/@lokeshsharma596/robot-framework-03-setup-and-teardown-methods-258d4fc22f9?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/258d4fc22f9</guid>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[robot-framework]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Fri, 15 Nov 2019 17:49:53 GMT</pubDate>
            <atom:updated>2019-11-15T17:54:43.230Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/937/1*n0P3nzadZJzFVn89TmsN5g.png" /></figure><p>Often while writing tests you have some setup work that needs to happen before every tests run, and you have some finishing work that needs to happen after every tests run.</p><p>we use <strong>setup</strong> method before each test and<strong> teardown</strong> method after each test case.</p><p><strong>Resources.robot</strong></p><pre><strong>*** Settings ***<br><em>Library  </em></strong><em>SeleniumLibrary<br><br><br><br></em><strong>*** Variables ***<br>${Browser}  </strong><em>Chrome<br></em><strong>${URL}  </strong><em>https://opensource-demo.orangehrmlive.com/<br></em><strong>${Username Locator}  </strong><em>id:txtUsername<br></em><strong>${Username}  </strong><em>Admin<br></em><strong>${Password Locator}  </strong><em>name:txtPassword<br></em><strong>${Password}  </strong><em>admin123<br></em><strong>${Login Button Locator}  </strong><em>xpath://input[@type=&#39;submit&#39;]<br></em><strong>${Forgot Password Locator}  </strong><em>//a[text()=&#39;Forgot your password?&#39;]</em></pre><pre><em><br></em><strong>*** Keywords ***<br>Open Browser And Maximize<br>    </strong>Open Browser  ${URL}  ${Browser}<br>    Maximize Browser Window<br>    Sleep  <em>2s<br><br></em><strong>Close Browser Window<br>    </strong>Close Browser<br>    Log To Console  <em>Test Completed<br><br></em><strong>Login To Portal<br>    </strong>Input Text  ${Username Locator}  ${Username}<br>    Input Text  ${Password Locator}  ${Password}<br>    Click Button  ${Login Button Locator}<br>    Sleep  <em>2s<br><br></em><strong>Forgot Password<br>    </strong>Click Link  ${Forgot Password Locator}<br>    Sleep  <em>2s</em></pre><p><strong>05_Setup_and_Teardown.robot</strong></p><pre><strong>*** Settings ***<br><em>Resource  </em></strong><em>../Resources/Resources.robot<br></em><strong>Test Setup  </strong>Open Browser And Maximize<br><strong>Test Teardown  </strong>Close Browser Window<br><br><br><strong>*** Test Cases ***<br>First Test Case<br>    </strong>Login To Portal<br><br><strong>Second Test Case<br>    </strong>Forgot Password</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*3tLZeaJixe8hHdMShIA2-g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1012/1*4pQRLboRE9yCw2G5pM_D5A.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=258d4fc22f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Robot Framework 02- User Defined Keywords from Resource file]]></title>
            <link>https://medium.com/@lokeshsharma596/robot-framework-02-user-defined-keywords-from-resource-file-6f34018b54a4?source=rss-56cf31abfff2------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f34018b54a4</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[robot-framework]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Lokesh sharma]]></dc:creator>
            <pubDate>Fri, 15 Nov 2019 16:52:21 GMT</pubDate>
            <atom:updated>2019-11-15T17:12:50.367Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*80Mrcia2lmizMo84ZQqMsw.png" /></figure><h3>1. Defining Custom Keywords:</h3><p>User Defined Keywords written into<strong> ***Keywords***</strong> section of script.</p><p>we write two keywords with names <strong>Invoking Browser </strong>and <strong>Enter Data </strong>in<strong> </strong>our script and calling that keywords in our testcase.</p><p><strong>03_User_Defined_Keywords.robot</strong></p><pre><strong>*** Settings ***<br><em>Library  </em></strong><em>SeleniumLibrary<br><br><br></em><strong>*** Variables ***<br>${Browser}  </strong><em>Chrome<br></em><strong>${URL}  </strong><em>https://opensource-demo.orangehrmlive.com/<br><br><br></em><strong>*** Test Cases ***<br>My Test Case<br>    </strong>Invoking Browser<br>    Enter Data<br>    Close Browser<br><br><br><strong>*** Keywords ***<br>Invoking Browser<br>    </strong>Open Browser  ${URL}  ${Browser}<br>    Maximize Browser Window<br><br><strong>Enter Data<br>    </strong>Input Text  <em>id:txtUsername  wrong<br>    </em>Input Text  <em>name:txtPassword  admin123<br>    </em>Clear Element Text  <em>id:txtUsername<br>    </em>Input Text  <em>id:txtUsername  Admin<br>    </em>Click Button  <em>xpath://input[@type=&#39;submit&#39;]</em></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*jxj8RgRNZuBHusKFo5YwqA.png" /></figure><p>Test Report:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*fCsel021Pf_nvzFqaEeP4g.png" /></figure><h3><strong>2. Using Resource file for keywords:</strong></h3><p>we created a folder with name <strong>Resources</strong> in our project and created <strong>Resources.robot</strong> file it it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*RI1URdGEs9y9I-EDli_WrA.png" /></figure><p><strong>Resources.robot</strong></p><pre><strong>*** Settings ***<br><em>Library  </em></strong><em>SeleniumLibrary<br><br><br><br></em><strong>*** Variables ***<br>${Browser}  </strong><em>Chrome<br></em><strong>${URL}  </strong><em>https://opensource-demo.orangehrmlive.com/<br></em><strong>${Username Locator}  </strong><em>id:txtUsername<br></em><strong>${Username}  </strong><em>Admin<br></em><strong>${Password Locator}  </strong><em>name:txtPassword<br></em><strong>${Password}  </strong><em>admin123<br></em><strong>${Login Button Locator}  </strong><em>xpath://input[@type=&#39;submit&#39;]<br><br></em><strong>*** Keywords ***<br>Open Browser And Maximize<br>    </strong>Open Browser  ${URL}  ${Browser}<br>    Maximize Browser Window<br><br><strong>Enter Data<br>    </strong>Input Text  ${Username Locator}  ${Username}<br>    Input Text  ${Password Locator}  ${Password}<br>    Click Button  ${Login Button Locator}</pre><p><strong>04_User_Defined_keywords_From_Resource.robot</strong></p><pre><strong>*** Settings ***<br><em>Resource  </em></strong><em>../Resources/Resources.robot<br><br></em><strong>*** Variables ***<br><br><br>*** Test Cases ***<br>My Test Case<br>    </strong>Open Browser And Maximize<br>    Enter Data<br>    Log To Console  <em>Login Succesfully<br>    </em>Close Browser<br>    Log To Console  <em>Test Completed<br><br><br></em><strong>*** Keywords ***</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GwETlVT7B_qlkKP4x8e-BA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*0-QyL1OSnYwmnSUF2WIgnw.png" /></figure><p>Conclusion:</p><p>We learned how to use User Defined Keywords from Resource file.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f34018b54a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>