tag:blogger.com,1999:blog-19083913463766555392024-03-27T23:42:38.928-07:00Software Testing/Automation Testing TutorialsFree online Manual, Java, Selenium , API Testing tutorials for beginners Unknownnoreply@blogger.comBlogger185125tag:blogger.com,1999:blog-1908391346376655539.post-3225437350493290602024-03-18T11:22:00.000-07:002024-03-18T11:26:33.370-07:00RestAssured API Testing Interview Questions<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<h3 style = "color:blue"><marquee>Most Popular Rest Assured Interview Questions</marquee></h3><br>
<br>
<b>1)</b>Difference between Path and Query Parameters with an example<br><br>
<b>2)</b>How to send a GET request using Rest Assured?<br><br>
<b>3)</b>How to log response in Rest Assured only in the case of an error.<br><br>
<b>4)</b>Explain different ways of extracting a single field from a response body.[like using response, JSONPath,XMLPath] and also they will give you the response of a request and ask you to extract the response of a particular field.<br><br>
<b>5)</b>How to mask header information in API testing using Rest Assured?<br><br>
<b>6)</b>How to download a file using rest assured?<br><br>
<b>7)</b>How do you handle form parameters and multipart parameters[uploading media file]?<br><br>
<b>8)</b>They will give you an end to end scenario and ask how will you write the rest assured code for that [ they are trying to understand how well can you do the API chaining here , you can just explain also]<br><br>
<b>9)</b>What import statement will you use for Rest Assured to work?<br><br>
<b>10)</b>How to check that a specific item is present in a collection using Rest Assured?[we can use Matchers here]<br><br>
<b>11)</b>What are the common exceptions you encounter in Rest Assured?<br><br>
<b>12)</b>Explain the rest Assured framework you wrote in your previous org?<br><br>
<b>13)</b>How do you handle data in Rest Assured? [POJO, Excel,config file,HashMaps]<br><br>
<b>14)</b>What is the use of ResponseSpecification in Rest Assured?<br><br>
<b>15)</b>How do you handle authentication and authorization in Rest Assured tests?[basic, oauth,digest,custom]<br><br>
<b>16)</b>What are the common pitfalls or challenges you have faced while using Rest Assured, and how did you overcome them?<br><br>
<b>17)</b>What is the difference between given(), when(), and then() methods in Rest Assured and explain with an example.<br><br>
<b>18)</b>How do you handle cookies in Rest Assured tests?<br><br>
<b>19)</b>How can you handle timeouts and retries in Rest Assured tests?<br><br>
<b>20)</b>Reporting in Rest Assured.<br><br>
<b>21)</b>How do you enable parallel execution of Rest Assured tests? [TestNG,XML]<br><br>
<b>22)</b>How do you verify the status code of an HTTP response using Rest Assured?<br><br>
<b>23)</b>How do you handle dynamic status codes or scenarios where the status code may change between test runs?<br><br>
<b>24)</b>How can you handle dynamic data or parameters in Rest Assured requests?<br><br>
<h3>#RestAssured Interview Question</h3><br> <h3>#Freaquently Asked Rest Assured Interview Question</h3><br>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-30004070124237715512024-03-08T07:59:00.000-08:002024-03-18T11:24:59.236-07:00Cucumber Tutorial with TestNG<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<div>
Hello Friends,<br>
In this article , we will work with Selenium BDD (Behaviour driven development) using <b>Cucumber</b>.<br>
Here we will run our test with TestNG <br><br>
<br><br>
</div><br>
<div>
Now Create a Maven Project <br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR6D9HLCJ9OsZ4j8sfBuQ2vUwkdAF74lT2laZnCLmf2oKG6gqXPIF6P17oVpaNlGm4UMZfjvnOMeTEaZNybabAv0OQNr-93UlRBHFpktwHQXnJYV9wRYY7TrtfcP2UXJ2YEcwasXter9cSvYDfhn0UUs1VVce7Ip5BynTRJV9IFDATvECHvkpzz81z5uk/s1920/MavenCucumber1.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR6D9HLCJ9OsZ4j8sfBuQ2vUwkdAF74lT2laZnCLmf2oKG6gqXPIF6P17oVpaNlGm4UMZfjvnOMeTEaZNybabAv0OQNr-93UlRBHFpktwHQXnJYV9wRYY7TrtfcP2UXJ2YEcwasXter9cSvYDfhn0UUs1VVce7Ip5BynTRJV9IFDATvECHvkpzz81z5uk/s600/MavenCucumber1.png"/></a></div>
<br>
</div>
<div>
Now configure the POM.xml file <b> == ></b>Add Cucumber, TestNG dependency , <b>==>></b> add plugins
<br><br>
<p style = "background-color : white"> <br>
<b><</b>project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"<b>></b><br>
<b><</b>modelVersion>4.0.0<b><</b>/modelVersion<b>></b><br><br>
<b><</b>groupId<b>></b>way2testingCucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>way2testingCucumber<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>0.0.1-SNAPSHOT<b><</b>/version<b>></b><br>
<b><</b>packaging<b>></b>jar<b><</b>/packaging<b>></b><br><br>
<b><</b>name<b>></b>way2testingCucumber<b><</b>/name<b>></b><br>
<b><</b>url<b>></b>http://maven.apache.org<b><</b>/url<b>></b><br><br>
<b><</b>properties<b>></b><br>
<b><</b>project.build.sourceEncoding<b>></b>UTF-8<b><</b>/project.build.sourceEncoding<b>></b><br>
<b><</b>cucumber.version<b>></b>7.14.1<b><</b>/cucumber.version<b>></b><br>
<b><</b>surefire.version<b>></b>3.2.2<b><</b>/surefire.version<b>></b><br>
<b><</b>maven.complier.version<b>></b>3.11.0<b><</b>/maven.complier.version<b>></b><br>
<b><</b>/properties<b>></b><br><br>
<b><</b>dependencies<b>></b><br>
<b><</b>!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId<b>></b>io.cucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>cucumber-java<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>${cucumber.version}<b><</b>/version<b>></b><br>
<b><</b>/dependency<b>></b><br><br>
<b><</b>!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId>io.cucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId>cucumber-junit<b><</b>/artifactId<b>></b><br>
<b><</b>version>${cucumber.version}<b><</b>/version<b>></b><br>
<b><</b>scope>test<b><</b>/scope<b>></b><br>
<b><</b>/dependency<b>></b><br>
<b><</b>!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId<b>></b>io.cucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>cucumber-core<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>${cucumber.version}<b><</b>/version<b>></b><br>
<b><</b>/dependency<b>></b><br>
<b><</b>!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId<b>></b>io.cucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>cucumber-testng<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>${cucumber.version}<b><</b>/version<b>></b><br>
<b><</b>/dependency<b>></b><br><br>
<b><</b>!-- https://mvnrepository.com/artifact/org.testng/testng --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId<b>></b>org.testng<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>testng<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>7.8.0<b><</b>/version<b>></b><br>
<b><</b>scope<b>></b>test<b><</b>/scope<b>></b><br>
<b><</b>/dependency<b>></b><br><br>
<b><</b>!-- https://mvnrepository.com/artifact/junit/junit --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId>junit<b><</b>/groupId<b>></b><br>
<b><</b>artifactId>junit<b><</b>/artifactId<b>></b><br>
<b><</b>version>4.13.1<b><</b>/version<b>></b><br>
<b><</b>scope>test<b><</b>/scope<b>></b><br>
<b><</b>/dependency<b>></b><br><br>
<b><</b>/dependencies<b>></b><br><br>
<b><</b>build<b>></b><br>
<b><</b>pluginManagement></b><br>
<b><</b>plugins<b>></b><br>
<b><</b>plugin<b>></b><br>
<b><</b>groupId>org.apache.maven.plugins<b><</b>/groupId<b>></b><br>
<b><</b>artifactId>maven-compiler-plugin<b><</b>/artifactId<b>></b><br>
<b><</b>version>${maven.complier.version}<b><</b>/version<b>></b><br>
<b><</b>configuration<b>></b><br>
<b><</b>source>1.8<b><</b>/source<b>></b><br>
<b><</b>target>1.8<b><</b>/target<b>></b><br>
<b><</b>/configuration<b>></b><br>
<b><</b>/plugin<b>></b><br>
<b><</b>plugin<b>></b><br>
<b><</b>groupId<b>></b>org.apache.maven.plugins<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>maven-surefire-plugin<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>${surefire.version}<b><</b>/version><b><</b>/plugin<b>></b><br>
<b><</b>configuration<b>></b><br>
<b><</b>source>1.8<b><</b>/source<b>></b><br>
<b><</b>target>1.8<b><</b>/target<b>></b><br>
<b><</b>/configuration<b>></b><br>
<b><</b>/plugin<b>></b> <br>
<b><</b>plugin<b>></b><br>
<b><</b>groupId>org.apache.maven.plugins<b><</b>/groupId<b>></b><br>
<b><</b>artifactId>maven-surefire-plugin<b><</b>/artifactId<b>></b><br>
<b><</b>version>${surefire.version}<b><</b>/version<b>></b><br>
<b><</b>configuration<b>></b><br>
<b><</b>suiteXmlFiles<b>></b><br>
<b><</b>suiteXmlFile>testng.xml<b><</b>/suiteXmlFile<b>></b><br>
<b><</b>/suiteXmlFiles<b>></b><br>
<b><</b>/configuration<b>></b>
<b><</b>/plugins><b><</b>/pluginManagement<b>></b><br><br>
<b><</b>/build<b>></b><br>
<b><</b>/project<b>></b><br><br>
</p> </div>
<div><br><br>
<b style = "color:green">Create a Resource folder and feature file inside it</b><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEdY7scqFW1RSCX_0evLrzWtPsV_DUfwGEw1InR6X4HW4a0ovZQDfvXmRWH__QfzYsuMozX6DX8obffmQBSmhUA22FECn8-fLeDd_UYOmOWLYuvu7rWqF8zOEVxxE8eFhYR8-CmDM3uThjQ8GqB6gBsC-7ONCtyXMeDeW0HqwoiSTHbcPhohQkVs48tIY/s1920/MavenCucumber2.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEdY7scqFW1RSCX_0evLrzWtPsV_DUfwGEw1InR6X4HW4a0ovZQDfvXmRWH__QfzYsuMozX6DX8obffmQBSmhUA22FECn8-fLeDd_UYOmOWLYuvu7rWqF8zOEVxxE8eFhYR8-CmDM3uThjQ8GqB6gBsC-7ONCtyXMeDeW0HqwoiSTHbcPhohQkVs48tIY/s600/MavenCucumber2.png"/></a></div>
<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1H-qMbUyGjDrrUmcAA7x5Fy61_s5Xn8iOCMWA2bQrUPJMZotguYNATDrEBTeOdqmGZoOPJvm0qvd_uKe1HpctHJLKA0xilk6TMkL_a-Fxp01AuBz5uyR8H48zeMAXRDltXQfQTFeqNcs1eyRR-LHJ0JXn0I9GwMd_mKn4goOiiA_nZ5FrTQ8TaanKtnw/s1920/MavenCucumber2.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1H-qMbUyGjDrrUmcAA7x5Fy61_s5Xn8iOCMWA2bQrUPJMZotguYNATDrEBTeOdqmGZoOPJvm0qvd_uKe1HpctHJLKA0xilk6TMkL_a-Fxp01AuBz5uyR8H48zeMAXRDltXQfQTFeqNcs1eyRR-LHJ0JXn0I9GwMd_mKn4goOiiA_nZ5FrTQ8TaanKtnw/s600/MavenCucumber2.png"/></a></div><br><br>
</div>
<div>
<b style = "color:green">Create a package "StepDefinition" and created a class and write all steps definitions</b> <br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTJtAGltPUekQjU0fw9yE2YHeiW96rGudeg3DC0-yc2NmZEqBd95TIeAWZ1X3iNgEPZ-D3kzMd8iS4X9o1Qw7RRugoBG07E1OJAfAVqg9cRns-QqUTG6c-QlJDX2m_gVX6AtcIdHsaYfTo1o4qijQfji2JEoknNbu6qYQ2Ay2vM89E2apGoJm-mPBhMks/s1895/StepDefinitions.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="810" data-original-width="1895" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTJtAGltPUekQjU0fw9yE2YHeiW96rGudeg3DC0-yc2NmZEqBd95TIeAWZ1X3iNgEPZ-D3kzMd8iS4X9o1Qw7RRugoBG07E1OJAfAVqg9cRns-QqUTG6c-QlJDX2m_gVX6AtcIdHsaYfTo1o4qijQfji2JEoknNbu6qYQ2Ay2vM89E2apGoJm-mPBhMks/s600/StepDefinitions.png"/></a></div>
</div> <br><br>
<div>
<b style = "color:green">Create a runner package and a runner class and add Cucumber Options </b> <br>
<p style = "background-color : white">
package Runner;<br>
import io.cucumber.testng.AbstractTestNGCucumberTests; <br>
import io.cucumber.testng.CucumberOptions; <br>
//@RunWith(Cucumber.class)<br>
@CucumberOptions(features = "D:\\Software\\Selenium\\01_Cucumber_Framework_2024\\WorkSpace\\way2testingCucumber\\Resource", <br>
glue = {"Step_definitions"}, <br>
plugin = {"pretty", "html:target/cucumber-reports.html", "json:target/report.json"}, <br>
tags="@Regression", <br>
monochrome =true ) <br>
public class TestRunner extends AbstractTestNGCucumberTests{ <br>
} <br><br>
}</p><br><br><div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLXLItOll-aZfVd0xCCOlA-SfUoVi1RZ3RfNgnuUbe2nUvxuGK64Rbrkl-vIRctVQRh6toAraOajtdxV2c73c46pGuVtI0n4321bVIeXIdinR1LkTdk7mx95ffaQs0ABmZnIziwPaC3UwjfqO4XREZWHDrEUF-IFTZfQ85l3iU0F5_u7DdhXTwbVvayMM/s1920/runner.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLXLItOll-aZfVd0xCCOlA-SfUoVi1RZ3RfNgnuUbe2nUvxuGK64Rbrkl-vIRctVQRh6toAraOajtdxV2c73c46pGuVtI0n4321bVIeXIdinR1LkTdk7mx95ffaQs0ABmZnIziwPaC3UwjfqO4XREZWHDrEUF-IFTZfQ85l3iU0F5_u7DdhXTwbVvayMM/s600/runner.png"/></a></div>
</div><br><br>
<div><b style = "color:blue">Now create TestNG.xml file </b><br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPvFa0V8bjV3SSqRLp0KFrO8uqmCbf95QSXiiQRUMDEDa8ungtvAgx-xkMVUUXdXBjWUsXUYVwc0Bkb9CytKQetpg9XET_DynrQwx02nwAmzNsSXfVPIq4Ixs8gDihbbUw_7S_o0Ys5rD6AlqkTfZaHlJatsdGR4G1u2v5kQTDUw6-2U3wmyn4LTXvVvo/s1920/bbdTestNG.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPvFa0V8bjV3SSqRLp0KFrO8uqmCbf95QSXiiQRUMDEDa8ungtvAgx-xkMVUUXdXBjWUsXUYVwc0Bkb9CytKQetpg9XET_DynrQwx02nwAmzNsSXfVPIq4Ixs8gDihbbUw_7S_o0Ys5rD6AlqkTfZaHlJatsdGR4G1u2v5kQTDUw6-2U3wmyn4LTXvVvo/s600/bbdTestNG.png"/></a></div>
<br><br>
</div>
<div>
<p style = "background-color:white">
<b><</b>?xml version="1.0" encoding="UTF-8"?<b>></b>
<b><</b>!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd"<b>></b> <br>
<b><</b>suite name="Suite"<b>></b> <br>
<b><</b>test thread-count="5" name="Test"<b>></b> <br>
<b><</b>classes<b>></b> <br>
<b><</b>class name = "Runner.TestRunner"/<b>></b> <br>
<b><</b>/classes<b>></b> <br>
<b><</b>/test<b>></b> <b><</b>!-- Test --<b>></b> <br>
<b><</b>/suite<b>></b> <b><</b>!-- Suite --<b>></b> <br><br>
</p>
</div>
<div><b style = "color:blue">Now run the cucumber test either via <b style = "color:red">TestNG</b> or by <b style = "color:green">Maven </b></b>
<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7D9gcN5BjCjcZngJQJcitShU4b_L2WV3F4ixPM5HS7jBSBYjjfX3VdyFAfGwJIJTuw6VsF__3rMakNyRpnS6v-WW5WAKM-bW_X42GP_A29IsK21PxCC4DhUuXMH9mVdFlinCoXCz5nHxFpVs0f35OAgOumw7pAeNuHQwjGWtb-sZNyZjurM81oKXIepI/s1920/RunCucumber.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7D9gcN5BjCjcZngJQJcitShU4b_L2WV3F4ixPM5HS7jBSBYjjfX3VdyFAfGwJIJTuw6VsF__3rMakNyRpnS6v-WW5WAKM-bW_X42GP_A29IsK21PxCC4DhUuXMH9mVdFlinCoXCz5nHxFpVs0f35OAgOumw7pAeNuHQwjGWtb-sZNyZjurM81oKXIepI/s600/RunCucumber.png"/></a></div>
</div><br><br>
<h3><a href = "">SetUp Cucumber Maven TestNG from scratch</a></h3><br>
<h3><a href = "">Create project with Cucumber Maven TestNG from scratch</a></h3><br>
<br><br>
<html> <head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6658533981545355"
crossorigin="anonymous"></script>
</head> <body> </body> </html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-77111743021956897992024-03-02T04:34:00.000-08:002024-03-04T07:49:23.860-08:00Get India State Name By City Name<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Get State Name by City name</title>
<style>
.colorful-blinking-text {
font-size: 24px;
font-weight: bold;
animation: blink 1s infinite alternate, changeColor 3s infinite;
}
@keyframes blink {
to {
opacity: 0;
}
}
@keyframes changeColor {
0% { color: red; }
25% { color: blue; }
50% { color: green; }
75% { color: orange; }
100% { color: purple; }
}
</style>
</head>
<body>
<marquee class="colorful-blinking-text" id="textElement"> Get State Name by City Name in India </marquee>
<br><br>
<p>
<b style = "color:blue">
This article is having a method which will give you state name as per city name.
<br>
This lengthy function don't need to write again , just copy below code and use it as per your need.
</b><br>
<p style = "background-color : white">
import java.util.HashMap; <br>
import java.util.Map; <br><br><br>
public class CountryCityState { <br><br>
public static Object getState(String city) { <br><br>
if(city!=null || !city.isBlank() || !city.isEmpty()) { <br>
Map<String, String> cs = new HashMap<String, String>(); <br>
cs.put("Dispur", "Assam"); <br>
cs.put("Itanagar", "Arunachal Pradesh"); <br>
cs.put("Gandhinagar", "Gujarat"); <br>
cs.put("Visakhapatnam","Andhra Pradesh"); <br>
cs.put("Vijayawada","Andhra Pradesh"); <br>
cs.put("Guntur","Andhra Pradesh"); <br>
cs.put("Nellore","Andhra Pradesh"); <br>
cs.put("Kurnool","Andhra Pradesh"); <br>
cs.put("Kadapa","Andhra Pradesh"); <br>
cs.put("Rajahmundry","Andhra Pradesh"); <br>
cs.put("Kakinada","Andhra Pradesh"); <br>
cs.put("Tirupati","Andhra Pradesh"); <br>
cs.put("Eluru","Andhra Pradesh"); <br>
cs.put("Papum Pare","Arunachal Pradesh"); <br>
cs.put("Changlang","Arunachal Pradesh"); <br>
cs.put("Lohit","Arunachal Pradesh"); <br>
cs.put("West Siang","Arunachal Pradesh"); <br>
cs.put("Tirap","Arunachal Pradesh"); <br>
cs.put("East Siang","Arunachal Pradesh");
cs.put("Lower Subansiri","Arunachal Pradesh"); <br>
cs.put("Lower Dibang Valley","Arunachal Pradesh"); <br>
cs.put("West Kameng","Arunachal Pradesh"); <br>
cs.put("Dibang Valley","Arunachal Pradesh"); <br>
cs.put("Upper Subansiri","Arunachal Pradesh"); <br>
cs.put("East Kameng","Arunachal Pradesh"); <br>
cs.put("Upper Siang","Arunachal Pradesh"); <br>
cs.put("Tawang","Arunachal Pradesh"); <br>
cs.put("Anjaw","Arunachal Pradesh"); <br>
cs.put("Dhubri","Assam"); <br>
cs.put("Morigaon","Assam"); <br>
cs.put("Goalpara","Assam"); <br>
cs.put("Darrangh","Assam"); <br>
cs.put("Nagaon","Assam"); <br>
cs.put("Karimganj","Assam"); <br>
cs.put("Halkndi","Assam"); <br>
cs.put("Barpeta","Assam"); <br>
cs.put("Bongaigaon","Assam"); <br>
cs.put("Cachar","Assam"); <br>
cs.put("Dhemaji","Assam"); <br>
cs.put("Patna","Bihar"); <br>
cs.put("Gaya","Bihar"); <br>
cs.put("Muzaffarpur","Bihar"); <br>
cs.put("Purnia","Bihar"); <br>
cs.put("Begusarai","Bihar"); <br>
cs.put("Bhagalpur","Bihar"); <br>
cs.put("Bihar Sharif","Bihar"); <br>
cs.put("Darbhanga","Bihar"); <br>
cs.put("Arrah","Bihar"); <br>
cs.put("Katihar","Bihar"); <br>
cs.put("Munger","Bihar"); <br>
cs.put("Chhapra","Bihar"); <br>
cs.put("Mehsi","Bihar"); <br>
cs.put("Danapur","Bihar"); <br>
cs.put("Bettiah","Bihar"); <br>
cs.put("Saharsa","Bihar"); <br>
cs.put("Hajipur","Bihar"); <br>
cs.put("Sasaram","Bihar"); <br>
cs.put("Dehri","Bihar"); <br>
cs.put("Siwan","Bihar"); <br>
cs.put("Motihari","Bihar"); <br>
cs.put("Nawada","Bihar"); <br>
cs.put("Bagaha","Bihar"); <br>
cs.put("Buxar","Bihar"); <br>
cs.put("Kishanganj","Bihar"); <br>
cs.put("Sitamarhi","Bihar"); <br>
cs.put("Jamalpur","Bihar"); <br>
cs.put("Jehanabad","Bihar"); <br>
cs.put("Aurangabad","Bihar"); <br>
cs.put("Bastar","Chhattisgarh"); <br>
cs.put("Bijapur","Chhattisgarh"); <br>
cs.put("Bilaspur","Chhattisgarh"); <br>
cs.put("Dantewada","Chhattisgarh"); <br>
cs.put("Dhamtari","Chhattisgarh"); <br>
cs.put("Janjgir Champa","Chhattisgarh"); <br>
cs.put("Jashpur","Chhattisgarh"); <br>
cs.put("Kabirdham","Chhattisgarh"); <br>
cs.put("Kanker","Chhattisgarh"); <br>
cs.put("Korba","Chhattisgarh"); <br>
cs.put("Korea","Chhattisgarh"); <br>
cs.put("Mahasamund","Chhattisgarh"); <br>
cs.put("Narayanpur","Chhattisgarh"); <br>
cs.put("Raigarh","Chhattisgarh"); <br>
cs.put("Raipur","Chhattisgarh"); <br>
cs.put("Rajnandgaon","Chhattisgarh"); <br>
cs.put("Surguja","Chhattisgarh"); <br>
cs.put("Panaji","Goa"); <br>
cs.put("Ahmedabad","Gujarat"); <br>
cs.put("Surat","Gujarat"); <br>
cs.put("Vadodara (Baroda)","Gujarat"); <br>
cs.put("Bhavnagar (Bhaunagar)","Gujarat"); <br>
cs.put("Rajkot","Gujarat"); <br>
cs.put("Jamnagar","Gujarat"); <br>
cs.put("Nadiad","Gujarat"); <br>
cs.put("Junagadh","Gujarat"); <br>
cs.put("Navsari","Gujarat"); <br>
cs.put("Morvi","Gujarat"); <br>
cs.put("Gandhidham","Gujarat"); <br>
cs.put("Bharuch (Broach)","Gujarat"); <br>
cs.put("Anand","Gujarat"); <br>
cs.put("Porbandar","Gujarat"); <br>
cs.put("Mahesana","Gujarat"); <br>
cs.put("Bhuj","Gujarat"); <br>
cs.put("Veraval","Gujarat"); <br>
cs.put("Surendranagar","Gujarat"); <br>
cs.put("Valsad (Bulsar)","Gujarat"); <br>
cs.put("Vapi (Wapi)","Gujarat"); <br>
cs.put("Godhra","Gujarat"); <br>
cs.put("Palanpur","Gujarat"); <br>
cs.put("Anklesvar","Gujarat"); <br>
cs.put("Patan","Gujarat"); <br>
cs.put("Dahod [Dohad]","Gujarat"); <br>
cs.put("Gurgaon","Haryana"); <br>
cs.put("Panchkula","Haryana"); <br>
cs.put("Ambala","Haryana"); <br>
cs.put("Faridabad","Haryana"); <br>
cs.put("Rewari","Haryana"); <br>
cs.put("Jhajjar","Haryana"); <br>
cs.put("Rohtak","Haryana"); <br>
cs.put("Chandigarh","Haryana"); <br>
cs.put("Panipat","Haryana"); <br>
cs.put("Shimla","Himachal Pradesh"); <br>
cs.put("Solan","Himachal Pradesh"); <br>
cs.put("Dharmsala (Dharamsala)","Himachal Pradesh"); <br>
cs.put("Baddi","Himachal Pradesh"); <br>
cs.put("Nahan","Himachal Pradesh"); <br>
cs.put("Mandi","Himachal Pradesh"); <br>
cs.put("Paonta Sahib","Himachal Pradesh"); <br>
cs.put("Sundarnagar","Himachal Pradesh"); <br>
cs.put("Chamba","Himachal Pradesh"); <br>
cs.put("Kullu","Himachal Pradesh"); <br>
cs.put("Ranchi","Jharkhand"); <br>
cs.put("Dhanbad","Jharkhand"); <br>
cs.put("Giridih","Jharkhand"); <br>
cs.put("East Singhbhum","Jharkhand"); <br>
cs.put("Bokaro","Jharkhand"); <br>
cs.put("Bangalore","Karnataka"); <br>
cs.put("Hubli-Dharwad","Karnataka");
cs.put("Mysore","Karnataka");<br>
cs.put("Kalaburagi","Karnataka");<br>
cs.put("Mangalore","Karnataka");<br>
cs.put("Belgaum","Karnataka");<br>
cs.put("Davanagere","Karnataka");<br>
cs.put("Bellary","Karnataka");<br>
cs.put("Vijayapura","Karnataka");<br>
cs.put("Shimoga","Karnataka");<br>
cs.put("Tumkur","Karnataka");<br>
cs.put("Raichur","Karnataka");<br>
cs.put("Bidar","Karnataka");<br>
cs.put("Udupi","Karnataka");<br>
cs.put("Hospet","Karnataka");<br>
cs.put("Gadag-Betageri","Karnataka");<br>
cs.put("Robertsonpet","Karnataka");<br>
cs.put("Hassan","Karnataka");<br>
cs.put("Bhadravati","Karnataka");<br>
cs.put("Chitradurga","Karnataka");<br>
cs.put("Kolar","Karnataka");<br>
cs.put("Mandya","Karnataka");<br>
cs.put("Chikmagalur","Karnataka");<br>
cs.put("Gangavati","Karnataka");<br>
cs.put("Bagalkot","Karnataka");<br>
cs.put("Ranebennuru","Karnataka");<br>
cs.put("Kottayam","Kerala");<br>
cs.put("Pathanamthitta","Kerala");<br>
cs.put("Ernakulam","Kerala");<br>
cs.put("Alappuzha","Kerala");<br>
cs.put("Kannur","Kerala");<br>
cs.put("Thrissur","Kerala");<br>
cs.put("Kozhikode","Kerala");<br>
cs.put("Thiruvananthapuram","Kerala");<br>
cs.put("Indore","Madhya Pradesh");<br>
cs.put("Bhopal [Bhopal]","Madhya Pradesh");<br>
cs.put("Jabalpur","Madhya Pradesh");<br>
cs.put("Gwalior","Madhya Pradesh");<br>
cs.put("Ujjain","Madhya Pradesh");<br>
cs.put("Sagar","Madhya Pradesh");<br>
cs.put("Dewas","Madhya Pradesh");<br>
cs.put("Satna","Madhya Pradesh");<br>
cs.put("Ratlam","Madhya Pradesh");<br>
cs.put("Rewa","Madhya Pradesh");<br>
cs.put("Murwara","Madhya Pradesh");<br>
cs.put("Singrauli","Madhya Pradesh");<br>
cs.put("Burhanpur","Madhya Pradesh");<br>
cs.put("Khandwa","Madhya Pradesh");<br>
cs.put("Morena","Madhya Pradesh");<br>
cs.put("Bhind","Madhya Pradesh");<br>
cs.put("Chhindwara","Madhya Pradesh");<br>
cs.put("Guna","Madhya Pradesh");<br>
cs.put("Shivpuri","Madhya Pradesh");<br>
cs.put("Vidisha","Madhya Pradesh");<br>
cs.put("Damoh","Madhya Pradesh");<br>
cs.put("Chhatarpur","Madhya Pradesh");<br>
cs.put("Mandsaur","Madhya Pradesh");<br>
cs.put("Khargone","Madhya Pradesh");<br>
cs.put("Nimach (Neemuch)","Madhya Pradesh");<br>
cs.put("Thane","Maharashtra");<br>
cs.put("Pune","Maharashtra");<br>
cs.put("Mumbai Suburban","Maharashtra");<br>
cs.put("Nashik","Maharashtra");<br>
cs.put("Nagpur","Maharashtra");<br>
cs.put("Ahmednagar","Maharashtra");<br>
cs.put("Solapur","Maharashtra");<br>
cs.put("Jalgaon","Maharashtra");<br>
cs.put("Imphal West","Manipur");<br>
cs.put("Churachandpur","Manipur");<br>
cs.put("Imphal East","Manipur");<br>
cs.put("Ukhrul","Manipur");<br>
cs.put("Baghmara","Meghalaya");<br>
cs.put("Cherrapunjee (Cherrapunji)","Meghalaya");<br>
cs.put("Jowai","Meghalaya");<br>
cs.put("Lawsohtun","Meghalaya");<br>
cs.put("Madanriting (Madanrting)","Meghalaya");<br>
cs.put("Mairang","Meghalaya");<br>
cs.put("Mawlai","Meghalaya");<br>
cs.put("Mawpat","Meghalaya");<br>
cs.put("Nongkseh","Meghalaya");<br>
cs.put("Nongmynsong","Meghalaya");<br>
cs.put("Nongpoh","Meghalaya");<br>
cs.put("Nongstoin","Meghalaya");<br>
cs.put("Nongthymmai","Meghalaya");<br>
cs.put("Pynthormukhrah (Pynthorumkhrah)","Meghalaya");<br>
cs.put("Resubelpara","Meghalaya");<br>
cs.put("Shillong","Meghalaya");<br>
cs.put("Shillong Cantonment","Meghalaya");<br>
cs.put("Tura","Meghalaya");<br>
cs.put("Umlyngka","Meghalaya");<br>
cs.put("Umpling","Meghalaya");<br>
cs.put("Umroi","Meghalaya");<br>
cs.put("Williamnagar","Meghalaya");<br>
cs.put("Lunglei","Mizoram");<br>
cs.put("Aizawl","Mizoram");<br>
cs.put("Champhai","Mizoram");<br>
cs.put("Mokokchung","Nagaland");<br>
cs.put("Wokha","Nagaland");<br>
cs.put("Zunheboto","Nagaland");<br>
cs.put("Kohima","Nagaland");<br>
cs.put("Dimapur","Nagaland");<br>
cs.put("Bhubaneswar","Odisha");<br>
cs.put("Cuttack","Odisha");<br>
cs.put("Raurkela (Rourkela)","Odisha");<br>
cs.put("Brahmapur (Berhampur)","Odisha");<br>
cs.put("Sambalpur","Odisha");<br>
cs.put("Puri","Odisha");<br>
cs.put("Baleshwar (Balasore)","Odisha");<br>
cs.put("Bhadrak","Odisha");<br>
cs.put("Baripada","Odisha");<br>
cs.put("Balangir","Odisha");<br>
cs.put("Jharsuguda","Odisha");<br>
cs.put("Jaypur","Odisha");<br>
cs.put("Bargarh","Odisha");<br>
cs.put("Brajarajnagar","Odisha");<br>
cs.put("Rayagada","Odisha");<br>
cs.put("Bhawanipatna","Odisha");<br>
cs.put("Paradip","Odisha");<br>
cs.put("Dhenkanal","Odisha");<br>
cs.put("Barbil (Bada Barabil)","Odisha");<br>
cs.put("Jatani","Odisha");<br>
cs.put("Kendujhar (Kendujhargarh)","Odisha");<br>
cs.put("Byasanagar","Odisha");<br>
cs.put("Rajagangapur","Odisha");<br>
cs.put("Sunabeda","Odisha");<br>
cs.put("Koraput","Odisha");<br>
cs.put("Ludhiana","Punjab");<br>
cs.put("Amritsar","Punjab");<br>
cs.put("Jalandhar","Punjab");<br>
cs.put("Patiala","Punjab");<br>
cs.put("Bathinda","Punjab");<br>
cs.put("Hoshiarpur","Punjab");<br>
cs.put("S.A.S. Nagar","Punjab");<br>
cs.put("Moga","Punjab");<br>
cs.put("Batala","Punjab");<br>
cs.put("Pathankot","Punjab");<br>
cs.put("Abohar","Punjab");<br>
cs.put("Malerkotla","Punjab");<br>
cs.put("Khanna","Punjab");<br>
cs.put("Muktsar","Punjab");<br>
cs.put("Barnala","Punjab");<br>
cs.put("Firozpur","Punjab");<br>
cs.put("Kapurthala","Punjab");<br>
cs.put("Phagwara","Punjab");<br>
cs.put("Zirakpur","Punjab");<br>
cs.put("Rajpura","Punjab");<br>
cs.put("Jaipur","Rajasthan");<br>
cs.put("Jodhpur","Rajasthan");<br>
cs.put("Kota","Rajasthan");<br>
cs.put("Bhiwadi","Rajasthan");<br>
cs.put("Bikaner","Rajasthan");<br>
cs.put("Udaipur","Rajasthan");<br>
cs.put("Ajmer","Rajasthan");<br>
cs.put("Bhilwara","Rajasthan");<br>
cs.put("Alwar","Rajasthan");<br>
cs.put("Sikar","Rajasthan");<br>
cs.put("Bharatpur","Rajasthan");<br>
cs.put("Pali","Rajasthan");<br>
cs.put("Sri Ganganagar","Rajasthan");<br>
cs.put("Kishangarh","Rajasthan");<br>
cs.put("Baran","Rajasthan");<br>
cs.put("Dhaulpur","Rajasthan");<br>
cs.put("Tonk","Rajasthan");<br>
cs.put("Beawar","Rajasthan");<br>
cs.put("Hanumangarh","Rajasthan");<br>
cs.put("Banswara","Rajasthan");<br>
cs.put("Dungarpur","Rajasthan");<br>
cs.put("Pratapgarh","Rajasthan");<br>
cs.put("Gangtok","Sikkim");<br>
cs.put("Mangan","Sikkim");<br>
cs.put("Namchi","Sikkim");<br>
cs.put("Gyalshing or Geyzing","Sikkim");<br>
cs.put("Pakyong","Sikkim");<br>
cs.put("Soreng","Sikkim");<br>
cs.put("Chennai ","Tamil Nadu");<br>
cs.put("Coimbatore ","Tamil Nadu");<br>
cs.put("Madurai ","Tamil Nadu");<br>
cs.put("Salem ","Tamil Nadu");<br>
cs.put("Tiruchirappalli ","Tamil Nadu");<br>
cs.put("Thoothukudi ","Tamil Nadu");<br>
cs.put("Tirunelveli ","Tamil Nadu");<br>
cs.put("Tiruppur ","Tamil Nadu");<br>
cs.put("Ambattur ","Tamil Nadu");<br>
cs.put("Avadi ","Tamil Nadu");<br>
cs.put("Tiruvottiyur ","Tamil Nadu");<br>
cs.put("Thanjavur ","Tamil Nadu");<br>
cs.put("Nagercoil ","Tamil Nadu");<br>
cs.put("Dindigul ","Tamil Nadu");<br>
cs.put("Vellore ","Tamil Nadu");<br>
cs.put("Hyderabad","Telangana");<br>
cs.put("Mahbubnagar","Telangana");<br>
cs.put("Adilabad","Telangana");<br>
cs.put("Khammam","Telangana");<br>
cs.put("Nalgonda","Telangana");<br>
cs.put("Warangal","Telangana");<br>
cs.put("Karimnagar","Telangana");<br>
cs.put("Agartala","Tripura");<br>
cs.put("Dharmanagar","Tripura");<br>
cs.put("Udaipur","Tripura");<br>
cs.put("Kailasahar","Tripura");<br>
cs.put("Bishalgarh","Tripura");<br>
cs.put("Teliamura","Tripura");<br>
cs.put("Khowai","Tripura");<br>
cs.put("Belonia","Tripura");<br>
cs.put("Melaghar","Tripura");<br>
cs.put("Mohanpur","Tripura");<br>
cs.put("Ambassa","Tripura");<br>
cs.put("Ranirbazar","Tripura");<br>
cs.put("Santirbazar","Tripura");<br>
cs.put("Kumarghat","Tripura");<br>
cs.put("Sonamura","Tripura");<br>
cs.put("Panisagar","Tripura");<br>
cs.put("Amarpur","Tripura");<br>
cs.put("Jirania","Tripura");<br>
cs.put("Kamalpur","Tripura");<br>
cs.put("Sabroom","Tripura");<br>
cs.put("Allahabad","Uttar Pradesh");<br>
cs.put("Moradabad","Uttar Pradesh");<br>
cs.put("Ghaziabad","Uttar Pradesh");<br>
cs.put("Azamgarh","Uttar Pradesh");<br>
cs.put("Lucknow","Uttar Pradesh");<br>
cs.put("Kanpur","Uttar Pradesh");<br>
cs.put("Jaunpur","Uttar Pradesh");<br>
cs.put("Sitapur","Uttar Pradesh");<br>
cs.put("Bareilly","Uttar Pradesh");<br>
cs.put("Gorakhpur","Uttar Pradesh");<br>
cs.put("Agra","Uttar Pradesh");<br>
cs.put("Muzaffarnagar","Uttar Pradesh");<br>
cs.put("Hardoi","Uttar Pradesh");<br>
cs.put("Kheri","Uttar Pradesh");<br>
cs.put("Dehradun","Uttarakhand");<br>
cs.put("Haridwar","Uttarakhand");<br>
cs.put("Roorkee","Uttarakhand");<br>
cs.put("Haldwani-cum-Kathgodam","Uttarakhand");<br>
cs.put("Rudrapur","Uttarakhand");<br>
cs.put("Kashipur","Uttarakhand");<br>
cs.put("Rishikesh","Uttarakhand");<br>
cs.put("Durgapur","West Bengal");<br>
cs.put("Bardhaman","West Bengal");<br>
cs.put("Malda","West Bengal");<br>
cs.put("Baharampur","West Bengal");<br>
cs.put("Habra","West Bengal");<br>
cs.put("Kharagpur","West Bengal");<br>
cs.put("Santipur","West Bengal");<br>
cs.put("Dankuni","West Bengal");<br>
cs.put("Dhulian","West Bengal");<br>
cs.put("Ranaghat","West Bengal");<br>
cs.put("Haldia","West Bengal");<br>
cs.put("Raiganj","West Bengal");<br>
cs.put("Krishnanagar","West Bengal");<br>
cs.put("Nabadwip","West Bengal");<br>
cs.put("Medinipur","West Bengal");<br>
cs.put("Jalpaiguri","West Bengal");<br>
cs.put("Balurghat","West Bengal");<br>
cs.put("Basirhat","West Bengal");<br>
cs.put("Bankura","West Bengal");<br>
cs.put("Chakdaha","West Bengal");<br>
cs.put("Darjeeling","West Bengal");<br>
cs.put("Alipurduar","West Bengal");<br>
cs.put("Purulia","West Bengal");<br>
cs.put("Jangipur","West Bengal");<br>
cs.put("Bolpur","West Bengal");<br>
cs.put("Bangaon","West Bengal");<br>
cs.put("Cooch Behar","West Bengal");<br>
cs.put("Mumbai","Maharashtra");<br>
cs.put("Delhi","Delhi");<br>
cs.put("Bengaluru","Karnataka");<br>
cs.put("Ahmedabad","Gujarat");<br>
cs.put("Hyderabad","Telangana");<br>
cs.put("Chennai","Tamil Nadu");<br>
cs.put("Kolkata","West Bengal");<br>
cs.put("Pune","Maharashtra");<br>
cs.put("Jaipur","Rajasthan");<br>
cs.put("Surat","Gujarat");<br>
cs.put("Lucknow","Uttar Pradesh");<br>
cs.put("Kanpur","Uttar Pradesh");<br>
cs.put("Nagpur","Maharashtra");<br>
cs.put("Patna","Bihar");<br>
cs.put("Indore","Madhya Pradesh");<br>
cs.put("Thane","Maharashtra");<br>
cs.put("Bhopal","Madhya Pradesh");<br>
cs.put("Visakhapatnam","Andhra Pradesh");<br>
cs.put("Vadodara","Gujarat");<br>
cs.put("Firozabad","Uttar Pradesh");<br>
cs.put("Ludhiana","Punjab");<br>
cs.put("Rajkot","Gujarat");<br>
cs.put("Agra","Uttar Pradesh");<br>
cs.put("Siliguri","West Bengal");<br>
cs.put("Nashik","Maharashtra");<br>
cs.put("Faridabad","Haryana");<br>
cs.put("Patiala","Punjab");<br>
cs.put("Meerut","Uttar Pradesh");<br>
cs.put("Kalyan-Dombivali","Maharashtra");<br>
cs.put("Vasai-Virar","Maharashtra");<br>
cs.put("Varanasi","Uttar Pradesh");<br>
cs.put("Srinagar","Jammu and Kashmir");<br>
cs.put("Dhanbad","Jharkhand");<br>
cs.put("Jodhpur","Rajasthan");<br>
cs.put("Amritsar","Punjab");<br>
cs.put("Raipur","Chhattisgarh");<br>
cs.put("Allahabad","Uttar Pradesh");<br>
cs.put("Coimbatore","Tamil Nadu");<br>
cs.put("Jabalpur","Madhya Pradesh");<br>
cs.put("Gwalior","Madhya Pradesh");<br>
cs.put("Vijayawada","Andhra Pradesh");<br>
cs.put("Madurai","Tamil Nadu");<br>
cs.put("Guwahati","Assam");<br>
cs.put("Chandigarh","Chandigarh");<br>
cs.put("Hubli-Dharwad","Karnataka");<br>
cs.put("Amroha","Uttar Pradesh");<br>
cs.put("Moradabad","Uttar Pradesh");<br>
cs.put("Gurgaon","Haryana");<br>
cs.put("Aligarh","Uttar Pradesh");<br>
cs.put("Solapur","Maharashtra");<br>
cs.put("Ranchi","Jharkhand");<br>
cs.put("Jalandhar","Punjab");<br>
cs.put("Tiruchirappalli","Tamil Nadu");<br>
cs.put("Bhubaneswar","Odisha");<br>
cs.put("Salem","Tamil Nadu");<br>
cs.put("Warangal","Telangana");<br>
cs.put("Mira-Bhayandar","Maharashtra");<br>
cs.put("Thiruvananthapuram","Kerala");<br>
cs.put("Bhiwandi","Maharashtra");<br>
cs.put("Saharanpur","Uttar Pradesh");<br>
cs.put("Guntur","Andhra Pradesh");<br>
cs.put("Amravati","Maharashtra");<br>
cs.put("Bikaner","Rajasthan");<br>
cs.put("Noida","Uttar Pradesh");<br>
cs.put("Jamshedpur","Jharkhand");<br>
cs.put("Bhilai Nagar","Chhattisgarh");<br>
cs.put("Cuttack","Odisha");<br>
cs.put("Kochi","Kerala");<br>
cs.put("Udaipur","Rajasthan");<br>
cs.put("Bhavnagar","Gujarat");<br>
cs.put("Dehradun","Uttarakhand");<br>
cs.put("Asansol","West Bengal");<br>
cs.put("Nanded-Waghala","Maharashtra");<br>
cs.put("Ajmer","Rajasthan");<br>
cs.put("Jamnagar","Gujarat");<br>
cs.put("Ujjain","Madhya Pradesh");<br>
cs.put("Sangli","Maharashtra");<br>
cs.put("Loni","Uttar Pradesh");<br>
cs.put("Jhansi","Uttar Pradesh");<br>
cs.put("Pondicherry","Puducherry");<br>
cs.put("Nellore","Andhra Pradesh");<br>
cs.put("Jammu","Jammu and Kashmir");<br>
cs.put("Belagavi","Karnataka");<br>
cs.put("Raurkela","Odisha");<br>
cs.put("Mangaluru","Karnataka");<br>
cs.put("Tirunelveli","Tamil Nadu");<br>
cs.put("Malegaon","Maharashtra");<br>
cs.put("Gaya","Bihar");<br>
cs.put("Tiruppur","Tamil Nadu");<br>
cs.put("Davanagere","Karnataka");<br>
cs.put("Kozhikode","Kerala");<br>
cs.put("Akola","Maharashtra");<br>
cs.put("Kurnool","Andhra Pradesh");<br>
cs.put("Bokaro Steel City","Jharkhand");<br>
cs.put("Rajahmundry","Andhra Pradesh");<br>
cs.put("Ballari","Karnataka");<br>
cs.put("Agartala","Tripura");<br>
cs.put("Bhagalpur","Bihar");<br>
cs.put("Latur","Maharashtra");<br>
cs.put("Dhule","Maharashtra");<br>
cs.put("Korba","Chhattisgarh");<br>
cs.put("Bhilwara","Rajasthan");<br>
cs.put("Brahmapur","Odisha");<br>
cs.put("Mysore","Karnatka");<br>
cs.put("Muzaffarpur","Bihar");<br>
cs.put("Ahmednagar","Maharashtra");<br>
cs.put("Kollam","Kerala");<br>
cs.put("Raghunathganj","West Bengal");<br>
cs.put("Bilaspur","Chhattisgarh");<br>
cs.put("Shahjahanpur","Uttar Pradesh");<br>
cs.put("Thrissur","Kerala");<br>
cs.put("Alwar","Rajasthan");<br>
cs.put("Kakinada","Andhra Pradesh");<br>
cs.put("Nizamabad","Telangana");<br>
cs.put("Sagar","Madhya Pradesh");<br>
cs.put("Tumkur","Karnataka");<br>
cs.put("Hisar","Haryana");<br>
cs.put("Rohtak","Haryana");<br>
cs.put("Panipat","Haryana");<br>
cs.put("Darbhanga","Bihar");<br>
cs.put("Kharagpur","West Bengal");<br>
cs.put("Aizawl","Mizoram");<br>
cs.put("Ichalkaranji","Maharashtra");<br>
cs.put("Tirupati","Andhra Pradesh");<br>
cs.put("Karnal","Haryana");<br>
cs.put("Bathinda","Punjab");<br>
cs.put("Rampur","Uttar Pradesh");<br>
cs.put("Shivamogga","Karnataka");<br>
cs.put("Ratlam","Madhya Pradesh");<br>
cs.put("Modinagar","Uttar Pradesh");<br>
cs.put("Durg","Chhattisgarh");<br>
cs.put("Shillong","Meghalaya");<br>
cs.put("Imphal","Manipur");<br>
cs.put("Hapur","Uttar Pradesh");<br>
cs.put("Ranipet","Tamil Nadu");<br>
cs.put("Anantapur","Andhra Pradesh");<br>
cs.put("Arrah","Bihar");<br>
cs.put("Karimnagar","Telangana");<br>
cs.put("Parbhani","Maharashtra");<br>
cs.put("Etawah","Uttar Pradesh");<br>
cs.put("Bharatpur","Rajasthan");<br>
cs.put("Begusarai","Bihar");<br>
cs.put("New Delhi","Delhi");<br>
cs.put("Chhapra","Bihar");<br>
cs.put("Kadapa","Andhra Pradesh");<br>
cs.put("Ramagundam","Telangana");<br>
cs.put("Pali","Rajasthan");<br>
cs.put("Satna","Madhya Pradesh");<br>
cs.put("Vizianagaram","Andhra Pradesh");<br>
cs.put("Katihar","Bihar");<br>
cs.put("Hardwar","Uttarakhand");<br>
cs.put("Sonipat","Haryana");<br>
cs.put("Nagercoil","Tamil Nadu");<br>
cs.put("Thanjavur","Tamil Nadu");<br>
cs.put("Murwara (Katni)","Madhya Pradesh");<br>
cs.put("Naihati","West Bengal");<br>
cs.put("Sambhal","Uttar Pradesh");<br>
cs.put("Nadiad","Gujarat");<br>
cs.put("Yamunanagar","Haryana");<br>
cs.put("English Bazar","West Bengal");<br>
cs.put("Eluru","Andhra Pradesh");<br>
cs.put("Munger","Bihar");<br>
cs.put("Panchkula","Haryana");<br>
cs.put("Raayachuru","Karnataka");<br>
cs.put("Panvel","Maharashtra");<br>
cs.put("Deoghar","Jharkhand");<br>
cs.put("Ongole","Andhra Pradesh");<br>
cs.put("Nandyal","Andhra Pradesh");<br>
cs.put("Morena","Madhya Pradesh");<br>
cs.put("Bhiwani","Haryana");<br>
cs.put("Porbandar","Gujarat");<br>
cs.put("Palakkad","Kerala");<br>
cs.put("Anand","Gujarat");<br>
cs.put("Purnia","Bihar");<br>
cs.put("Baharampur","West Bengal");<br>
cs.put("Barmer","Rajasthan");<br>
cs.put("Morvi","Gujarat");<br>
cs.put("Orai","Uttar Pradesh");<br>
cs.put("Bahraich","Uttar Pradesh");<br>
cs.put("Sikar","Rajasthan");<br>
cs.put("Vellore","Tamil Nadu");<br>
cs.put("Singrauli","Madhya Pradesh");<br>
cs.put("Khammam","Telangana");<br>
cs.put("Mahesana","Gujarat");<br>
cs.put("Silchar","Assam");<br>
cs.put("Sambalpur","Odisha");<br>
cs.put("Rewa","Madhya Pradesh");<br>
cs.put("Unnao","Uttar Pradesh");<br>
cs.put("Hugli-Chinsurah","West Bengal");<br>
cs.put("Raiganj","West Bengal");<br>
cs.put("Phusro","Jharkhand");<br>
cs.put("Adityapur","Jharkhand");<br>
cs.put("Alappuzha","Kerala");<br>
cs.put("Bahadurgarh","Haryana");<br>
cs.put("Machilipatnam","Andhra Pradesh");<br>
cs.put("Rae Bareli","Uttar Pradesh");<br>
cs.put("Jalpaiguri","West Bengal");<br>
cs.put("Bharuch","Gujarat");<br>
cs.put("Pathankot","Punjab");<br>
cs.put("Hoshiarpur","Punjab");<br>
cs.put("Baramula","Jammu and Kashmir");<br>
cs.put("Adoni","Andhra Pradesh");<br>
cs.put("Jind","Haryana");<br>
cs.put("Tonk","Rajasthan");<br>
cs.put("Tenali","Andhra Pradesh");<br>
cs.put("Kancheepuram","Tamil Nadu");<br>
cs.put("Vapi","Gujarat");<br>
cs.put("Sirsa","Haryana");<br>
cs.put("Navsari","Gujarat");<br>
cs.put("Mahbubnagar","Telangana");<br>
cs.put("Puri","Odisha");<br>
cs.put("Robertson Pet","Karnataka");<br>
cs.put("Erode","Tamil Nadu");<br>
cs.put("Batala","Punjab");<br>
cs.put("Haldwani-cum-Kathgodam","Uttarakhand");<br>
cs.put("Vidisha","Madhya Pradesh");<br>
cs.put("Saharsa","Bihar");<br>
cs.put("Thanesar","Haryana");<br>
cs.put("Chittoor","Andhra Pradesh");<br>
cs.put("Veraval","Gujarat");<br>
cs.put("Lakhimpur","Uttar Pradesh");<br>
cs.put("Sitapur","Uttar Pradesh");<br>
cs.put("Hindupur","Andhra Pradesh");<br>
cs.put("Santipur","West Bengal");<br>
cs.put("Balurghat","West Bengal");<br>
cs.put("Ganjbasoda","Madhya Pradesh");<br>
cs.put("Moga","Punjab");<br>
cs.put("Proddatur","Andhra Pradesh");<br>
cs.put("Srinagar","Uttarakhand");<br>
cs.put("Medinipur","West Bengal");<br>
cs.put("Habra","West Bengal");<br>
cs.put("Sasaram","Bihar");<br>
cs.put("Hajipur","Bihar");<br>
cs.put("Bhuj","Gujarat");<br>
cs.put("Shivpuri","Madhya Pradesh");<br>
cs.put("Ranaghat","West Bengal");<br>
cs.put("Shimla","Himachal Pradesh");<br>
cs.put("Tiruvannamalai","Tamil Nadu");<br>
cs.put("Kaithal","Haryana");<br>
cs.put("Rajnandgaon","Chhattisgarh");<br>
cs.put("Godhra","Gujarat");<br>
cs.put("Hazaribag","Jharkhand");<br>
cs.put("Bhimavaram","Andhra Pradesh");<br>
cs.put("Mandsaur","Madhya Pradesh");<br>
cs.put("Dibrugarh","Assam");<br>
cs.put("Kolar","Karnataka");<br>
cs.put("Bankura","West Bengal");<br>
cs.put("Mandya","Karnataka");<br>
cs.put("Dehri-on-Sone","Bihar");<br>
cs.put("Madanapalle","Andhra Pradesh");<br>
cs.put("Malerkotla","Punjab");<br>
cs.put("Lalitpur","Uttar Pradesh");<br>
cs.put("Bettiah","Bihar");<br>
cs.put("Pollachi","Tamil Nadu");<br>
cs.put("Khanna","Punjab");<br>
cs.put("Neemuch","Madhya Pradesh");<br>
cs.put("Palwal","Haryana");<br>
cs.put("Palanpur","Gujarat");<br>
cs.put("Guntakal","Andhra Pradesh");<br>
cs.put("Nabadwip","West Bengal");<br>
cs.put("Udupi","Karnataka");<br>
cs.put("Jagdalpur","Chhattisgarh");<br>
cs.put("Motihari","Bihar");<br>
cs.put("Pilibhit","Uttar Pradesh");<br>
cs.put("Dimapur","Nagaland");<br>
cs.put("Mohali","Punjab");<br>
cs.put("Sadulpur","Rajasthan");<br>
cs.put("Rajapalayam","Tamil Nadu");<br>
cs.put("Dharmavaram","Andhra Pradesh");<br>
cs.put("Kashipur","Uttarakhand");<br>
cs.put("Sivakasi","Tamil Nadu");<br>
cs.put("Darjiling","West Bengal");<br>
cs.put("Chikkamagaluru","Karnataka");<br>
cs.put("Gudivada","Andhra Pradesh");<br>
cs.put("Baleshwar Town","Odisha");<br>
cs.put("Mancherial","Telangana");<br>
cs.put("Srikakulam","Andhra Pradesh");<br>
cs.put("Adilabad","Telangana");<br>
cs.put("Yavatmal","Maharashtra");<br>
cs.put("Barnala","Punjab");<br>
cs.put("Nagaon","Assam");<br>
cs.put("Narasaraopet","Andhra Pradesh");<br>
cs.put("Raigarh","Chhattisgarh");<br>
cs.put("Roorkee","Uttarakhand");<br>
cs.put("Valsad","Gujarat");<br>
cs.put("Ambikapur","Chhattisgarh");<br>
cs.put("Giridih","Jharkhand");<br>
cs.put("Chandausi","Uttar Pradesh");<br>
cs.put("Purulia","West Bengal");<br>
cs.put("Patan","Gujarat");<br>
cs.put("Bagaha","Bihar");<br>
cs.put("Hardoi ","Uttar Pradesh");<br>
cs.put("Achalpur","Maharashtra");<br>
cs.put("Osmanabad","Maharashtra");<br>
cs.put("Deesa","Gujarat");<br>
cs.put("Nandurbar","Maharashtra");<br>
cs.put("Azamgarh","Uttar Pradesh");<br>
cs.put("Ramgarh","Jharkhand");<br>
cs.put("Firozpur","Punjab");<br>
cs.put("Baripada Town","Odisha");<br>
cs.put("Karwar","Karnataka");<br>
cs.put("Siwan","Bihar");<br>
cs.put("Rajampet","Andhra Pradesh");<br>
cs.put("Pudukkottai","Tamil Nadu");<br>
cs.put("Anantnag","Jammu and Kashmir");<br>
cs.put("Tadpatri","Andhra Pradesh");<br>
cs.put("Satara","Maharashtra");<br>
cs.put("Bhadrak","Odisha");<br>
cs.put("Kishanganj","Bihar");<br>
cs.put("Suryapet","Telangana");<br>
cs.put("Wardha","Maharashtra");<br>
cs.put("Ranebennuru","Karnataka");<br>
cs.put("Amreli","Gujarat");<br>
cs.put("Neyveli (TS)","Tamil Nadu");<br>
cs.put("Jamalpur","Bihar");<br>
cs.put("Marmagao","Goa");<br>
cs.put("Udgir","Maharashtra");<br>
cs.put("Tadepalligudem","Andhra Pradesh");<br>
cs.put("Nagapattinam","Tamil Nadu");<br>
cs.put("Buxar","Bihar");<br>
cs.put("Aurangabad","Maharashtra");<br>
cs.put("Jehanabad","Bihar");<br>
cs.put("Phagwara","Punjab");<br>
cs.put("Khair","Uttar Pradesh");<br>
cs.put("Sawai Madhopur","Rajasthan");<br>
cs.put("Kapurthala","Punjab");<br>
cs.put("Chilakaluripet","Andhra Pradesh");<br>
cs.put("Aurangabad","Bihar");<br>
cs.put("Malappuram","Kerala");<br>
cs.put("Rewari","Haryana");<br>
cs.put("Nagaur","Rajasthan");<br>
cs.put("Sultanpur","Uttar Pradesh");<br>
cs.put("Nagda","Madhya Pradesh");<br>
cs.put("Port Blair","Andaman and Nicobar Islands");<br>
cs.put("Lakhisarai","Bihar");<br>
cs.put("Panaji","Goa");<br>
cs.put("Tinsukia","Assam");<br>
cs.put("Itarsi","Madhya Pradesh");<br>
cs.put("Kohima","Nagaland");<br>
cs.put("Balangir","Odisha");<br>
cs.put("Nawada","Bihar");<br>
cs.put("Jharsuguda","Odisha");<br>
cs.put("Jagtial","Telangana");<br>
cs.put("Viluppuram","Tamil Nadu");<br>
cs.put("Amalner","Maharashtra");<br>
cs.put("Zirakpur","Punjab");<br>
cs.put("Tanda","Uttar Pradesh");<br>
cs.put("Tiruchengode","Tamil Nadu");<br>
cs.put("Nagina","Uttar Pradesh");<br>
cs.put("Yemmiganur","Andhra Pradesh");<br>
cs.put("Vaniyambadi","Tamil Nadu");<br>
cs.put("Sarni","Madhya Pradesh");<br>
cs.put("Theni Allinagaram","Tamil Nadu");<br>
cs.put("Margao","Goa");<br>
cs.put("Akot","Maharashtra");<br>
cs.put("Sehore","Madhya Pradesh");<br>
cs.put("Mhow Cantonment","Madhya Pradesh");<br>
cs.put("Kot Kapura","Punjab");<br>
cs.put("Makrana","Rajasthan");<br>
cs.put("Pandharpur","Maharashtra");<br>
cs.put("Miryalaguda","Telangana");<br>
cs.put("Shamli","Uttar Pradesh");<br>
cs.put("Seoni","Madhya Pradesh");<br>
cs.put("Ranibennur","Karnataka");<br>
cs.put("Kadiri","Andhra Pradesh");<br>
cs.put("Shrirampur","Maharashtra");<br>
cs.put("Rudrapur","Uttarakhand");<br>
cs.put("Parli","Maharashtra");<br>
cs.put("Najibabad","Uttar Pradesh");<br>
cs.put("Nirmal","Telangana");<br>
cs.put("Udhagamandalam","Tamil Nadu");<br>
cs.put("Shikohabad","Uttar Pradesh");<br>
cs.put("Jhumri Tilaiya","Jharkhand");<br>
cs.put("Aruppukkottai","Tamil Nadu");<br>
cs.put("Ponnani","Kerala");<br>
cs.put("Jamui","Bihar");<br>
cs.put("Sitamarhi","Bihar");<br>
cs.put("Chirala","Andhra Pradesh");<br>
cs.put("Anjar","Gujarat");<br>
cs.put("Karaikal","Puducherry");<br>
cs.put("Hansi","Haryana");<br>
cs.put("Anakapalle","Andhra Pradesh");<br>
cs.put("Mahasamund","Chhattisgarh");<br>
cs.put("Faridkot","Punjab");<br>
cs.put("Saunda","Jharkhand");<br>
cs.put("Dhoraji","Gujarat");<br>
cs.put("Paramakudi","Tamil Nadu");<br>
cs.put("Balaghat","Madhya Pradesh");<br>
cs.put("Sujangarh","Rajasthan");<br>
cs.put("Khambhat","Gujarat");<br>
cs.put("Muktsar","Punjab");<br>
cs.put("Rajpura","Punjab");<br>
cs.put("Kavali","Andhra Pradesh");<br>
cs.put("Dhamtari","Chhattisgarh");<br>
cs.put("Ashok Nagar","Madhya Pradesh");<br>
cs.put("Sardarshahar","Rajasthan");<br>
cs.put("Mahuva","Gujarat");<br>
cs.put("Bargarh","Odisha");<br>
cs.put("Kamareddy","Telangana");<br>
cs.put("Sahibganj","Jharkhand");<br>
cs.put("Kothagudem","Telangana");<br>
cs.put("Ramanagaram","Karnataka");<br>
cs.put("Gokak","Karnataka");<br>
cs.put("Tikamgarh","Madhya Pradesh");<br>
cs.put("Araria","Bihar");<br>
cs.put("Rishikesh","Uttarakhand");<br>
cs.put("Shahdol","Madhya Pradesh");<br>
cs.put("Medininagar (Daltonganj)","Jharkhand");<br>
cs.put("Arakkonam","Tamil Nadu");<br>
cs.put("Washim","Maharashtra");<br>
cs.put("Sangrur","Punjab");<br>
cs.put("Bodhan","Telangana");<br>
cs.put("Fazilka","Punjab");<br>
cs.put("Palacole","Andhra Pradesh");<br>
cs.put("Keshod","Gujarat");<br>
cs.put("Sullurpeta","Andhra Pradesh");<br>
cs.put("Wadhwan","Gujarat");<br>
cs.put("Gurdaspur","Punjab");<br>
cs.put("Vatakara","Kerala");<br>
cs.put("Tura","Meghalaya");<br>
cs.put("Narnaul","Haryana");<br>
cs.put("Kharar","Punjab");<br>
cs.put("Yadgir","Karnataka");<br>
cs.put("Ambejogai","Maharashtra");<br>
cs.put("Ankleshwar","Gujarat");<br>
cs.put("Savarkundla","Gujarat");<br>
cs.put("Paradip","Odisha");<br>
cs.put("Virudhachalam","Tamil Nadu");<br>
cs.put("Kanhangad","Kerala");<br>
cs.put("Kadi","Gujarat");<br>
cs.put("Srivilliputhur","Tamil Nadu");<br>
cs.put("Gobindgarh","Punjab");<br>
cs.put("Tindivanam","Tamil Nadu");<br>
cs.put("Mansa","Punjab");<br>
cs.put("Taliparamba","Kerala");<br>
cs.put("Manmad","Maharashtra");<br>
cs.put("Tanuku","Andhra Pradesh");<br>
cs.put("Rayachoti","Andhra Pradesh");<br>
cs.put("Virudhunagar","Tamil Nadu");<br>
cs.put("Koyilandy","Kerala");<br>
cs.put("Jorhat","Assam");<br>
cs.put("Karur","Tamil Nadu");<br>
cs.put("Valparai","Tamil Nadu");<br>
cs.put("Srikalahasti","Andhra Pradesh");<br>
cs.put("Neyyattinkara","Kerala");<br>
cs.put("Bapatla","Andhra Pradesh");<br>
cs.put("Fatehabad","Haryana");<br>
cs.put("Malout","Punjab");<br>
cs.put("Sankarankovil","Tamil Nadu");<br>
cs.put("Tenkasi","Tamil Nadu");<br>
cs.put("Ratnagiri","Maharashtra");<br>
cs.put("Rabkavi Banhatti","Karnataka");<br>
cs.put("Sikandrabad","Uttar Pradesh");<br>
cs.put("Chaibasa","Jharkhand");<br>
cs.put("Chirmiri","Chhattisgarh");<br>
cs.put("Palwancha","Telangana");<br>
cs.put("Bhawanipatna","Odisha");<br>
cs.put("Kayamkulam","Kerala");<br>
cs.put("Pithampur","Madhya Pradesh");<br>
cs.put("Nabha","Punjab");<br>
cs.put("Shahabad, Hardoi","Uttar Pradesh");<br>
cs.put("Dhenkanal","Odisha");<br>
cs.put("Uran Islampur","Maharashtra");<br>
cs.put("Gopalganj","Bihar");<br>
cs.put("Bongaigaon City","Assam");<br>
cs.put("Palani","Tamil Nadu");<br>
cs.put("Pusad","Maharashtra");<br>
cs.put("Sopore","Jammu and Kashmir");<br>
cs.put("Pilkhuwa","Uttar Pradesh");<br>
cs.put("Tarn Taran","Punjab");<br>
cs.put("Renukoot","Uttar Pradesh");<br>
cs.put("Mandamarri","Telangana");<br>
cs.put("Shahabad","Karnataka");<br>
cs.put("Barbil","Odisha");<br>
cs.put("Koratla","Telangana");<br>
cs.put("Madhubani","Bihar");<br>
cs.put("Arambagh","West Bengal");<br>
cs.put("Gohana","Haryana");<br>
cs.put("Ladnu","Rajasthan");<br>
cs.put("Pattukkottai","Tamil Nadu");<br>
cs.put("Sirsi","Karnataka");<br>
cs.put("Sircilla","Telangana");<br>
cs.put("Tamluk","West Bengal");<br>
cs.put("Jagraon","Punjab");<br>
cs.put("AlipurdUrban Agglomerationr","West Bengal");<br>
cs.put("Alirajpur","Madhya Pradesh");<br>
cs.put("Tandur","Telangana");<br>
cs.put("Naidupet","Andhra Pradesh");<br>
cs.put("Tirupathur","Tamil Nadu");<br>
cs.put("Tohana","Haryana");<br>
cs.put("Ratangarh","Rajasthan");<br>
cs.put("Dhubri","Assam");<br>
cs.put("Masaurhi","Bihar");<br>
cs.put("Visnagar","Gujarat");<br>
cs.put("Vrindavan","Uttar Pradesh");<br>
cs.put("Nokha","Rajasthan");<br>
cs.put("Nagari","Andhra Pradesh");<br>
cs.put("Narwana","Haryana");<br>
cs.put("Ramanathapuram","Tamil Nadu");<br>
cs.put("Ujhani","Uttar Pradesh");<br>
cs.put("Samastipur","Bihar");<br>
cs.put("Laharpur","Uttar Pradesh");<br>
cs.put("Sangamner","Maharashtra");<br>
cs.put("Nimbahera","Rajasthan");<br>
cs.put("Siddipet","Telangana");<br>
cs.put("Suri","West Bengal");<br>
cs.put("Diphu","Assam");<br>
cs.put("Jhargram","West Bengal");<br>
cs.put("Shirpur-Warwade","Maharashtra");<br>
cs.put("Tilhar","Uttar Pradesh");<br>
cs.put("Sindhnur","Karnataka");<br>
cs.put("Udumalaipettai","Tamil Nadu");<br>
cs.put("Malkapur","Maharashtra");<br>
cs.put("Wanaparthy","Telangana");<br>
cs.put("Gudur","Andhra Pradesh");<br>
cs.put("Kendujhar","Odisha");<br>
cs.put("Mandla","Madhya Pradesh");<br>
cs.put("Mandi","Himachal Pradesh");<br>
cs.put("Nedumangad","Kerala");<br>
cs.put("North Lakhimpur","Assam");<br>
cs.put("Vinukonda","Andhra Pradesh");<br>
cs.put("Tiptur","Karnataka");<br>
cs.put("Gobichettipalayam","Tamil Nadu");<br>
cs.put("Sunabeda","Odisha");<br>
cs.put("Wani","Maharashtra");<br>
cs.put("Upleta","Gujarat");<br>
cs.put("Narasapuram","Andhra Pradesh");<br>
cs.put("Nuzvid","Andhra Pradesh");<br>
cs.put("Tezpur","Assam");<br>
cs.put("Una","Gujarat");<br>
cs.put("Markapur","Andhra Pradesh");<br>
cs.put("Sheopur","Madhya Pradesh");<br>
cs.put("Thiruvarur","Tamil Nadu");<br>
cs.put("Sidhpur","Gujarat");<br>
cs.put("Sahaswan","Uttar Pradesh");<br>
cs.put("Suratgarh","Rajasthan");<br>
cs.put("Shajapur","Madhya Pradesh");<br>
cs.put("Rayagada","Odisha");<br>
cs.put("Lonavla","Maharashtra");<br>
cs.put("Ponnur","Andhra Pradesh");<br>
cs.put("Kagaznagar","Telangana");<br>
cs.put("Gadwal","Telangana");<br>
cs.put("Bhatapara","Chhattisgarh");<br>
cs.put("Kandukur","Andhra Pradesh");<br>
cs.put("Sangareddy","Telangana");<br>
cs.put("Unjha","Gujarat");<br>
cs.put("Lunglei","Mizoram");<br>
cs.put("Karimganj","Assam");<br>
cs.put("Kannur","Kerala");<br>
cs.put("Bobbili","Andhra Pradesh");<br>
cs.put("Mokameh","Bihar");<br>
cs.put("Talegaon Dabhade","Maharashtra");<br>
cs.put("Anjangaon","Maharashtra");<br>
cs.put("Mangrol","Gujarat");<br>
cs.put("Sunam","Punjab");<br>
cs.put("Gangarampur","West Bengal");<br>
cs.put("Thiruvallur","Tamil Nadu");<br>
cs.put("Tirur","Kerala");<br>
cs.put("Rath","Uttar Pradesh");<br>
cs.put("Jatani","Odisha");<br>
cs.put("Viramgam","Gujarat");<br>
cs.put("Rajsamand","Rajasthan");<br>
cs.put("Yanam","Puducherry");<br>
cs.put("Kottayam","Kerala");<br>
cs.put("Panruti","Tamil Nadu");<br>
cs.put("Dhuri","Punjab");<br>
cs.put("Namakkal","Tamil Nadu");<br>
cs.put("Kasaragod","Kerala");<br>
cs.put("Modasa","Gujarat");<br>
cs.put("Rayadurg","Andhra Pradesh");<br>
cs.put("Supaul","Bihar");<br>
cs.put("Kunnamkulam","Kerala");<br>
cs.put("Umred","Maharashtra");<br>
cs.put("Bellampalle","Telangana");<br>
cs.put("Sibsagar","Assam");<br>
cs.put("Mandi Dabwali","Haryana");<br>
cs.put("Ottappalam","Kerala");<br>
cs.put("Dumraon","Bihar");<br>
cs.put("Samalkot","Andhra Pradesh");<br>
cs.put("Jaggaiahpet","Andhra Pradesh");<br>
cs.put("Goalpara","Assam");<br>
cs.put("Tuni","Andhra Pradesh");<br>
cs.put("Lachhmangarh","Rajasthan");<br>
cs.put("Bhongir","Telangana");<br>
cs.put("Amalapuram","Andhra Pradesh");<br>
cs.put("Firozpur Cantt.","Punjab");<br>
cs.put("Vikarabad","Telangana");<br>
cs.put("Thiruvalla","Kerala");<br>
cs.put("Sherkot","Uttar Pradesh");<br>
cs.put("Palghar","Maharashtra");<br>
cs.put("Shegaon","Maharashtra");<br>
cs.put("Jangaon","Telangana");<br>
cs.put("Bheemunipatnam","Andhra Pradesh");<br>
cs.put("Panna","Madhya Pradesh");<br>
cs.put("Thodupuzha","Kerala");<br>
cs.put("KathUrban Agglomeration","Jammu and Kashmir");<br>
cs.put("Palitana","Gujarat");<br>
cs.put("Arwal","Bihar");<br>
cs.put("Venkatagiri","Andhra Pradesh");<br>
cs.put("Kalpi","Uttar Pradesh");<br>
cs.put("Rajgarh (Churu)","Rajasthan");<br>
cs.put("Sattenapalle","Andhra Pradesh");<br>
cs.put("Arsikere","Karnataka");<br>
cs.put("Ozar","Maharashtra");<br>
cs.put("Thirumangalam","Tamil Nadu");<br>
cs.put("Petlad","Gujarat");<br>
cs.put("Nasirabad","Rajasthan");<br>
cs.put("Phaltan","Maharashtra");<br>
cs.put("Rampurhat","West Bengal");<br>
cs.put("Nanjangud","Karnataka");<br>
cs.put("Forbesganj","Bihar");<br>
cs.put("Tundla","Uttar Pradesh");<br>
cs.put("BhabUrban Agglomeration","Bihar");<br>
cs.put("Sagara","Karnataka");<br>
cs.put("Pithapuram","Andhra Pradesh");<br>
cs.put("Sira","Karnataka");<br>
cs.put("Bhadrachalam","Telangana");<br>
cs.put("Charkhi Dadri","Haryana");<br>
cs.put("Chatra","Jharkhand");<br>
cs.put("Palasa Kasibugga","Andhra Pradesh");<br>
cs.put("Nohar","Rajasthan");<br>
cs.put("Yevla","Maharashtra");<br>
cs.put("Sirhind Fatehgarh Sahib","Punjab");<br>
cs.put("Bhainsa","Telangana");<br>
cs.put("Parvathipuram","Andhra Pradesh");<br>
cs.put("Shahade","Maharashtra");<br>
cs.put("Chalakudy","Kerala");<br>
cs.put("Narkatiaganj","Bihar");<br>
cs.put("Kapadvanj","Gujarat");<br>
cs.put("Macherla","Andhra Pradesh");<br>
cs.put("Raghogarh-Vijaypur","Madhya Pradesh");<br>
cs.put("Rupnagar","Punjab");<br>
cs.put("Naugachhia","Bihar");<br>
cs.put("Sendhwa","Madhya Pradesh");<br>
cs.put("Byasanagar","Odisha");<br>
cs.put("Sandila","Uttar Pradesh");<br>
cs.put("Gooty","Andhra Pradesh");<br>
cs.put("Salur","Andhra Pradesh");<br>
cs.put("Nanpara","Uttar Pradesh");<br>
cs.put("Sardhana","Uttar Pradesh");<br>
cs.put("Vita","Maharashtra");<br>
cs.put("Gumia","Jharkhand");<br>
cs.put("Puttur","Karnataka");<br>
cs.put("Jalandhar Cantt.","Punjab");<br>
cs.put("Nehtaur","Uttar Pradesh");<br>
cs.put("Changanassery","Kerala");<br>
cs.put("Mandapeta","Andhra Pradesh");<br>
cs.put("Dumka","Jharkhand");<br>
cs.put("Seohara","Uttar Pradesh");<br>
cs.put("Umarkhed","Maharashtra");<br>
cs.put("Madhupur","Jharkhand");<br>
cs.put("Vikramasingapuram","Tamil Nadu");<br>
cs.put("Punalur","Kerala");<br>
cs.put("Kendrapara","Odisha");<br>
cs.put("Sihor","Gujarat");<br>
cs.put("Nellikuppam","Tamil Nadu");<br>
cs.put("Samana","Punjab");<br>
cs.put("Warora","Maharashtra");<br>
cs.put("Nilambur","Kerala");<br>
cs.put("Rasipuram","Tamil Nadu");<br>
cs.put("Ramnagar","Uttarakhand");<br>
cs.put("Jammalamadugu","Andhra Pradesh");<br>
cs.put("Nawanshahr","Punjab");<br>
cs.put("Thoubal","Manipur");<br>
cs.put("Athni","Karnataka");<br>
cs.put("Cherthala","Kerala");<br>
cs.put("Sidhi","Madhya Pradesh");<br>
cs.put("Farooqnagar","Telangana");<br>
cs.put("Peddapuram","Andhra Pradesh");<br>
cs.put("Chirkunda","Jharkhand");<br>
cs.put("Pachora","Maharashtra");<br>
cs.put("Madhepura","Bihar");<br>
cs.put("Pithoragarh","Uttarakhand");<br>
cs.put("Tumsar","Maharashtra");<br>
cs.put("Phalodi","Rajasthan");<br>
cs.put("Tiruttani","Tamil Nadu");<br>
cs.put("Rampura Phul","Punjab");<br>
cs.put("Perinthalmanna","Kerala");<br>
cs.put("Padrauna","Uttar Pradesh");<br>
cs.put("Pipariya","Madhya Pradesh");<br>
cs.put("Dalli-Rajhara","Chhattisgarh");<br>
cs.put("Punganur","Andhra Pradesh");<br>
cs.put("Mattannur","Kerala");<br>
cs.put("Mathura","Uttar Pradesh");<br>
cs.put("Thakurdwara","Uttar Pradesh");<br>
cs.put("Nandivaram-Guduvancheri","Tamil Nadu");<br>
cs.put("Mulbagal","Karnataka");<br>
cs.put("Manjlegaon","Maharashtra");<br>
cs.put("Wankaner","Gujarat");<br>
cs.put("Sillod","Maharashtra");<br>
cs.put("Nidadavole","Andhra Pradesh");<br>
cs.put("Surapura","Karnataka");<br>
cs.put("Rajagangapur","Odisha");<br>
cs.put("Sheikhpura","Bihar");<br>
cs.put("Parlakhemundi","Odisha");<br>
cs.put("Kalimpong","West Bengal");<br>
cs.put("Siruguppa","Karnataka");<br>
cs.put("Arvi","Maharashtra");<br>
cs.put("Limbdi","Gujarat");<br>
cs.put("Barpeta","Assam");<br>
cs.put("Manglaur","Uttarakhand");<br>
cs.put("Repalle","Andhra Pradesh");<br>
cs.put("Mudhol","Karnataka");<br>
cs.put("Shujalpur","Madhya Pradesh");<br>
cs.put("Mandvi","Gujarat");<br>
cs.put("Thangadh","Gujarat");<br>
cs.put("Sironj","Madhya Pradesh");<br>
cs.put("Nandura","Maharashtra");<br>
cs.put("Shoranur","Kerala");<br>
cs.put("Nathdwara","Rajasthan");<br>
cs.put("Periyakulam","Tamil Nadu");<br>
cs.put("Sultanganj","Bihar");<br>
cs.put("Medak","Telangana");<br>
cs.put("Narayanpet","Telangana");<br>
cs.put("Raxaul Bazar","Bihar");<br>
cs.put("Rajauri","Jammu and Kashmir");<br>
cs.put("Pernampattu","Tamil Nadu");<br>
cs.put("Nainital","Uttarakhand");<br>
cs.put("Ramachandrapuram","Andhra Pradesh");<br>
cs.put("Vaijapur","Maharashtra");<br>
cs.put("Nangal","Punjab");<br>
cs.put("Sidlaghatta","Karnataka");<br>
cs.put("Punch","Jammu and Kashmir");<br>
cs.put("Pandhurna","Madhya Pradesh");<br>
cs.put("Wadgaon Road","Maharashtra");<br>
cs.put("Talcher","Odisha");<br>
cs.put("Varkala","Kerala");<br>
cs.put("Pilani","Rajasthan");<br>
cs.put("Nowgong","Madhya Pradesh");<br>
cs.put("Naila Janjgir","Chhattisgarh");<br>
cs.put("Mapusa","Goa");<br>
cs.put("Vellakoil","Tamil Nadu");<br>
cs.put("Merta City","Rajasthan");<br>
cs.put("Sivaganga","Tamil Nadu");<br>
cs.put("Mandideep","Madhya Pradesh");<br>
cs.put("Sailu","Maharashtra");<br>
cs.put("Vyara","Gujarat");<br>
cs.put("Kovvur","Andhra Pradesh");<br>
cs.put("Vadalur","Tamil Nadu");<br>
cs.put("Nawabganj","Uttar Pradesh");<br>
cs.put("Padra","Gujarat");<br>
cs.put("Sainthia","West Bengal");<br>
cs.put("Siana","Uttar Pradesh");<br>
cs.put("Shahpur","Karnataka");<br>
cs.put("Sojat","Rajasthan");<br>
cs.put("Noorpur","Uttar Pradesh");<br>
cs.put("Paravoor","Kerala");<br>
cs.put("Murtijapur","Maharashtra");<br>
cs.put("Ramnagar","Bihar");<br>
cs.put("Sundargarh","Odisha");<br>
cs.put("Taki","West Bengal");<br>
cs.put("Saundatti-Yellamma","Karnataka");<br>
cs.put("Pathanamthitta","Kerala");<br>
cs.put("Wadi","Karnataka");<br>
cs.put("Rameshwaram","Tamil Nadu");<br>
cs.put("Tasgaon","Maharashtra");<br>
cs.put("Sikandra Rao","Uttar Pradesh");<br>
cs.put("Sihora","Madhya Pradesh");<br>
cs.put("Tiruvethipuram","Tamil Nadu");<br>
cs.put("Tiruvuru","Andhra Pradesh");<br>
cs.put("Mehkar","Maharashtra");<br>
cs.put("Peringathur","Kerala");<br>
cs.put("Perambalur","Tamil Nadu");<br>
cs.put("Manvi","Karnataka");<br>
cs.put("Zunheboto","Nagaland");<br>
cs.put("Mahnar Bazar","Bihar");<br>
cs.put("Attingal","Kerala");<br>
cs.put("Shahbad","Haryana");<br>
cs.put("Puranpur","Uttar Pradesh");<br>
cs.put("Nelamangala","Karnataka");<br>
cs.put("Nakodar","Punjab");<br>
cs.put("Lunawada","Gujarat");<br>
cs.put("Murshidabad","West Bengal");<br>
cs.put("Mahe","Puducherry");<br>
cs.put("Lanka","Assam");<br>
cs.put("Rudauli","Uttar Pradesh");<br>
cs.put("Tuensang","Nagaland");<br>
cs.put("Lakshmeshwar","Karnataka");<br>
cs.put("Zira","Punjab");<br>
cs.put("Yawal","Maharashtra");<br>
cs.put("Thana Bhawan","Uttar Pradesh");<br>
cs.put("Ramdurg","Karnataka");<br>
cs.put("Pulgaon","Maharashtra");<br>
cs.put("Sadasivpet","Telangana");<br>
cs.put("Nargund","Karnataka");<br>
cs.put("Neem-Ka-Thana","Rajasthan");<br>
cs.put("Memari","West Bengal");<br>
cs.put("Nilanga","Maharashtra");<br>
cs.put("Naharlagun","Arunachal Pradesh");<br>
cs.put("Pakaur","Jharkhand");<br>
cs.put("Wai","Maharashtra");<br>
cs.put("Tarikere","Karnataka");<br>
cs.put("Malavalli","Karnataka");<br>
cs.put("Raisen","Madhya Pradesh");<br>
cs.put("Lahar","Madhya Pradesh");<br>
cs.put("Uravakonda","Andhra Pradesh");<br>
cs.put("Savanur","Karnataka");<br>
cs.put("Sirohi","Rajasthan");<br>
cs.put("Udhampur","Jammu and Kashmir");<br>
cs.put("Umarga","Maharashtra");<br>
cs.put("Pratapgarh","Rajasthan");<br>
cs.put("Lingsugur","Karnataka");<br>
cs.put("Usilampatti","Tamil Nadu");<br>
cs.put("Palia Kalan","Uttar Pradesh");<br>
cs.put("Wokha","Nagaland");<br>
cs.put("Rajpipla","Gujarat");<br>
cs.put("Vijayapura","Karnataka");<br>
cs.put("Rawatbhata","Rajasthan");<br>
cs.put("Sangaria","Rajasthan");<br>
cs.put("Paithan","Maharashtra");<br>
cs.put("Rahuri","Maharashtra");<br>
cs.put("Patti","Punjab");<br>
cs.put("Zaidpur","Uttar Pradesh");<br>
cs.put("Lalsot","Rajasthan");<br>
cs.put("Maihar","Madhya Pradesh");<br>
cs.put("Vedaranyam","Tamil Nadu");<br>
cs.put("Nawapur","Maharashtra");<br>
cs.put("Solan","Himachal Pradesh");<br>
cs.put("Vapi","Gujarat");<br>
cs.put("Sanawad","Madhya Pradesh");<br>
cs.put("Warisaliganj","Bihar");<br>
cs.put("Revelganj","Bihar");<br>
cs.put("Sabalgarh","Madhya Pradesh");<br>
cs.put("Tuljapur","Maharashtra");<br>
cs.put("Simdega","Jharkhand");<br>
cs.put("Musabani","Jharkhand");<br>
cs.put("Kodungallur","Kerala");<br>
cs.put("Phulabani","Odisha");<br>
cs.put("Umreth","Gujarat");<br>
cs.put("Narsipatnam","Andhra Pradesh");<br>
cs.put("Nautanwa","Uttar Pradesh");<br>
cs.put("Rajgir","Bihar");<br>
cs.put("Yellandu","Telangana");<br>
cs.put("Sathyamangalam","Tamil Nadu");<br>
cs.put("Pilibanga","Rajasthan");<br>
cs.put("Morshi","Maharashtra");<br>
cs.put("Pehowa","Haryana");<br>
cs.put("Sonepur","Bihar");<br>
cs.put("Pappinisseri","Kerala");<br>
cs.put("Zamania","Uttar Pradesh");<br>
cs.put("Mihijam","Jharkhand");<br>
cs.put("Purna","Maharashtra");<br>
cs.put("Puliyankudi","Tamil Nadu");<br>
cs.put("Shikarpur, Bulandshahr","Uttar Pradesh");<br>
cs.put("Umaria","Madhya Pradesh");<br>
cs.put("Porsa","Madhya Pradesh");<br>
cs.put("Naugawan Sadat","Uttar Pradesh");<br>
cs.put("Fatehpur Sikri","Uttar Pradesh");<br>
cs.put("Manuguru","Telangana");<br>
cs.put("Udaipur","Tripura");<br>
cs.put("Pipar City","Rajasthan");<br>
cs.put("Pattamundai","Odisha");<br>
cs.put("Nanjikottai","Tamil Nadu");<br>
cs.put("Taranagar","Rajasthan");<br>
cs.put("Yerraguntla","Andhra Pradesh");<br>
cs.put("Satana","Maharashtra");<br>
cs.put("Sherghati","Bihar");<br>
cs.put("Sankeshwara","Karnataka");<br>
cs.put("Madikeri","Karnataka");<br>
cs.put("Thuraiyur","Tamil Nadu");<br>
cs.put("Sanand","Gujarat");<br>
cs.put("Rajula","Gujarat");<br>
cs.put("Kyathampalle","Telangana");<br>
cs.put("Shahabad, Rampur","Uttar Pradesh");<br>
cs.put("Tilda Newra","Chhattisgarh");<br>
cs.put("Narsinghgarh","Madhya Pradesh");<br>
cs.put("Chittur-Thathamangalam","Kerala");<br>
cs.put("Malaj Khand","Madhya Pradesh");<br>
cs.put("Sarangpur","Madhya Pradesh");<br>
cs.put("Robertsganj","Uttar Pradesh");<br>
cs.put("Sirkali","Tamil Nadu");<br>
cs.put("Radhanpur","Gujarat");<br>
cs.put("Tiruchendur","Tamil Nadu");<br>
cs.put("Utraula","Uttar Pradesh");<br>
cs.put("Patratu","Jharkhand");<br>
cs.put("Vijainagar, Ajmer","Rajasthan");<br>
cs.put("Periyasemur","Tamil Nadu");<br>
cs.put("Pathri","Maharashtra");<br>
cs.put("Sadabad","Uttar Pradesh");<br>
cs.put("Talikota","Karnataka");<br>
cs.put("Sinnar","Maharashtra");<br>
cs.put("Mungeli","Chhattisgarh");<br>
cs.put("Sedam","Karnataka");<br>
cs.put("Shikaripur","Karnataka");<br>
cs.put("Sumerpur","Rajasthan");<br>
cs.put("Sattur","Tamil Nadu");<br>
cs.put("Sugauli","Bihar");<br>
cs.put("Lumding","Assam");<br>
cs.put("Vandavasi","Tamil Nadu");<br>
cs.put("Titlagarh","Odisha");<br>
cs.put("Uchgaon","Maharashtra");<br>
cs.put("Mokokchung","Nagaland");<br>
cs.put("Paschim Punropara","West Bengal");<br>
cs.put("Sagwara","Rajasthan");<br>
cs.put("Ramganj Mandi","Rajasthan");<br>
cs.put("Tarakeswar","West Bengal");<br>
cs.put("Mahalingapura","Karnataka");<br>
cs.put("Dharmanagar","Tripura");<br>
cs.put("Mahemdabad","Gujarat");<br>
cs.put("Manendragarh","Chhattisgarh");<br>
cs.put("Uran","Maharashtra");<br>
cs.put("Tharamangalam","Tamil Nadu");<br>
cs.put("Tirukkoyilur","Tamil Nadu");<br>
cs.put("Pen","Maharashtra");<br>
cs.put("Makhdumpur","Bihar");<br>
cs.put("Maner","Bihar");<br>
cs.put("Oddanchatram","Tamil Nadu");<br>
cs.put("Palladam","Tamil Nadu");<br>
cs.put("Mundi","Madhya Pradesh");<br>
cs.put("Nabarangapur","Odisha");<br>
cs.put("Mudalagi","Karnataka");<br>
cs.put("Samalkha","Haryana");<br>
cs.put("Nepanagar","Madhya Pradesh");<br>
cs.put("Karjat","Maharashtra");<br>
cs.put("Ranavav","Gujarat");<br>
cs.put("Pedana","Andhra Pradesh");<br>
cs.put("Pinjore","Haryana");<br>
cs.put("Lakheri","Rajasthan");<br>
cs.put("Pasan","Madhya Pradesh");<br>
cs.put("Puttur","Andhra Pradesh");<br>
cs.put("Vadakkuvalliyur","Tamil Nadu");<br>
cs.put("Tirukalukundram","Tamil Nadu");<br>
cs.put("Mahidpur","Madhya Pradesh");<br>
cs.put("Mussoorie","Uttarakhand");<br>
cs.put("Muvattupuzha","Kerala");<br>
cs.put("Rasra","Uttar Pradesh");<br>
cs.put("Udaipurwati","Rajasthan");<br>
cs.put("Manwath","Maharashtra");<br>
cs.put("Adoor","Kerala");<br>
cs.put("Uthamapalayam","Tamil Nadu");<br>
cs.put("Partur","Maharashtra");<br>
cs.put("Nahan","Himachal Pradesh");<br>
cs.put("Ladwa","Haryana");<br>
cs.put("Mankachar","Assam");<br>
cs.put("Nongstoin","Meghalaya");<br>
cs.put("Losal","Rajasthan");<br>
cs.put("Sri Madhopur","Rajasthan");<br>
cs.put("Ramngarh","Rajasthan");<br>
cs.put("Mavelikkara","Kerala");<br>
cs.put("Rawatsar","Rajasthan");<br>
cs.put("Rajakhera","Rajasthan");<br>
cs.put("Lar","Uttar Pradesh");<br>
cs.put("Lal Gopalganj Nindaura","Uttar Pradesh");<br>
cs.put("Muddebihal","Karnataka");<br>
cs.put("Sirsaganj","Uttar Pradesh");<br>
cs.put("Shahpura","Rajasthan");<br>
cs.put("Surandai","Tamil Nadu");<br>
cs.put("Sangole","Maharashtra");<br>
cs.put("Pavagada","Karnataka");<br>
cs.put("Tharad","Gujarat");<br>
cs.put("Mansa","Gujarat");<br>
cs.put("Umbergaon","Gujarat");<br>
cs.put("Mavoor","Kerala");<br>
cs.put("Nalbari","Assam");<br>
cs.put("Talaja","Gujarat");<br>
cs.put("Malur","Karnataka");<br>
cs.put("Mangrulpir","Maharashtra");<br>
cs.put("Soro","Odisha");<br>
cs.put("Shahpura","Rajasthan");<br>
cs.put("Vadnagar","Gujarat");<br>
cs.put("Raisinghnagar","Rajasthan");<br>
cs.put("Sindhagi","Karnataka");<br>
cs.put("Sanduru","Karnataka");<br>
cs.put("Sohna","Haryana");<br>
cs.put("Manavadar","Gujarat");<br>
cs.put("Pihani","Uttar Pradesh");<br>
cs.put("Safidon","Haryana");<br>
cs.put("Risod","Maharashtra");<br>
cs.put("Rosera","Bihar");<br>
cs.put("Sankari","Tamil Nadu");<br>
cs.put("Malpura","Rajasthan");<br>
cs.put("Sonamukhi","West Bengal");<br>
cs.put("Shamsabad, Agra","Uttar Pradesh");<br>
cs.put("Nokha","Bihar");<br>
cs.put("PandUrban Agglomeration","West Bengal");<br>
cs.put("Mainaguri","West Bengal");<br>
cs.put("Afzalpur","Karnataka");<br>
cs.put("Shirur","Maharashtra");<br>
cs.put("Salaya","Gujarat");<br>
cs.put("Shenkottai","Tamil Nadu");<br>
cs.put("Pratapgarh","Tripura");<br>
cs.put("Vadipatti","Tamil Nadu");<br>
cs.put("Nagarkurnool","Telangana");<br>
cs.put("Savner","Maharashtra");<br>
cs.put("Sasvad","Maharashtra");<br>
cs.put("Rudrapur","Uttar Pradesh");<br>
cs.put("Soron","Uttar Pradesh");<br>
cs.put("Sholingur","Tamil Nadu");<br>
cs.put("Pandharkaoda","Maharashtra");<br>
cs.put("Perumbavoor","Kerala");<br>
cs.put("Maddur","Karnataka");<br>
cs.put("Nadbai","Rajasthan");<br>
cs.put("Talode","Maharashtra");<br>
cs.put("Shrigonda","Maharashtra");<br>
cs.put("Madhugiri","Karnataka");<br>
cs.put("Tekkalakote","Karnataka");<br>
cs.put("Seoni-Malwa","Madhya Pradesh");<br>
cs.put("Shirdi","Maharashtra");<br>
cs.put("SUrban Agglomerationr","Uttar Pradesh");<br>
cs.put("Terdal","Karnataka");<br>
cs.put("Raver","Maharashtra");<br>
cs.put("Tirupathur","Tamil Nadu");<br>
cs.put("Taraori","Haryana");<br>
cs.put("Mukhed","Maharashtra");<br>
cs.put("Manachanallur","Tamil Nadu");<br>
cs.put("Rehli","Madhya Pradesh");<br>
cs.put("Sanchore","Rajasthan");<br>
cs.put("Rajura","Maharashtra");<br>
cs.put("Piro","Bihar");<br>
cs.put("Mudabidri","Karnataka");<br>
cs.put("Vadgaon Kasba","Maharashtra");<br>
cs.put("Nagar","Rajasthan");<br>
cs.put("Vijapur","Gujarat");<br>
cs.put("Viswanatham","Tamil Nadu");<br>
cs.put("Polur","Tamil Nadu");<br>
cs.put("Panagudi","Tamil Nadu");<br>
cs.put("Manawar","Madhya Pradesh");<br>
cs.put("Tehri","Uttarakhand");<br>
cs.put("Samdhan","Uttar Pradesh");<br>
cs.put("Pardi","Gujarat");<br>
cs.put("Rahatgarh","Madhya Pradesh");<br>
cs.put("Panagar","Madhya Pradesh");<br>
cs.put("Uthiramerur","Tamil Nadu");<br>
cs.put("Tirora","Maharashtra");<br>
cs.put("Rangia","Assam");<br>
cs.put("Sahjanwa","Uttar Pradesh");<br>
cs.put("Wara Seoni","Madhya Pradesh");<br>
cs.put("Magadi","Karnataka");<br>
cs.put("Rajgarh (Alwar)","Rajasthan");<br>
cs.put("Rafiganj","Bihar");<br>
cs.put("Tarana","Madhya Pradesh");<br>
cs.put("Rampur Maniharan","Uttar Pradesh");<br>
cs.put("Sheoganj","Rajasthan");<br>
cs.put("Raikot","Punjab");<br>
cs.put("Pauri","Uttarakhand");<br>
cs.put("Sumerpur","Uttar Pradesh");<br>
cs.put("Navalgund","Karnataka");<br>
cs.put("Shahganj","Uttar Pradesh");<br>
cs.put("Marhaura","Bihar");<br>
cs.put("Tulsipur","Uttar Pradesh");<br>
cs.put("Sadri","Rajasthan");<br>
cs.put("Thiruthuraipoondi","Tamil Nadu");<br>
cs.put("Shiggaon","Karnataka");<br>
cs.put("Pallapatti","Tamil Nadu");<br>
cs.put("Mahendragarh","Haryana");<br>
cs.put("Sausar","Madhya Pradesh");<br>
cs.put("Ponneri","Tamil Nadu");<br>
cs.put("Mahad","Maharashtra");<br>
cs.put("Lohardaga","Jharkhand");<br>
cs.put("Tirwaganj","Uttar Pradesh");<br>
cs.put("Margherita","Assam");<br>
cs.put("Sundarnagar","Himachal Pradesh");<br>
cs.put("Rajgarh","Madhya Pradesh");<br>
cs.put("Mangaldoi","Assam");<br>
cs.put("Renigunta","Andhra Pradesh");<br>
cs.put("Longowal","Punjab");<br>
cs.put("Ratia","Haryana");<br>
cs.put("Lalgudi","Tamil Nadu");<br>
cs.put("Shrirangapattana","Karnataka");<br>
cs.put("Niwari","Madhya Pradesh");<br>
cs.put("Natham","Tamil Nadu");<br>
cs.put("Unnamalaikadai","Tamil Nadu");<br>
cs.put("PurqUrban Agglomerationzi","Uttar Pradesh");<br>
cs.put("Shamsabad, Farrukhabad","Uttar Pradesh");<br>
cs.put("Mirganj","Bihar");<br>
cs.put("Todaraisingh","Rajasthan");<br>
cs.put("Warhapur","Uttar Pradesh");<br>
cs.put("Rajam","Andhra Pradesh");<br>
cs.put("Urmar Tanda","Punjab");<br>
cs.put("Lonar","Maharashtra");<br>
cs.put("Powayan","Uttar Pradesh");<br>
cs.put("P.N.Patti","Tamil Nadu");<br>
cs.put("Palampur","Himachal Pradesh");<br>
cs.put("Srisailam Project (Right Flank Colony) Township","Andhra Pradesh");<br>
cs.put("Sindagi","Karnataka");<br>
cs.put("Sandi","Uttar Pradesh");<br>
cs.put("Vaikom","Kerala");<br>
cs.put("Malda","West Bengal");<br>
cs.put("Tharangambadi","Tamil Nadu");<br>
cs.put("Sakaleshapura","Karnataka");<br>
cs.put("Lalganj","Bihar");<br>
cs.put("Malkangiri","Odisha");<br>
cs.put("Rapar","Gujarat");<br>
cs.put("Mauganj","Madhya Pradesh");<br>
cs.put("Todabhim","Rajasthan");<br>
cs.put("Srinivaspur","Karnataka");<br>
cs.put("Murliganj","Bihar");<br>
cs.put("Reengus","Rajasthan");<br>
cs.put("Sawantwadi","Maharashtra");<br>
cs.put("Tittakudi","Tamil Nadu");<br>
cs.put("Lilong","Manipur");<br>
cs.put("Rajaldesar","Rajasthan");<br>
cs.put("Pathardi","Maharashtra");<br>
cs.put("Achhnera","Uttar Pradesh");<br>
cs.put("Pacode","Tamil Nadu");<br>
cs.put("Naraura","Uttar Pradesh");<br>
cs.put("Nakur","Uttar Pradesh");<br>
cs.put("Palai","Kerala");<br>
cs.put("Morinda, India","Punjab");<br>
cs.put("Manasa","Madhya Pradesh");<br>
cs.put("Nainpur","Madhya Pradesh");<br>
cs.put("Sahaspur","Uttar Pradesh");<br>
cs.put("Pauni","Maharashtra");<br>
cs.put("Prithvipur","Madhya Pradesh");<br>
cs.put("Ramtek","Maharashtra");<br>
cs.put("Silapathar","Assam");<br>
cs.put("Songadh","Gujarat");<br>
cs.put("Safipur","Uttar Pradesh");<br>
cs.put("Sohagpur","Madhya Pradesh");<br>
cs.put("Mul","Maharashtra");<br>
cs.put("Sadulshahar","Rajasthan");<br>
cs.put("Phillaur","Punjab");<br>
cs.put("Sambhar","Rajasthan");<br>
cs.put("Prantij","Rajasthan");<br>
cs.put("Nagla","Uttarakhand");<br>
cs.put("Pattran","Punjab");<br>
cs.put("Mount Abu","Rajasthan");<br>
cs.put("Reoti","Uttar Pradesh");<br>
cs.put("Tenu dam-cum-Kathhara","Jharkhand");<br>
cs.put("Panchla","West Bengal");<br>
cs.put("Sitarganj","Uttarakhand");<br>
cs.put("Pasighat","Arunachal Pradesh");<br>
cs.put("Motipur","Bihar");<br>
cs.put("O' Valley","Tamil Nadu");<br>
cs.put("Raghunathpur","West Bengal");<br>
cs.put("Suriyampalayam","Tamil Nadu");<br>
cs.put("Qadian","Punjab");<br>
cs.put("Rairangpur","Odisha");<br>
cs.put("Silvassa","Dadra and Nagar Haveli");<br>
cs.put("Nowrozabad (Khodargama)","Madhya Pradesh");<br>
cs.put("Mangrol","Rajasthan");<br>
cs.put("Soyagaon","Maharashtra");<br>
cs.put("Sujanpur","Punjab");<br>
cs.put("Manihari","Bihar");<br>
cs.put("Sikanderpur","Uttar Pradesh");<br>
cs.put("Mangalvedhe","Maharashtra");<br>
cs.put("Phulera","Rajasthan");<br>
cs.put("Ron","Karnataka");<br>
cs.put("Sholavandan","Tamil Nadu");<br>
cs.put("Saidpur","Uttar Pradesh");<br>
cs.put("Shamgarh","Madhya Pradesh");<br>
cs.put("Thammampatti","Tamil Nadu");<br>
cs.put("Maharajpur","Madhya Pradesh");<br>
cs.put("Multai","Madhya Pradesh");<br>
cs.put("Mukerian","Punjab");<br>
cs.put("Sirsi","Uttar Pradesh");<br>
cs.put("Purwa","Uttar Pradesh");<br>
cs.put("Sheohar","Bihar");<br>
cs.put("Namagiripettai","Tamil Nadu");<br>
cs.put("Parasi","Uttar Pradesh");<br>
cs.put("Lathi","Gujarat");<br>
cs.put("Lalganj","Uttar Pradesh");<br>
cs.put("Narkhed","Maharashtra");<br>
cs.put("Mathabhanga","West Bengal");<br>
cs.put("Shendurjana","Maharashtra");<br>
cs.put("Peravurani","Tamil Nadu");<br>
cs.put("Mariani","Assam");<br>
cs.put("Phulpur","Uttar Pradesh");<br>
cs.put("Rania","Haryana");<br>
cs.put("Pali","Madhya Pradesh");<br>
cs.put("Pachore","Madhya Pradesh");<br>
cs.put("Parangipettai","Tamil Nadu");<br>
cs.put("Pudupattinam","Tamil Nadu");<br>
cs.put("Panniyannur","Kerala");<br>
cs.put("Maharajganj","Bihar");<br>
cs.put("Rau","Madhya Pradesh");<br>
cs.put("Monoharpur","West Bengal");<br>
cs.put("Mandawa","Rajasthan");<br>
cs.put("Marigaon","Assam");<br>
cs.put("Pallikonda","Tamil Nadu");<br>
cs.put("Pindwara","Rajasthan");<br>
cs.put("Shishgarh","Uttar Pradesh");<br>
cs.put("Patur","Maharashtra");<br>
cs.put("Mayang Imphal","Manipur");<br>
cs.put("Mhowgaon","Madhya Pradesh");<br>
cs.put("Guruvayoor","Kerala");<br>
cs.put("Mhaswad","Maharashtra");<br>
cs.put("Sahawar","Uttar Pradesh");<br>
cs.put("Sivagiri","Tamil Nadu");<br>
cs.put("Mundargi","Karnataka");<br>
cs.put("Punjaipugalur","Tamil Nadu");<br>
cs.put("Kailasahar","Tripura");<br>
cs.put("Samthar","Uttar Pradesh");<br>
cs.put("Sakti","Chhattisgarh");<br>
cs.put("Sadalagi","Karnataka");<br>
cs.put("Silao","Bihar");<br>
cs.put("Mandalgarh","Rajasthan");<br>
cs.put("Loha","Maharashtra");<br>
cs.put("Pukhrayan","Uttar Pradesh");<br>
cs.put("Padmanabhapuram","Tamil Nadu");<br>
cs.put("Belonia","Tripura");<br>
cs.put("Saiha","Mizoram");<br>
cs.put("Srirampore","West Bengal");<br>
cs.put("Talwara","Punjab");<br>
cs.put("Puthuppally","Kerala");<br>
cs.put("Khowai","Tripura");<br>
cs.put("Vijaypur","Madhya Pradesh");<br>
cs.put("Takhatgarh","Rajasthan");<br>
cs.put("Thirupuvanam","Tamil Nadu");<br>
cs.put("Adra","West Bengal");<br>
cs.put("Piriyapatna","Karnataka");<br>
cs.put("Obra","Uttar Pradesh");<br>
cs.put("Adalaj","Gujarat");<br>
cs.put("Nandgaon","Maharashtra");<br>
cs.put("Barh","Bihar");<br>
cs.put("Chhapra","Gujarat");<br>
cs.put("Panamattom","Kerala");<br>
cs.put("Niwai","Uttar Pradesh");<br>
cs.put("Bageshwar","Uttarakhand");<br>
cs.put("Tarbha","Odisha");<br>
cs.put("Adyar","Karnataka");<br>
cs.put("Narsinghgarh","Madhya Pradesh");<br>
cs.put("Warud","Maharashtra");<br>
cs.put("Asarganj","Bihar");<br>
cs.put("Sarsod","Haryana");<br>
return cs.get(city);<br>
} <br>
return " ";<br>
} <br>
</p></p>
<br><br>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6658533981545355"
crossorigin="anonymous"></script>
<!-- Google Ad 2024 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6658533981545355"
data-ad-slot="5808750864"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br>
</body>
</html>
<html>
<h3 ><a href = "https://www.way2testing.com/2024/03/get-india-state-name-by-city-name.html">How can i get state name if i have city name</a></h3> <br>
<h3><a href = "https://www.way2testing.com/2024/03/get-india-state-name-by-city-name.html">get state name by city name</a></h3> <br>
<h3><a href = "https://www.way2testing.com/2024/03/get-india-state-name-by-city-name.html">function to get state name by city name in java</a></h3> <br>
</html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-45953732987689126502024-02-25T11:17:00.000-08:002024-03-05T03:30:48.639-08:00Get USA State Name by USA City Name <html><head>
<<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- chandan Ads -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6658533981545355"
data-ad-slot="9308698023"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Get State Name by City name</title>
<style>
.colorful-blinking-text {
font-size: 24px;
font-weight: bold;
animation: blink 1s infinite alternate, changeColor 3s infinite;
}
@keyframes blink {
to {
opacity: 0;
}
}
@keyframes changeColor {
0% { color: red; }
25% { color: blue; }
50% { color: green; }
75% { color: orange; }
100% { color: purple; }
}
</style>
</head>
<body>
<marquee class="colorful-blinking-text" id="textElement"> Get State Name by City Name in USA </marquee>
<br><br>
<p>
<b style = "color:blue">
This article is having a method which will give you state name as per city name.
<br>
This lengthy function don't need to write again , just copy below code and use it as per your need.
</b><br>
<p style = "background-color : white">
public static String getUsaState(String city) {<br>
Map<String , String> cs = new HashMap<String, String>();<br><br>
cs.put("New York","New York");<br>
cs.put("Los Angeles","California");<br>
cs.put("Chicago","Illinois");<br>
cs.put("Houston","Texas");<br>
cs.put("New York","New York");<br>
cs.put("Los Angeles","California");<br>
cs.put("Chicago","Illinois");<br>
cs.put("Houston","Texas");<br>
cs.put("Philadelphia","Pennsylvania");<br>
cs.put("Phoenix","Arizona");<br>
cs.put("San Antonio","Texas");<br>
cs.put("San Diego","California");<br>
cs.put("Dallas","Texas");<br>
cs.put("San Jose","California");<br>
cs.put("Austin","Texas");<br>
cs.put("Jacksonville","Florida");<br>
cs.put("Indianapolis","Indiana");<br>
cs.put("San Francisco","California");<br>
cs.put("Columbus","Ohio");<br>
cs.put("Fort Worth","Texas");<br>
cs.put("Charlotte","North Carolina");<br>
cs.put("Detroit","Michigan");<br>
cs.put("El Paso","Texas");<br>
cs.put("Memphis","Tennessee");<br>
cs.put("Boston","Massachusetts");<br>
cs.put("Seattle","Washington");<br>
cs.put("Denver","Colorado");<br>
cs.put("Washington","District of Columbia");<br>
cs.put("Nashville","Tennessee");<br>
cs.put("Baltimore","Maryland");<br>
cs.put("Louisville","Kentucky");<br>
cs.put("Portland","Oregon");<br>
cs.put("Oklahoma City","Oklahoma");<br>
cs.put("Milwaukee","Wisconsin");<br>
cs.put("Las Vegas","Nevada");<br>
cs.put("Albuquerque","New Mexico");<br>
cs.put("Tucson","Arizona");<br>
cs.put("Fresno","California");<br>
cs.put("Sacramento","California");<br>
cs.put("Long Beach","California");<br>
cs.put("Kansas City","Missouri");<br>
cs.put("Mesa","Arizona");<br>
cs.put("Virginia Beach","Virginia");<br>
cs.put("Atlanta","Georgia");<br>
cs.put("Colorado Springs","Colorado");<br>
cs.put("Raleigh","North Carolina");<br>
cs.put("Omaha","Nebraska");<br>
cs.put("Miami","Florida");<br>
cs.put("Oakland","California");<br>
cs.put("Tulsa","Oklahoma");<br>
cs.put("Minneapolis","Minnesota");<br>
cs.put("Cleveland","Ohio");<br>
cs.put("Wichita","Kansas");<br>
cs.put("Arlington","Texas");<br>
cs.put("New Orleans","Louisiana");<br>
cs.put("Bakersfield","California");<br>
cs.put("Tampa","Florida");<br>
cs.put("Honolulu","Hawai'i");<br>
cs.put("Anaheim","California");<br>
cs.put("Aurora","Colorado");<br>
cs.put("Santa Ana","California");<br>
cs.put("St. Louis","Missouri");<br>
cs.put("Riverside","California");<br>
cs.put("Corpus Christi","Texas");<br>
cs.put("Pittsburgh","Pennsylvania");<br>
cs.put("Lexington","Kentucky");<br>
cs.put("Anchorage","Alaska");<br>
cs.put("Stockton","California");<br>
cs.put("Cincinnati","Ohio");<br>
cs.put("Saint Paul","Minnesota");<br>
cs.put("Toledo","Ohio");<br>
cs.put("Newark","New Jersey");<br>
cs.put("Greensboro","North Carolina");<br>
cs.put("Plano","Texas");<br>
cs.put("Henderson","Nevada");<br>
cs.put("Lincoln","Nebraska");<br>
cs.put("Buffalo","New York");<br>
cs.put("Fort Wayne","Indiana");<br>
cs.put("Jersey City","New Jersey");<br>
cs.put("Chula Vista","California");<br>
cs.put("Orlando","Florida");<br>
cs.put("St. Petersburg","Florida");<br>
cs.put("Norfolk","Virginia");<br>
cs.put("Chandler","Arizona");<br>
cs.put("Laredo","Texas");<br>
cs.put("Madison","Wisconsin");<br>
cs.put("Durham","North Carolina");<br>
cs.put("Lubbock","Texas");<br>
cs.put("Winston-Salem","North Carolina");<br>
cs.put("Garland","Texas");<br>
cs.put("Glendale","Arizona");<br>
cs.put("Hialeah","Florida");<br>
cs.put("Reno","Nevada");<br>
cs.put("Baton Rouge","Louisiana");<br>
cs.put("Irvine","California");<br>
cs.put("Chesapeake","Virginia");<br>
cs.put("Irving","Texas");<br>
cs.put("Scottsdale","Arizona");<br>
cs.put("North Las Vegas","Nevada");<br>
cs.put("Fremont","California");<br>
cs.put("Gilbert","Arizona");<br>
cs.put("San Bernardino","California");<br>
cs.put("Boise","Idaho");<br>
cs.put("Birmingham","Alabama");<br>
cs.put("Rochester","New York");<br>
cs.put("Richmond","Virginia");<br>
cs.put("Spokane","Washington");<br>
cs.put("Des Moines","Iowa");<br>
cs.put("Montgomery","Alabama");<br>
cs.put("Modesto","California");<br>
cs.put("Fayetteville","North Carolina");<br>
cs.put("Tacoma","Washington");<br>
cs.put("Shreveport","Louisiana");<br>
cs.put("Fontana","California");<br>
cs.put("Oxnard","California");<br>
cs.put("Aurora","Illinois");<br>
cs.put("Moreno Valley","California");<br>
cs.put("Akron","Ohio");<br>
cs.put("Yonkers","New York");<br>
cs.put("Columbus","Georgia");<br>
cs.put("Augusta","Georgia");<br>
cs.put("Little Rock","Arkansas");<br>
cs.put("Amarillo","Texas");<br>
cs.put("Mobile","Alabama");<br>
cs.put("Huntington Beach","California");<br>
cs.put("Glendale","California");<br>
cs.put("Grand Rapids","Michigan");<br>
cs.put("Salt Lake City","Utah");<br>
cs.put("Tallahassee","Florida");<br>
cs.put("Huntsville","Alabama");<br>
cs.put("Worcester","Massachusetts");<br>
cs.put("Knoxville","Tennessee");<br>
cs.put("Grand Prairie","Texas");<br>
cs.put("Newport News","Virginia");<br>
cs.put("Brownsville","Texas");<br>
cs.put("Santa Clarita","California");<br>
cs.put("Overland Park","Kansas");<br>
cs.put("Providence","Rhode Island");<br>
cs.put("Jackson","Mississippi");<br>
cs.put("Garden Grove","California");<br>
cs.put("Oceanside","California");<br>
cs.put("Chattanooga","Tennessee");<br>
cs.put("Fort Lauderdale","Florida");<br>
cs.put("Rancho Cucamonga","California");<br>
cs.put("Santa Rosa","California");<br>
cs.put("Port St. Lucie","Florida");<br>
cs.put("Ontario","California");<br>
cs.put("Tempe","Arizona");<br>
cs.put("Vancouver","Washington");<br>
cs.put("Springfield","Missouri");<br>
cs.put("Cape Coral","Florida");<br>
cs.put("Pembroke Pines","Florida");<br>
cs.put("Sioux Falls","South Dakota");<br>
cs.put("Peoria","Arizona");<br>
cs.put("Lancaster","California");<br>
cs.put("Elk Grove","California");<br>
cs.put("Corona","California");<br>
cs.put("Eugene","Oregon");<br>
cs.put("Salem","Oregon");<br>
cs.put("Palmdale","California");<br>
cs.put("Salinas","California");<br>
cs.put("Springfield","Massachusetts");<br>
cs.put("Pasadena","Texas");<br>
cs.put("Rockford","Illinois");<br>
cs.put("Pomona","California");<br>
cs.put("Hayward","California");<br>
cs.put("Fort Collins","Colorado");<br>
cs.put("Joliet","Illinois");<br>
cs.put("Escondido","California");<br>
cs.put("Kansas City","Kansas");<br>
cs.put("Torrance","California");<br>
cs.put("Bridgeport","Connecticut");<br>
cs.put("Alexandria","Virginia");<br>
cs.put("Sunnyvale","California");<br>
cs.put("Cary","North Carolina");<br>
cs.put("Lakewood","Colorado");<br>
cs.put("Hollywood","Florida");<br>
cs.put("Paterson","New Jersey");<br>
cs.put("Syracuse","New York");<br>
cs.put("Naperville","Illinois");<br>
cs.put("McKinney","Texas");<br>
cs.put("Mesquite","Texas");<br>
cs.put("Clarksville","Tennessee");<br>
cs.put("Savannah","Georgia");<br>
cs.put("Dayton","Ohio");<br>
cs.put("Orange","California");<br>
cs.put("Fullerton","California");<br>
cs.put("Pasadena","California");<br>
cs.put("Hampton","Virginia");<br>
cs.put("McAllen","Texas");<br>
cs.put("Killeen","Texas");<br>
cs.put("Warren","Michigan");<br>
cs.put("West Valley City","Utah");<br>
cs.put("Columbia","South Carolina");<br>
cs.put("New Haven","Connecticut");<br>
cs.put("Sterling Heights","Michigan");<br>
cs.put("Olathe","Kansas");<br>
cs.put("Miramar","Florida");<br>
cs.put("Thousand Oaks","California");<br>
cs.put("Frisco","Texas");<br>
cs.put("Cedar Rapids","Iowa");<br>
cs.put("Topeka","Kansas");<br>
cs.put("Visalia","California");<br>
cs.put("Waco","Texas");<br>
cs.put("Elizabeth","New Jersey");<br>
cs.put("Bellevue","Washington");<br>
cs.put("Gainesville","Florida");<br>
cs.put("Simi Valley","California");<br>
cs.put("Charleston","South Carolina");<br>
cs.put("Carrollton","Texas");<br>
cs.put("Coral Springs","Florida");<br>
cs.put("Stamford","Connecticut");<br>
cs.put("Hartford","Connecticut");<br>
cs.put("Concord","California");<br>
cs.put("Roseville","California");<br>
cs.put("Thornton","Colorado");<br>
cs.put("Kent","Washington");<br>
cs.put("Lafayette","Louisiana");<br>
cs.put("Surprise","Arizona");<br>
cs.put("Denton","Texas");<br>
cs.put("Victorville","California");<br>
cs.put("Evansville","Indiana");<br>
cs.put("Midland","Texas");<br>
cs.put("Santa Clara","California");<br>
cs.put("Athens","Georgia");<br>
cs.put("Allentown","Pennsylvania");<br>
cs.put("Abilene","Texas");<br>
cs.put("Beaumont","Texas");<br>
cs.put("Vallejo","California");<br>
cs.put("Independence","Missouri");<br>
cs.put("Springfield","Illinois");<br>
cs.put("Ann Arbor","Michigan");<br>
cs.put("Provo","Utah");<br>
cs.put("Peoria","Illinois");<br>
cs.put("Norman","Oklahoma");<br>
cs.put("Berkeley","California");<br>
cs.put("El Monte","California");<br>
cs.put("Murfreesboro","Tennessee");<br>
cs.put("Lansing","Michigan");<br>
cs.put("Columbia","Missouri");<br>
cs.put("Downey","California");<br>
cs.put("Costa Mesa","California");<br>
cs.put("Inglewood","California");<br>
cs.put("Miami Gardens","Florida");<br>
cs.put("Manchester","New Hampshire");<br>
cs.put("Elgin","Illinois");<br>
cs.put("Wilmington","North Carolina");<br>
cs.put("Waterbury","Connecticut");<br>
cs.put("Fargo","North Dakota");<br>
cs.put("Arvada","Colorado");<br>
cs.put("Carlsbad","California");<br>
cs.put("Westminster","Colorado");<br>
cs.put("Rochester","Minnesota");<br>
cs.put("Gresham","Oregon");<br>
cs.put("Clearwater","Florida");<br>
cs.put("Lowell","Massachusetts");<br>
cs.put("West Jordan","Utah");<br>
cs.put("Pueblo","Colorado");<br>
cs.put("San Buenaventura (Ventura)","California");<br>
cs.put("Fairfield","California");<br>
cs.put("West Covina","California");<br>
cs.put("Billings","Montana");<br>
cs.put("Murrieta","California");<br>
cs.put("High Point","North Carolina");<br>
cs.put("Round Rock","Texas");<br>
cs.put("Richmond","California");<br>
cs.put("Cambridge","Massachusetts");<br>
cs.put("Norwalk","California");<br>
cs.put("Odessa","Texas");<br>
cs.put("Antioch","California");<br>
cs.put("Temecula","California");<br>
cs.put("Green Bay","Wisconsin");<br>
cs.put("Everett","Washington");<br>
cs.put("Wichita Falls","Texas");<br>
cs.put("Burbank","California");<br>
cs.put("Palm Bay","Florida");<br>
cs.put("Centennial","Colorado");<br>
cs.put("Daly City","California");<br>
cs.put("Richardson","Texas");<br>
cs.put("Pompano Beach","Florida");<br>
cs.put("Broken Arrow","Oklahoma");<br>
cs.put("North Charleston","South Carolina");<br>
cs.put("West Palm Beach","Florida");<br>
cs.put("Boulder","Colorado");<br>
cs.put("Rialto","California");<br>
cs.put("Santa Maria","California");<br>
cs.put("El Cajon","California");<br>
cs.put("Davenport","Iowa");<br>
cs.put("Erie","Pennsylvania");<br>
cs.put("Las Cruces","New Mexico");<br>
cs.put("South Bend","Indiana");<br>
cs.put("Flint","Michigan");<br>
cs.put("Kenosha","Wisconsin");<br>
return cs.get(city);<br>
}
</p></p>
</body>
</html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-8300404748125068202022-11-07T11:35:00.004-08:002024-03-08T07:58:52.025-08:00Cucumber Tutorial with JUNIT<html><head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6658533981545355"
crossorigin="anonymous"></script>
</head> <body> </body> </html>
<div>
Hello Friends,<br>
In this article , we will work with Selenium BDD (Behaviour driven development) using <b>Cucumber</b>.<br>
So we will learn the cucumber with below topics :- <br><br>
<h3 style = "color:blue"><b>1).</b> How to Configure/Install Cucumber in eclipse <h3>
<h3 style = "color:blue"><b>2).</b> How to create maven project <b>&</b> change it to cucumber project<h3>
<h3 style = "color:blue"><b>3). </b>Dependencies required to configure the cucumber<h3>
<h3 style = "color:blue"><b>4). </b>Create a feature file<h3>
<h3 style = "color:blue"><b>5). </b>Create step definition file<h3>
<h3 style = "color:blue"><b>6).</b> Create runner file<h3>
<h3 style = "color:blue"><b>7).</b> Run cucumber project<h3>
<br><br>
<b style = "color:green">How to install the Cucumber plugin in Eclipse:</b> please follow the below path in eclipse <br><br>
<b>Help</b> -->> <b>Eclipse Market Place</b> --> <b>Search "Cucumber" in search box</b> --> Click on <b>Install</b><br> as shown in below image <br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOOe11CsC5gSOVe6UgHLJW6Znh5LzlZYVNTizB8ZhKMCAfTlQvOWQLZOkeJ1Ak7CAw_5EMp9vyc07L0BkellekrUmj1BZDbGuMe7MdCvSFZ7fOESzyNyVTR9_sB7itTyIxmYbtni6GJPqMxOJKDQIWB8UxdnHfx4RYoA2Dbc3Zuytmla_XITLQfxqH/s797/Eclipse%20Marketplace.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" height="400" data-original-height="797" data-original-width="738" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOOe11CsC5gSOVe6UgHLJW6Znh5LzlZYVNTizB8ZhKMCAfTlQvOWQLZOkeJ1Ak7CAw_5EMp9vyc07L0BkellekrUmj1BZDbGuMe7MdCvSFZ7fOESzyNyVTR9_sB7itTyIxmYbtni6GJPqMxOJKDQIWB8UxdnHfx4RYoA2Dbc3Zuytmla_XITLQfxqH/s400/Eclipse%20Marketplace.png"/></a></div>
<br><br>
OR <b>Help</b> -->> <b>Install New Software</b> --> <b> Click on Add button</b> --> <b>http://cucumber.github.io/cucumber-eclipse/update-site</b> --><b>Save</b>
<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYsGolCJiwmXdAl4OHwHeMBq7bB0E8FrW4d1sDhUuBIsCE2dAk_jkAe9poEwGI152_q44ijFIKMFo6IG7a3dX3j0WuxgY4gqcRLBmD6fG6_dwQsvVKCdwUpWyWVYc4TVpYw5BnX9hU83vC7rCYHCu1Pzli1c3laQWR9wd0qOKdiAPLeB9yTZDTH8ua/s1145/install%20cucumber%20from%20url.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="400" data-original-height="796" data-original-width="1145" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYsGolCJiwmXdAl4OHwHeMBq7bB0E8FrW4d1sDhUuBIsCE2dAk_jkAe9poEwGI152_q44ijFIKMFo6IG7a3dX3j0WuxgY4gqcRLBmD6fG6_dwQsvVKCdwUpWyWVYc4TVpYw5BnX9hU83vC7rCYHCu1Pzli1c3laQWR9wd0qOKdiAPLeB9yTZDTH8ua/s400/install%20cucumber%20from%20url.png"/></a></div>
<br><br>
</div><br>
<div>
Now Create a Maven Project <br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR6D9HLCJ9OsZ4j8sfBuQ2vUwkdAF74lT2laZnCLmf2oKG6gqXPIF6P17oVpaNlGm4UMZfjvnOMeTEaZNybabAv0OQNr-93UlRBHFpktwHQXnJYV9wRYY7TrtfcP2UXJ2YEcwasXter9cSvYDfhn0UUs1VVce7Ip5BynTRJV9IFDATvECHvkpzz81z5uk/s1920/MavenCucumber1.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjR6D9HLCJ9OsZ4j8sfBuQ2vUwkdAF74lT2laZnCLmf2oKG6gqXPIF6P17oVpaNlGm4UMZfjvnOMeTEaZNybabAv0OQNr-93UlRBHFpktwHQXnJYV9wRYY7TrtfcP2UXJ2YEcwasXter9cSvYDfhn0UUs1VVce7Ip5BynTRJV9IFDATvECHvkpzz81z5uk/s600/MavenCucumber1.png"/></a></div>
<br>
</div>
<div>
Now configure the POM.xml file <b> == ></b>Add Cucumber, Junit dependency , <b>==>></b> add plugins
<br><br>
<p style = "background-color : white"> <br>
<b><</b>project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"<b>></b><br>
<b><</b>modelVersion>4.0.0<b><</b>/modelVersion<b>></b><br><br>
<b><</b>groupId<b>></b>way2testingCucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>way2testingCucumber<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>0.0.1-SNAPSHOT<b><</b>/version<b>></b><br>
<b><</b>packaging<b>></b>jar<b><</b>/packaging<b>></b><br><br>
<b><</b>name<b>></b>way2testingCucumber<b><</b>/name<b>></b><br>
<b><</b>url<b>></b>http://maven.apache.org<b><</b>/url<b>></b><br><br>
<b><</b>properties<b>></b><br>
<b><</b>project.build.sourceEncoding<b>></b>UTF-8<b><</b>/project.build.sourceEncoding<b>></b><br>
<b><</b>cucumber.version<b>></b>7.14.1<b><</b>/cucumber.version<b>></b><br>
<b><</b>surefire.version<b>></b>3.2.2<b><</b>/surefire.version<b>></b><br>
<b><</b>maven.complier.version<b>></b>3.11.0<b><</b>/maven.complier.version<b>></b><br>
<b><</b>/properties<b>></b><br><br>
<b><</b>dependencies<b>></b><br>
<b><</b>!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId<b>></b>io.cucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>cucumber-java<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>${cucumber.version}<b><</b>/version<b>></b><br>
<b><</b>/dependency<b>></b><br><br>
<b><</b>!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId>io.cucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId>cucumber-junit<b><</b>/artifactId<b>></b><br>
<b><</b>version>${cucumber.version}<b><</b>/version<b>></b><br>
<b><</b>scope>test<b><</b>/scope<b>></b><br>
<b><</b>/dependency<b>></b><br>
<b><</b>!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-core --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId<b>></b>io.cucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>cucumber-core<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>${cucumber.version}<b><</b>/version<b>></b><br>
<b><</b>/dependency<b>></b><br>
<b><</b>!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId<b>></b>io.cucumber<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>cucumber-testng<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>${cucumber.version}<b><</b>/version<b>></b><br>
<b><</b>/dependency<b>></b><br><br>
<b><</b>!-- https://mvnrepository.com/artifact/org.testng/testng --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId<b>></b>org.testng<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>testng<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>7.8.0<b><</b>/version<b>></b><br>
<b><</b>scope<b>></b>test<b><</b>/scope<b>></b><br>
<b><</b>/dependency<b>></b><br><br>
<b><</b>!-- https://mvnrepository.com/artifact/junit/junit --<b>></b><br>
<b><</b>dependency<b>></b><br>
<b><</b>groupId>junit<b><</b>/groupId<b>></b><br>
<b><</b>artifactId>junit<b><</b>/artifactId<b>></b><br>
<b><</b>version>4.13.1<b><</b>/version<b>></b><br>
<b><</b>scope>test<b><</b>/scope<b>></b><br>
<b><</b>/dependency<b>></b><br><br>
<b><</b>/dependencies<b>></b><br><br>
<b><</b>build<b>></b><br>
<b><</b>pluginManagement></b><br>
<b><</b>plugins<b>></b><br>
<b><</b>plugin<b>></b><br>
<b><</b>groupId>org.apache.maven.plugins<b><</b>/groupId<b>></b><br>
<b><</b>artifactId>maven-compiler-plugin<b><</b>/artifactId<b>></b><br>
<b><</b>version>${maven.complier.version}<b><</b>/version<b>></b><br>
<b><</b>configuration<b>></b><br>
<b><</b>source>1.8<b><</b>/source<b>></b><br>
<b><</b>target>1.8<b><</b>/target<b>></b><br>
<b><</b>/configuration<b>></b><br>
<b><</b>/plugin<b>></b><br>
<b><</b>plugin<b>></b><br>
<b><</b>groupId<b>></b>org.apache.maven.plugins<b><</b>/groupId<b>></b><br>
<b><</b>artifactId<b>></b>maven-surefire-plugin<b><</b>/artifactId<b>></b><br>
<b><</b>version<b>></b>${surefire.version}<b><</b>/version><b><</b>/plugin<b>></b><br>
<b><</b>/plugins><b><</b>/pluginManagement<b>></b><br>
<b><</b>/build<b>></b><br>
<b><</b>/project<b>></b><br><br>
</p> </div>
<div><br><br>
<b style = "color:green">Create a Resource folder and feature file inside it</b><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEdY7scqFW1RSCX_0evLrzWtPsV_DUfwGEw1InR6X4HW4a0ovZQDfvXmRWH__QfzYsuMozX6DX8obffmQBSmhUA22FECn8-fLeDd_UYOmOWLYuvu7rWqF8zOEVxxE8eFhYR8-CmDM3uThjQ8GqB6gBsC-7ONCtyXMeDeW0HqwoiSTHbcPhohQkVs48tIY/s1920/MavenCucumber2.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEdY7scqFW1RSCX_0evLrzWtPsV_DUfwGEw1InR6X4HW4a0ovZQDfvXmRWH__QfzYsuMozX6DX8obffmQBSmhUA22FECn8-fLeDd_UYOmOWLYuvu7rWqF8zOEVxxE8eFhYR8-CmDM3uThjQ8GqB6gBsC-7ONCtyXMeDeW0HqwoiSTHbcPhohQkVs48tIY/s600/MavenCucumber2.png"/></a></div>
<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1H-qMbUyGjDrrUmcAA7x5Fy61_s5Xn8iOCMWA2bQrUPJMZotguYNATDrEBTeOdqmGZoOPJvm0qvd_uKe1HpctHJLKA0xilk6TMkL_a-Fxp01AuBz5uyR8H48zeMAXRDltXQfQTFeqNcs1eyRR-LHJ0JXn0I9GwMd_mKn4goOiiA_nZ5FrTQ8TaanKtnw/s1920/MavenCucumber2.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1H-qMbUyGjDrrUmcAA7x5Fy61_s5Xn8iOCMWA2bQrUPJMZotguYNATDrEBTeOdqmGZoOPJvm0qvd_uKe1HpctHJLKA0xilk6TMkL_a-Fxp01AuBz5uyR8H48zeMAXRDltXQfQTFeqNcs1eyRR-LHJ0JXn0I9GwMd_mKn4goOiiA_nZ5FrTQ8TaanKtnw/s600/MavenCucumber2.png"/></a></div><br><br>
</div>
<div>
<b style = "color:green">Create a package "StepDefinition" and created a class and write all steps definitions</b> <br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTJtAGltPUekQjU0fw9yE2YHeiW96rGudeg3DC0-yc2NmZEqBd95TIeAWZ1X3iNgEPZ-D3kzMd8iS4X9o1Qw7RRugoBG07E1OJAfAVqg9cRns-QqUTG6c-QlJDX2m_gVX6AtcIdHsaYfTo1o4qijQfji2JEoknNbu6qYQ2Ay2vM89E2apGoJm-mPBhMks/s1895/StepDefinitions.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="810" data-original-width="1895" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgTJtAGltPUekQjU0fw9yE2YHeiW96rGudeg3DC0-yc2NmZEqBd95TIeAWZ1X3iNgEPZ-D3kzMd8iS4X9o1Qw7RRugoBG07E1OJAfAVqg9cRns-QqUTG6c-QlJDX2m_gVX6AtcIdHsaYfTo1o4qijQfji2JEoknNbu6qYQ2Ay2vM89E2apGoJm-mPBhMks/s600/StepDefinitions.png"/></a></div>
</div> <br><br>
<div>
<b style = "color:green">Create a runner package and a runner class and add Cucumber Options </b> <br>
<p style = "background-color : white">
package Runner;<br>
import io.cucumber.junit.CucumberOptions;<br>
import org.junit.runner.RunWith;<br>
import io.cucumber.junit.Cucumber;<br>
@RunWith(Cucumber.class)<br>
@CucumberOptions(features = "D:\\Software\\Selenium\\01_Cucumber_Framework_2024\\WorkSpace\\way2testingCucumber\\Resource", <br>
glue = {"Step_definitions"}, <br>
plugin = {"pretty", "html:target/cucumber-reports.html", "json:target/report.json"}, <br>
tags="@Regression", <br>
monochrome =true )<br>
public class TestRunner {<br>
}</p><br><br><div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLXLItOll-aZfVd0xCCOlA-SfUoVi1RZ3RfNgnuUbe2nUvxuGK64Rbrkl-vIRctVQRh6toAraOajtdxV2c73c46pGuVtI0n4321bVIeXIdinR1LkTdk7mx95ffaQs0ABmZnIziwPaC3UwjfqO4XREZWHDrEUF-IFTZfQ85l3iU0F5_u7DdhXTwbVvayMM/s1920/runner.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLXLItOll-aZfVd0xCCOlA-SfUoVi1RZ3RfNgnuUbe2nUvxuGK64Rbrkl-vIRctVQRh6toAraOajtdxV2c73c46pGuVtI0n4321bVIeXIdinR1LkTdk7mx95ffaQs0ABmZnIziwPaC3UwjfqO4XREZWHDrEUF-IFTZfQ85l3iU0F5_u7DdhXTwbVvayMM/s600/runner.png"/></a></div>
</div><br><br>
<div><b style = "color:blue">Now run the cucumber test either via <b style = "color:red">JUNIT</b> or by <b style = "color:green">Maven </b></b>
<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7D9gcN5BjCjcZngJQJcitShU4b_L2WV3F4ixPM5HS7jBSBYjjfX3VdyFAfGwJIJTuw6VsF__3rMakNyRpnS6v-WW5WAKM-bW_X42GP_A29IsK21PxCC4DhUuXMH9mVdFlinCoXCz5nHxFpVs0f35OAgOumw7pAeNuHQwjGWtb-sZNyZjurM81oKXIepI/s1920/RunCucumber.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="1080" data-original-width="1920" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7D9gcN5BjCjcZngJQJcitShU4b_L2WV3F4ixPM5HS7jBSBYjjfX3VdyFAfGwJIJTuw6VsF__3rMakNyRpnS6v-WW5WAKM-bW_X42GP_A29IsK21PxCC4DhUuXMH9mVdFlinCoXCz5nHxFpVs0f35OAgOumw7pAeNuHQwjGWtb-sZNyZjurM81oKXIepI/s600/RunCucumber.png"/></a></div>
</div><br><br>
<h3><a href = "">SetUp Cucumber Maven JUnit from scratch</a></h3><br>
<h3><a href = "">Create project with Cucumber Maven JUnit from scratch</a></h3><br>
<br><br>
<html> <head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6658533981545355"
crossorigin="anonymous"></script>
</head> <body> </body> </html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-13549177081249589852022-08-11T12:21:00.004-07:002024-03-06T09:41:30.296-08:00Basic Rest Assured Methods<html><head></head><body></body></html>
<html>
<head>
<script type="text/javascript">
$(document).ready(function(){
$('img', 'a').mouseenter(function(){
$(this).css({
'transform':'scale(2,2)',
'transition': '0.5s ease'
});
});
$('img', 'a').mouseout(function(){
$(this).css({
'transform':'scale(1,1)',
'transition': '0.5s ease'
});
});
});
</script>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- chandan Ads -->
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="auto" data-ad-slot="9308698023" style="display: block;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</head>
<body>
Hello Friends,
In this article we will cover all the possible Rest Assured methods :-
</body>
</html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-11240872763249094292022-05-16T01:14:00.019-07:002024-03-05T03:31:50.999-08:00JavascriptExecutor usage in selenium<html><head>
<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- chandan Ads -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6658533981545355"
data-ad-slot="9308698023"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<html> <body>
<marquee><b>In this article we will see how to perform multiple operations like scroll, click, getText, sendText using java script executor</b></marquee> <br>
<p>If a web page is highly dynamic in nature it have complex Javascript functions or Ajax function then sometimes simple click using selenium like<br>
<b>driver.findElement(By.xpath("")).click();</b> do not work OR many functions like getText(), sendKeys() etc do not work<br>
So here we can use <b>JavascriptExecutor</b>Interface and its various mathods to perform such operations.<br><br></p>
<h3 style = "color: blue">How to perform Scroll by using java script executor</h3>
<div class = "code">
JavascriptExecutor jse = (JavascriptExecutor)driver;<br>
jse.executeScript("window.scrollBy(X,Y)", "");<br>
//here X & Y are value in pixal<br><br>
<b>Example :- </b>
JavascriptExecutor jse = (JavascriptExecutor)driver;<br>
jse.executeScript("window.scrollBy(0,250)", "");<br>
</div>
<br><br>
<div class = "code">
public static void scrollxandy(WebDriver driver, int x, int y)<br>
{<br>
JavascriptExecutor jse = (JavascriptExecutor)driver;<br>
jse.executeScript("window.scrollBy("+x+","+y+")", "");<br>
}<br>
</div>
<br><br>
<h3 style = "color: blue">How to perform Scroll upto a webElement by using java script executor</h3><br>
<div class = "code">
WebElement element = driver.findElement(By.xpath(""));<br>
JavascriptExecutor jse = (JavascriptExecutor)driver;<br>
jse.executeScript("arguments[0].scrollIntoView();", element);<br>
</div>
<br><br>
<h3 style = "color: blue">How to perform Scroll upto upto bottom of WebPage by using java script executor</h3><br>
<div class = "code">
JavascriptExecutor jse = (JavascriptExecutor)driver;<br>
jse.executeScript("window.scrollTo(0, document.body.scrollHeight)");<br>
<br>
</div><br><br>
<div class = "code">
public static void scrolluptobottom(WebDriver driver)<br>
{<br>
JavascriptExecutor jse = (JavascriptExecutor)driver;<br>
jse.executeScript("window.scrollTo(0, document.body.scrollHeight)");<br>
}<br>
</div><br><br>
<h3 style = "color: blue">How to perform Action click by using java script executor</h3><br>
<div class = "code">
WebElement element = driver.findElement(By.xpath(""));<br>
JavascriptExecutor jse = (JavascriptExecutor)driver;<br>
jse.executeScript("arguments[0].click();", we);
<br>
</div><br><br>
<h3 style = "color: blue">How to perform Action SendKeys/SendText by using java script executor</h3><br>
<div class = "code">
public static void sendTextusingJavascriptExecutor(WebDriver driver, WebElement we, String text) <br>
{ <br>
String inputtext = "arguments[0].value='"+text+"';"; <br>
JavascriptExecutor jse = (JavascriptExecutor)driver; <br>
jse.executeScript(inputtext, we); <br>
} <br>
<br>
</div><br><br>
<h3 style = "color: blue">How to perform Action getText by using java script executor</h3><br>
<div class = "code">
public static String getTextUsingJavascriptExecutor(WebDriver driver, WebElement we)<br>
{<br>
JavascriptExecutor jse = (JavascriptExecutor)driver;<br>
String text = (String) jse.executeScript("return arguments[0].value", we);<br>
return text;<br>
}<br>
<br><br></div><br><br>
<h3 style = "color: blue">How to Highlight a webElement by using java script executor</h3><br>
<div class = "code">
public static void highlight(WebDriver driver, WebElement element) throws Exception <br>
{<br>
JavascriptExecutor jse = (JavascriptExecutor)driver;<br>
jse.executeScript("arguments[0].setAttribute('style', 'background:yellow; border : 2px solid red;');", element);<br>
Thread.sleep(100);<br>
jse.executeScript("argument[0].setAtrribute('style', '');", element);<br>
Thread.sleep(100);<br>
jse.executeScript("arguments[0].setAttribute('style', 'background:yellow; border : 2px solid red;');", element);<br>
}<br>
</div>
</html></body>
<br><br><br><br>
<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-7293560444343619862022-05-01T11:24:00.005-07:002024-03-06T09:41:52.398-08:00How to Press Multiple Keys in Selenium<html> <br>
<head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6658533981545355"
crossorigin="anonymous"></script>
</head>
<body>
<marquee><b>How to press mulitple keys in selenium</b></marquee> <br>
<html><body>
<h3><b style = "color:blue">Example </b>:- Press control + t key : </h3> <br>
<br>
driver.findElement(By.cssSelector(“body”)).sendKeys(Keys.CONTROL + 't'); <br><br>
OR <br><br>
driver.findElement(By.xpath("")).sendKeys(Keys.chord(Keys.CONTROL, "T")); <br><br>
------------------------------------<br>
<marquee><b>How to press Enter keys in selenium</b></marquee> <br>
WebElement textbox = driver.findElement(By.id("idOfElement"));<br><br>
textbox.sendKeys(Keys.ENTER);<br><br>
<h3>How to Press thress keys simultaneously in selenium</h3> <br>
driver.findElement(By.xpath("")).sendKeys(Keys.chord(Keys.CONTROL, Keys.ALT, Keys.DELETE));<br>
</body></html>
<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-5369218353846623112022-05-01T03:55:00.004-07:002022-05-01T03:57:02.052-07:00How to Validate input/character is number or string in Java<marquee><b style = "color:brown">Validate Input String is number or not</b></marquee>
<html>
<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- chandan Ads -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6658533981545355"
data-ad-slot="9308698023"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</head>
<body>
<br><br>
<br><br>
<b>Hello Friends</b>,<br>
<p>
This article will describe how can we check whether a data is number or String in java. </p>
<br><br>
<b>Algorithm :-</b> <br>
1). First Break the string into characterArray.
2) Now to check for number use Integer.Parseint()
3) Use Character.isDigit() to check whether character is number or not.
<div class = "code">
<br><br>
<b>Example :- </b> <br>
import java.util.*;<br>
import org.testng.Assert;<br>
import org.testng.annotations.Test;<br>
import org.testng.asserts.SoftAssert;<br>
public class PojorunExample <br>
{<br>
static boolean isnumber(String x)<br>
{<br>
boolean flag = false;<br>
try<br>
{<br>
int num = Integer.parseInt(x);<br>
flag = true;<br>
}<br>
catch(Exception e)<br>
{
<br>
}<br>
return flag;<br>
}<br>
@Test<br>
public void g()<br>
{<br>
String x = "Chandan";<br>
String y = "chandan30";<br>
if(isnumber(x))<br>
{<br>
System.out.println("its a number");<br>
}<br>
else<br>
{<br>
System.out.println("its not a number");<br>
}<br>
char[] ch = y.toCharArray();<br>
for(int i = 0; i<b><</b>ch.length; i++)<br>
{<br>
if(Character.isDigit(ch[i]))<br>
{<br>
System.out.println(ch[i] + " " + "this is number");<br>
}<br>
else<br>
{<br>
System.out.println(ch[i] + " " + "this is letter");<br>
}<br>
}<br>
}<br>
}<br>
</div>
<b>Output :-</b> <br>
its not a number<br>
c this is letter<br>
h this is letter<br>
a this is letter<br>
n this is letter<br>
d this is letter<br>
a this is letter<br>
n this is letter<br>
3 this is number<br>
0 this is number<br>
<br>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-55548440143262989212022-04-16T02:55:00.034-07:002024-03-02T11:51:48.313-08:00POJO Class in Java
<html>
<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- chandan Ads -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6658533981545355"
data-ad-slot="9308698023"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</head>
<body>
<marquee><b style = "color:brown">POJO Class in Java with example</b></marquee>
<br><br>
<style>
table {
border: 1px solid #ccc;
border-collapse: collapse;
margin: 0;
padding: 0;
width: 100%;
table-layout: fixed;
}
table caption {
font-size: 1.5em;
margin: .5em 0 .75em;
}
table tr {
background-color: #f8f8f8;
border: 1px solid #ddd;
padding: .35em;
}
table th,
table td {
padding: .625em;
text-align: left;
}
table th {
font-size: .85em;
letter-spacing: .1em;
text-transform: uppercase;
}
@media screen and (max-width: 600px) {
table {
border: 0;
}
table caption {
font-size: 1.3em;
}
table thead {
border: none;
clip: rect(0 0 0 0);
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
position: absolute;
width: 1px;
}
table tr {
border-bottom: 3px solid #ddd;
display: block;
margin-bottom: .625em;
}
table td {
border-bottom: 1px solid #ddd;
display: block;
font-size: .8em;
text-align: left;
}
table td::before {
/*
* aria-label has no advantage, it won't be read inside a table
content: attr(aria-label);
*/
content: attr(data-label);
float: left;
font-weight: bold;
text-transform: uppercase;
}
table td:last-child {
border-bottom: 0;
}
}
/* general styling */
body {
font-family: "Open Sans", sans-serif;
line-height: 1.25;
}
</style>
<br><br>
<b>Hello Friends</b>,<br>
<p>
This article will describe the concept of pojo class in java. </p>
<br><br>
<b> <h4 style = "background-color:LightSalmon"> POJO Class in Java </h4> :- </b> <br><br>
<h3>POJO stands for :- <div style = "color :HotPink"> PLAIN OLD JAVA OBJECT </div> </h3>
<p> </p>
Pojo is an ordinary object and pojo is not bound by any special restriction. <br>
Also pojo file does not require any special classpath. <br>
It increases the readability and re-usability of a java program. <br>
<b style = "color:red">History :- </b> <br>
In 2000, The term POJO was introduced by Martin Fowler ( An American software developer). it is available in Java from the EJB 3.0 by sun microsystem.<br><br>
<b style = "color:red">Rule :- </b> <br>
<div style = "background-color: white">
1) Class must be public <br>
2) The object in the POJO Class can have any access modifies such as private, public, protected. But, all instance variables should be private for improved security of the project<br>
3) Must have public default constructor<br>
4) can have args constructor<br>
5) Every property/field/variable must have publc getter and setter method<br>
6) A POJO class should not extend predefined classes.<br>
7) It should not implement prespecified interfaces.<br>
8) It should not have any prespecified annotation.<br><br> </div>
<b style = "background-color:Orange">Pros of Pojo classes :- </b><br>
1) It increases the readability and re-usability of a java program. <br>
2) POjo is easy to write and Understand <br><br>
<br><center>
<iframe width="900" height="506" src="https://www.youtube.com/embed/6W7EA8mf_pA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</center><br>
<b style = "color:green">Example of POJO Class</b> <br>
<div class = "code">
public class Pojoexample<br>
{<br>
private String name;<br>
private int age;<br>
public String getName()<br>
{<br>
return name;<br>
}<br>
public void setName(String Name)<br>
{<br>
this.name = Name;<br>
}<br>
public int getAge()<br>
{<br>
return age;<br>
}<br>
public void setAge(int age)<br>
{<br>
this.age = age;<br>
}<br>
}<br><br>
</div>
<br>
-------------------------------------------------------------------<br>
<div class = "code">
public class pojoextend extends Pojoexample <br>
{<br>
}<br>
</div>
-------------------------------------------------------------------<br>
<div class = "code">
public class PojorunExample <br>
{
public static void main(String args[])<br>
{
// Pojoexample pojoobject = new Pojoexample();<br>
pojoextend pojoobject = new pojoextend();<br>
pojoobject.setName("Chandan Singh");<br>
pojoobject.setAge(30);<br>
System.out.println(pojoobject.getName());<br>
System.out.println(pojoobject.getAge());<br>
}<br>
}<br>
</div>
<b>Output :- </b> Chandan Singh<br>
30 <br><br>
-------------------------------------------------------------------<br>
<b>POJO Class Example by using Arguments Constructor</b> <br>
<div class = "code">
public class Pojoexample<br>
{<br>
private String name;<br>
private int age;<br>
Pojoexample(String name, int age)<br>
{<br>
this.name = name;<br>
this.age = age;<br>
}<br>
public String getName()<br>
{<br>
return name;<br>
}<br>
public int getAge()<br>
{<br>
return age;<br>
}<br>
}<br><br>
</div>
<br><br>
<h3>POJO Vs JAVA Beans </h3><br>
<table>
<th style = "background-color:Moccasin">
POJO
</th>
<th style = "background-color:PeachPuff">
Java Beans
</th>
<tr><td style = "background-color:LightCyan">Pojo does not have special restrictions other than those
forced by java language</td><td>Java Beans is a special POJO which have some restrictions.</td></tr>
<tr><td style = "background-color:LightCyan">It doesn't provide much control on members</td><td>It provide complete control on members</td></tr>
<tr><td style = "background-color:LightCyan">Pojo can implement the serializable interface, but it is not mandatory </td><td>The Bean class should implement the Serializable interface</td></tr>
<tr><td style = "background-color:LightCyan">Pojo class can be accessed by using their names</td><td>The Bean class can only be accessed by using the getters and setters.</td></tr>
<tr><td style = "background-color:LightCyan">Fields may have any of the access modifiers such as public, private, protechted.</td>
<td>Fields can only have private access.</td></tr>
<tr><td style = "background-color:LightCyan">In POJO, it may or may not have no-ar constructor</td><td>It must have a no-arg constructor</td></tr>
<tr><td style = "background-color:LightCyan">It is used when you don’t want to give restriction on your members and give user complete access of your entity</td>
<td>It is used when you want to provide user your entity but only some part of your entity.</td></tr>
</table>
<br><br>
<b>Interview Question</b><br><br>
<b>Q1).</b> Can we extend POJO class?<br>
<b>Answer :-</b> Yes, one class can extend pojo class.<br>
<br>
<b>Q2).</b> What are three rule of POJO class?<br>
<b>Answer :-</b> Rules are :- .<br>
1) A POJO class should not extend predefined classes.<br>
2) It should not implement prespecified interfaces.<br>
3) It should not have any prespecified annotation.<br><br>
<br><br>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6658533981545355"
crossorigin="anonymous"></script>
<!-- Google Ad 2024 -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6658533981545355"
data-ad-slot="5808750864"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br>
</body></html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-29889768526967947972022-02-21T10:20:00.013-08:002024-03-06T09:43:17.497-08:00Loose Coupling and Tight Coupling in Java with example<marquee><b style = "color:brown">Loose Coupling and Tight Coupling in Java with example</b></marquee>
<html>
<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- chandan Ads -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6658533981545355"
data-ad-slot="9308698023"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</head>
<body>
<br><br>
<br><br>
<b>Hello Friends</b>,<br>
<p>
This article will describe the concept of tight and loose coupling in java. </p>
<br><br>
<b>Coupling :-</b> Degree of dependency of Class A on Class B. <br>
How often do changes in one class force changes in another class.
<br><br><br>
<b>Tight Coupling :-</b> <br>Two classes often change together
If class A knows more than it should about the way in which class B
was implemented, then A and B are tightly coupled. <br><br><br>
<b>Loose Coupling :-</b> <br>
Reducing the dependencies of a class that uses the different classes directly.<br>
If the only knowledge that class A has about class B, is
what class B has exposed through its interface, then class
A and class B are said to be loosely coupled.<br><br><br>
<b style = "color:green">Example of Tight coupling</b> <br>
<div class = "code">
class A1<br>
{<br>
A1(int x , int y)<br>
{<br>
System.out.println("sum is " + (x+y));<br>
}<br>
void sam()<br>
{<br>
System.out.println("i am method of class A");<br>
}<br>
}<br>
class B extends A1 <br>
{<br>
B(int x, int y) <br> //have to add this constructor other wise while creating the object , compile time error will appear.
{<br>
super(x, y);<br>
}<br>
void sam()<br>
{<br>
System.out.println("i am method of class B");<br>
} <br>
}<br>
public class Coupling <br>
{<br>
public static void main(String args[])<br>
{<br>
B obj = new B(7, 8);<br>
obj.sam();<br>
}<br>
}<br>
<br>
</div>
<br>
<b style = "color:green">Example of loose coupling</b> <br>
<div class = "code">
interface mycoup<br>
{<br>
void sample();<br>
}<br>
class A1 implements mycoup<br>
{<br>
A1(int x , int y)<br>
{<br>
System.out.println("sum is " + (x+y));<br>
}<br>
@Override<br>
public void sample()<br> {<br>
System.out.println("i am method of class A");<br>
}<br>
}<br>
class B implements mycoup<br>
{<br>
public void sample()<br> {<br>
System.out.println("i am method of class B");<br>
}<br>
}<br>
public class Coupling <br>
{<br>
public static void main(String args[])<br>
{<br>
B obj = new B();<br>
obj.sample();<br>
A1 obj1 = new A1(3, 7);<br>
obj1.sample();<br>
}<br>
}<br><br>
<b>Output:- </b><br>
i am method of class B <br>
sum is 10 <br>
i am method of class A<br>
</div>
</body></html><html> <head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6658533981545355"
crossorigin="anonymous"></script></head><body></body></html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-37420202182153975902022-02-12T09:13:00.010-08:002022-02-12T09:25:48.288-08:00Upload Operation in Selenium testing the post<marquee><b style = "color:brown">How to upload the file using selenium</b></marquee>
<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br><br>
<h3> <a href = "http://www.way2testing.com/p/this-webpage-is-designed-for-selenium.html" target = "_blank">Click Here to navigate on practice page</a></h3>
<br><br>
<b>Hello Friends</b>,
In this tutorial we will learn how to perform upload operation in selenium. <br>
We can perform the upload operation in selenium by two ways : <br>
<b>1).</b> First by <b>SendKeys()</b> method. <br>
<b>2).</b> Second by using the robot class. <br>
<b>First Method : </b><br>
Precondition : Element should be <b style = "color:red">input</b> and <b style = "color:blue">type</b> should be <b>"file"</b>, as shown below : <br><br>
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtPSUi2Q8fXpSIKkVEjq28QNvfZo2PaIPkqKuPx6ck_3MbH8AniXpFKt2BCDTDZ-dGewfKIxE7xgZJoi2M5t9gl3gf0NkY5HfSA11SjDvzngFhZ8yXrmCk4l0Th2P89kC2dXS9am4XshE/s1600/sendkeyupload.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtPSUi2Q8fXpSIKkVEjq28QNvfZo2PaIPkqKuPx6ck_3MbH8AniXpFKt2BCDTDZ-dGewfKIxE7xgZJoi2M5t9gl3gf0NkY5HfSA11SjDvzngFhZ8yXrmCk4l0Th2P89kC2dXS9am4XshE/s400/sendkeyupload.png" width="400" height="204" data-original-width="941" data-original-height="480" /></a></div>
<br><br>
Now we just need to locate the element and just use the method <b>sendKeys()</b> and in sendKeys() method we will pass the path of that file. <br>
<b>Syntax :- </b> <br>
driver.findElement(By.xpath("path of element")).sendKeys("path on file");<br><br>
<b style = "color: blue">Here is sample code :-</b>
<br>
<p style = "background-color: white">
<div class = "code">
import org.openqa.selenium.By;<br>
import org.openqa.selenium.WebDriver;<br>
import org.openqa.selenium.chrome.ChromeDriver;<br>
import org.testng.annotations.BeforeTest;<br>
import org.testng.annotations.Test;<br><br>
public class Uploadfile <br>
{<br>
WebDriver driver;<br>
@BeforeTest<br>
public void g() throws InterruptedException<br>
{<br>
System.setProperty("webdriver.chrome.driver", "C:\\Users\\cchauhan\\Downloads\\chromedriver_win32\\chromedriver.exe");<br>
driver = new ChromeDriver();<br>
/*FirefoxOptions foptions = new FirefoxOptions();<br>
foptions.setCapability("marionette", false);<br>
driver = new FirefoxDriver(foptions);*/<br>
driver.manage().window().maximize();<br>
driver.navigate().to("http://www.way2testing.com/p/this-webpage-is-designed-for-selenium.html");<br>
Thread.sleep(3000);<br>
}<br>
@Test<br>
public void h()<br>
{<br>
//Remember element should be input and type should be "file"<br>
driver.findElement(By.xpath(".//*[@id='post-body-2064404811754288590']/form[1]/input[1]")).sendKeys("C:\\Users\\cchauhan\\Desktop\\wallpaper.png");<br>
}<br>
}<br>
</div>
</p>
<br><br><center>
<iframe width="560" height="315" src="https://www.youtube.com/embed/GVv4HAntJMA" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
</center><br><br>
<b>Second Method : </b>By using Robot Class:- <br>
<b style = "color:blue">What is Robot class ?</b> <br>
"Basically robot class will simulate the Keyboard and mouse actions." <br>
<b>Steps :- </b><br> <b> 1).</b> First Copy the file path. <br>
<b> 2).</b>Paste the file path in popup window <br>
<b> 3).</b>Press Enter button. <br>
<br>
<b style = "color:blue">by robot class we can perform <b>CTRL + C</b> operation by below methods as :-</b><br>
StringSelection ss = new StringSelection("C:\\Users\\cchauhan\\Desktop\\wallpaper.png"); <br>
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);<br><br>
<b style = "color:blue">by robot class we can perform <b>CTRL + V</b> operation as below :- </b><br>
robot.keyPress(KeyEvent.VK_CONTROL);<br>
robot.keyPress(KeyEvent.VK_V);<br>
robot.keyRelease(KeyEvent.VK_CONTROL);<br>
robot.keyRelease(KeyEvent.VK_V);<br><br>
<br><br>
<b style = "color:blue">by robot class we can press enter key as below :-</b><br>
robot.keyPress(KeyEvent.VK_ENTER);<br>
robot.keyRelease(KeyEvent.VK_ENTER);<br><br>
<b style = "color: blue">Here is sample code :-</b>
<br>
<br>
<p style = "background-color: white">
import java.awt.AWTException;<br>
import java.awt.Robot;<br>
import java.awt.Toolkit;<br>
import java.awt.datatransfer.StringSelection;<br>
import java.awt.event.KeyEvent;<br>
import org.openqa.selenium.By;<br>
import org.openqa.selenium.WebDriver;<br>
import org.openqa.selenium.chrome.ChromeDriver;<br>
import org.testng.annotations.BeforeTest;<br>
import org.testng.annotations.Test;<br>
public class Uploadfile <br>
{<br>
WebDriver driver;<br>
@BeforeTest<br>
public void g() throws InterruptedException<br>
{<br>
System.setProperty("webdriver.chrome.driver", "C:\\Users\\cchauhan\\Downloads\\chromedriver_win32\\chromedriver.exe");<br>
driver = new ChromeDriver();<br>
/*FirefoxOptions foptions = new FirefoxOptions();<br>
foptions.setCapability("marionette", false);<br>
driver = new FirefoxDriver(foptions);*/<br>
driver.manage().window().maximize();<br>
driver.navigate().to("http://www.way2testing.com/p/this-webpage-is-designed-for-selenium.html");<br>
Thread.sleep(3000);<br>
}<br>
@Test<br>
public void h() throws AWTException<br>
{<br>
driver.findElement(By.xpath(".//*[@id='post-body-2064404811754288590']/form[1]/input[1]")).click();<br>
Robot robot = new Robot();<br>
robot.setAutoDelay(2000);<br>
StringSelection ss = new StringSelection("C:\\Users\\cchauhan\\Desktop\\wallpaper.png");<br>
Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null);<br>
robot.setAutoDelay(2000);<br>
robot.keyPress(KeyEvent.VK_CONTROL);<br>
robot.keyPress(KeyEvent.VK_V);<br>
robot.keyRelease(KeyEvent.VK_CONTROL);<br>
robot.keyRelease(KeyEvent.VK_V);<br>
robot.keyPress(KeyEvent.VK_ENTER);<br>
robot.keyRelease(KeyEvent.VK_ENTER);<br>
}<br>
}<br>
</p>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-27272136774630230002021-04-19T12:16:00.004-07:002022-02-12T02:22:21.879-08:00Constructor Chaining In java<marquee><b style = "color:brown">What is Constructor chaining in JAVA</b></marquee> <br><br>
<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br><br>
<b>Definition :-</b><br>
<p style = "color:green">
<p style = "background-color:white">
The process of invoking a sequence of constructors upon initialization of a class object is called constructor chaining.<br> Constructor chaining is useful when you want to invoke multiple constructors, one after another, by initializing only one instance.<br><br>
<b> Constructor chaining can be done in two ways:</b><br>
Within same class: It can be done using <b style = "color:blue">this()</b> keyword for constructors in same class<br>
From base class: by using <b style = "color:blue">super()</b> keyword to call constructor from the base class.<br><br></p>
</p>
<br><br>
<div class = "code">
<p style = "background-color:white">
package ChandanPack1;<br><br>
class A<br>
{<br>
A()<br>
{<br>
this(0);<br>
System.out.println("I am inside A class constructor"); <br>
}<br>
A(int x)<br>
{<br>
this(2, 4);<br>
System.out.println("Superclass second constructor" + " " +x); <br>
}<br>
A(int l, int m)<br>
{<br>
System.out.println("multiply is " + " " + (l*m));<br>
}<br>
}<br><br>
public class BajiPractice extends A<br>
{<br>
BajiPractice()<br>
{<br>
this(10);<br>
System.out.println("i am inside first constructor");<br>
}<br>
BajiPractice(int x)<br>
{<br>
this(2, 80);<br>
System.out.println("number is:->" + " "+ x);<br>
}<br>
BajiPractice(int a, int b)<br>
{<br>
super();<br>
System.out.println("the sum is" + " " +(a+b));<br>
}<br>
public static void main(String args[])<br>
{<br>
System.out.println("constructor chaining started");<br>
BajiPractice obj = new BajiPractice();<br>
}<br>
}<br><br>
</div>
</p>
<br><br>
<b style = "color:blue">Output:-</b>
constructor chaining started<br>
multiply is 8<br>
Superclass second constructor 0<br>
I am inside A class constructor<br>
the sum is 82<br>
number is:-> 10<br>
i am inside first constructor<br><br>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-88943208361999048892021-04-11T04:10:00.000-07:002021-04-11T04:10:01.167-07:00Contract Testing Overview<marquee><b style = "color:brown">Contract Testing in API</b></marquee> <br><br>
<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br><br>
<br><br>
<center>
</center>
<br><br>
<b style = "color:brown">Microservices :-</b><br><br>
Microservices is an architectural design for building a distributed application using
containers. Microservices get their name because each function of the application operates
as an independent service. This architecture allows for each service to scale or update
without disrupting other services in the application.<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYPpAX7mRkU-9xQlyhzD9s2Dg2yW2AM3S0MBjA3p9A7wnKhb9uVd2DibTDBxosFdfn0WiFfFhszLM_gUqkdWVL7sVSMWkiibajd77k-j8LjKdwRWYgfTTYZeQqcw5Cu3X9CuVb57UAzIg/s1020/MicroServices.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="400" data-original-height="594" data-original-width="1020" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYPpAX7mRkU-9xQlyhzD9s2Dg2yW2AM3S0MBjA3p9A7wnKhb9uVd2DibTDBxosFdfn0WiFfFhszLM_gUqkdWVL7sVSMWkiibajd77k-j8LjKdwRWYgfTTYZeQqcw5Cu3X9CuVb57UAzIg/s400/MicroServices.png"/></a></div>
<br><br>
<b style = "color:blue">Contract Testing :- </b>Contract testing is a way to ensure that services
(such as an API provider and a client) can communicate with each other.
Without contract testing, the only way to know that services can
communicate is by using expensive and brittle integration tests.<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSj4tDnsPFq2avxNUZ8yusagxzKVvpGSpNtOKPrdUlh9dUCFb-vGc_civz_k_oiU0SMvyuEeY8NSqJWIEqGr6yrc-Ox_teRnJ93RYaedxfuXxTFP7KrVrMY2aVQ48S2ixITb7kh5QJiUo/s1006/Why_contract_testing.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="474" data-original-width="1006" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSj4tDnsPFq2avxNUZ8yusagxzKVvpGSpNtOKPrdUlh9dUCFb-vGc_civz_k_oiU0SMvyuEeY8NSqJWIEqGr6yrc-Ox_teRnJ93RYaedxfuXxTFP7KrVrMY2aVQ48S2ixITb7kh5QJiUo/s600/Why_contract_testing.png"/></a></div>
A service consumer and a service provider interact with each other based on some protocol
or rules. This set of rules of communication between two services is called Contract and
the process of testing the communication between the two services based on this Contract
is called Contract Testing.<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-9cxj-mFOzwBUP-DRe71TCQwZp-vfC9wPCs_TKkG0EeOHnBFCpfz0LgUOTCG6utW6KOvoChH6Gs6nL1TOjyq-DRzpKHJYX1By_vMnvKsYJD1lV22HZmrAYIUuHSn47wPXaYkFa8Pi6YE/s960/what+is+Contract+Testing.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="546" data-original-width="960" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-9cxj-mFOzwBUP-DRe71TCQwZp-vfC9wPCs_TKkG0EeOHnBFCpfz0LgUOTCG6utW6KOvoChH6Gs6nL1TOjyq-DRzpKHJYX1By_vMnvKsYJD1lV22HZmrAYIUuHSn47wPXaYkFa8Pi6YE/s600/what+is+Contract+Testing.png"/></a></div>
<br><br><br>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-40589721992374112162021-03-31T23:27:00.010-07:002021-03-31T23:47:30.816-07:00API Testing Interview Questions<marquee><b style = "color:brown">API Testing Interview Questions</b></marquee> <br><br>
<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br><br>
<br><br>
<center>
</center>
<br><br>
<p style = "color:blue"><b style = "background-color: white">What are Web Services?</b></p>
<p style = "color:green"><b style = "background-color: white">A web Service can be defined by the following ways :-<br></b></p>
<b>1).</b> Is a client server application or application component for communication.<br>
<b>2).</b> Method of communication between two devices over network.<br>
<b>3). </b>Is a software system for interoperable machine to machine communication.<br>
<b>4). </b>Is a collection of standards or protocols for exchanging information between two devices of application.<br><br>
<p style = "color:blue"><b style = "background-color: white">What all challenges are included under API Testing?</b></p>
API Documentation<br>
Access to DB<br>
Authorizarion Overhead<br>
<p style = "color:blue"><b style = "background-color: white">What is the difference between PUT and POST methods ?</b></p>
Post :- Creating a new object on the server<br>
Put :- Update the object in server with new table<br>
<p style = "color:blue"><b style = "background-color: white">What are Commonly used HTTP methods?</b></p> <br>
GET :- It enables you to retrieve data from a server<br>
POST :- It enables you to add data to an existing file or resource in a server<br>
PUT :- It lets you replace an existing file or resource in a server<br>
Delete :- It lets you delete data from a server<br><br>
<p style = "color:blue"><b style = "background-color: white">List out few Authentication Technique used in API's?</b></p> <br>
Session/Cookie based Authentication<br>
Basic Authentication<br>
Digest Authentication<br>
OAuth<br>
<p style = "color:blue"><b style = "background-color: white">What is Rest API?</b></p> <br>
REST stands for Representational State Transfer. It is set of functions helping developers
in performing requests and receive responses. Interaction is made through HTTP protocol
in REST API.<br><br>
<p style = "color:blue"><b style = "background-color: white">What exactly needs to verify in API testing?</b></p>
In API testing, we send a request to API with the known data and then analysis the response.<br>
1). We will verify the accuracy of the data.<br>
2). Will see the HTTP status code.<br>
3). We will see the response time.<br>
4). Error codes in case API returns any errors.<br>
5). Authorization would be check.<br>
6). Non functional testing such as performance testing, security testing.<br><br>
<p style = "color:blue"><b style = "background-color: white">What are path parameters and Query parameters for below API Request URL</b></p>
/ for path parameter<br>
? is for Query parameter<br>
for example http://way2testing.com/tutorialorder/1122369?location=GHN<br><br>
so here /1122369 is path parameter<br>
and ? location is Query parameter also in In General Query Parameter is constructed at the end of URL.<br><br>
<p style = "color:blue"><b style = "background-color: white">Whar are the core componenets of a HTTP request?</b></p>
HTTP Request methods like PUT, POST, Delete.<br>
Base Uniform Resource identifier (URI)<br>
Resources and Parameters<br>
Request Header, which carries metadata(a key-value pairs) for the HTTP Request message.<br>
Request Body, which indicates the message content or resource representation.<br><br>
<p style = "color:blue"><b style = "background-color: white">What could be the HTTP method for below API Scenario? Answer if it is GET or POST.</b></p>
Scenario :- An API which has Endpoint, Parameter, Headers, cookies and Payload.<br>
<b>Answer :-</b>
It is a POST request because it have Payload<br><br>
<p style = "color:blue"><b style = "background-color: white">What are the differences between API Testing and UI testing?</b></p>
UI(User Interface) testing means the testing of the graphical user interface. The focus of
UI testing is on the look and feel of the application. In user interface testing the main
focus is on how user can interact with app elements such as images, fonts, layout etc. are checked.<br>
API testing allows the communication between two software systems. API testing works on
backend also known as backend testing.<br><br>
<p style = "color:blue"><b style = "background-color: white">What protocols is used by the RESTFUL web services?</b></p>
RESTFUL web services uses the HTTP protocol. They use the HTTP Protocol as a medium of
communication between the client and the server.<br><br>
<p style = "color:blue"><b style = "background-color: white">What are Soap webservices?</b></p>
SOAP stands for Simple Object Access Protocol. It is an XML based messaging protocol.
It helps in exchanging information among computers.<br><br>
<p style = "color:blue"><b style = "background-color: white">How do we Represent A resource in REST</b></p>
Using HTTP methods<br><br>
<p style = "color:blue"><b style = "background-color: white">Can you use POST request instead of PUT to create a resource?</b></p>
Yes, we can, because POST is Super set of all other HTTP methods except GET.<br><br>
<p style = "color:blue"><b style = "background-color: white">What do you understand by payload in restful Web Services?</b></p>
Payload/Body is the secured input data which is sent to API to process the
request. Payload is generally represented in JSON format in Rest API's.<br><br>
<p style = "color:blue"><b style = "background-color: white">What is Rest Assured.</b></p>
It is Java Library which can automate REST API's.<br><br>
<p style = "color:blue"><b style = "background-color: white">How would we define API details in Rest Assured Automation?</b></p>
we shall define all the request details and send it to server in GIVEN, WHEN & THEN methods.<br><br>
<p style = "color:blue"><b style = "background-color: white">What is Json serialization & Deserialization in Rest Assured.</b></p>
Serialization in Rest Assured context is a process of converting a Java Object into
Request body(payload).<br><br>
Rest Assured also supports deserialization by converting Response body back to java Object.<br><br>
<p style = "color:blue"><b style = "background-color: white">List out few common Json Parsing Techniques used in Rest Assured Automation?</b></p>
Json Path
Deserialization of Json using POJO classes.<br><br>
<p style = "color:blue"><b style = "background-color: white">How would you send attachments to API using Rest Assured Test?</b></p>
Using MultiPart Method.<br><br>
<p style = "color:blue"><b style = "background-color: white">Different Status Code & their description :-</b></p>
<b>200</b><b style = "color:blue"> OK </b> The request was successfully completed <br><br>
<b>201</b> <b style = "color:blue"> Created </b> A new Resources was successfully created.<br><br>
<b>400 </b><b style = "color:blue"> Bad Request </b> The request was invalid<br><br>
<b>401 </b><b style = "color:blue"> unauthorized </b> The request did not include an authentication token or the authentication token was expired<br><br>
<b>403</b><b style = "color:blue"> forbidden </b> The client did not have permission to access the requested resource<br><br>
<b>404</b><b style = "color:blue"> Not Found </b> The requested resource was not found<br><br>
<b>405</b><b style = "color:blue"> Method not allowed </b> The HTTP methods in the request was not supported by the resource.<br><br>
<b>409</b><b style = "color:blue"> Conflict </b> The request could not be completed due to a conflict.<br><br>
<b>500</b><b style = "color:blue"> Internal server Error </b> The request was not completed due to an internal error on server side.<br><br>
<b>503 </b><b style = "color:blue"> Service Unavailable </b> The server was unavailable.<br><br>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-19412196169696309152021-03-15T13:35:00.010-07:002022-08-13T12:04:18.617-07:00Reflection In Java
<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- chandan Ads -->
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="auto" data-ad-slot="9308698023" style="display: block;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</head>
<body>
<br><br>
<marquee><b style = "color:brown">Reflection in java</b></marquee> <br><br>
<br><br>
<center>
</center>
<br><br>
<b>Java Reflection :-</b>
In Java, reflection allows us to inspect and manipulate classes,
interfaces, constructors, methods, and fields at run time. <br> <br>
There is a class in Java named <b style = "background-color:gray">Class</b> that keeps all the information
about objects and classes at runtime. <br>
The object of <b style = "background-color:gray"> Class</b> can be used to perform reflection. <br> <br>
What is the Java Reflection API? <br>
1. Class Manipulator. <br>
2. Used to manipulate classes and everything in a class. <br>
3. can slow down a program because the JVM can't optimize the code. <br>
4. Can't be used with applets. <br>
5. Should be used sparingly. <br> <br>
Reflection of Java Classes <br> <br>
In order to reflect a Java class, we first need to create an object of <b style = "background-color:gray">Class</b>. <br>
And, using the object we can call various methods to get information about methods, fields, and constructors present in a class. <br> <br>
There exists three ways to create objects of Class: <br>
1. Using forName() method <br>
2. Using getClass() method <br>
3. Using .class extension <br><br><br><br>
<p style = "background-color:white">
<b>Example 1:- </b><br>
import java.lang.reflect.Constructor;<br>
import java.lang.reflect.Field;<br>
import java.lang.reflect.Method;<br>
import java.lang.reflect.Modifier;<br>
import java.lang.Class;<br><br>
class vehicle<br>
{<br>
public void g()<br>
{<br>
System.out.println("I am Inside vehicle");<br>
}<br>
}<br>
class car extends vehicle<br>
{<br>
public int x ;<br>
public String name;<br>
car()<br>
{<br>
System.out.println("i am inside constructor");<br>
}<br>
car(int x, int y)<br>
{<br>
System.out.println("Sum is " + (x+y));<br>
}<br>
public void j()<br>
{<br>
System.out.println("I am Inside car");<br>
}<br>
}<br>
public class TestCsc3 <br>
{<br>
public static void main(String args[]) throws ClassNotFoundException<br>
{<br>
car cr = new car();<br>
Class cobj = cr.getClass(); <br>
TestCsc3 tc = new TestCsc3();<br>
Class cobj2 = tc.getClass();<br>
//get the name of class<br>
String classname = cobj.getName();<br>
System.out.println("Name of the class is " + classname);<br>
//get super class<br>
Class scla = cobj.getSuperclass();<br>
System.out.println("Name of super class is " + scla.getName());<br>
//get the constructor of the class<br>
Constructor[] consname = cobj.getDeclaredConstructors();<br>
for(Constructor c : consname)<br>
{<br>
System.out.println("Constructor name is :" +c.getName());<br>
}<br>
//get the modifier of the class<br>
int modi = cobj2.getModifiers();<br>
String modif = Modifier.toString(modi);<br>
System.out.println("Modifier of class is " + (modif));<br>
//get all the methods of the class<br>
Method[] mth = cobj.getMethods();<br>
for(Method m : mth)<br>
{<br>
System.out.println("Name is the methods" + m.getName());<br>
}<br>
//get declared methods of the class<br>
Method[] mth2 = cobj.getDeclaredMethods();<br>
for(Method m2 : mth2)<br>
{<br>
System.out.println("Name is the declared method is :-> " + m2.getName());<br>
}<br>
//get fields of class<br>
Field[] fld = cobj.getDeclaredFields();<br>
for(Field f : fld)<br>
{<br>
System.out.println("Name of the fiels is " + f.getName());<br>
}<br>
}<br>
}<br><br>
</p>
<b>Output :-</b><br><br>
i am inside constructor<br>
Name of the class is practice.car<br>
Name of super class is practice.vehicle<br>
Constructor name is :practice.car<br>
Constructor name is :practice.car<br>
Modifier of class is public<br>
Name is the methods j<br>
Name is the methods g<br>
Name is the methodswait<br>
Name is the methodswait<br>
Name is the methodswait<br>
Name is the methodsequals<br>
Name is the methodstoString<br>
Name is the methodshashCode<br>
Name is the methodsgetClass<br>
Name is the methodsnotify<br>
Name is the methodsnotifyAll<br>
Name is the declared method is :-> j<br>
Name of the fiels is x<br>
Name of the fiels is name<br>
-------------------------------------------------------------------------------------<br>
<b>Example 2:-</b><br>
<p style = "background-color:white">
import java.lang.Class;<br>
import java.lang.*;<br>
class pent<br>
{<br>
}<br>
public class Reflection2 <br>
{<br>
public static void main(String[] args) throws ClassNotFoundException<br>
{<br>
Class c = Class.forName("practice.pent"); <br>
System.out.println("the name is class " + c.getName());<br>
}<br>
}<br><br>
</p>
<b>Output :- </b><br>
the name is class practice.pent<br><br>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6658533981545355"
crossorigin="anonymous"></script>
<!-- CSC_horizontal -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6658533981545355"
data-ad-slot="6503641390"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</body></html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-37437595730292931252021-02-17T14:27:00.009-08:002021-02-17T15:05:07.010-08:00Blackbox Testing Technique<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br />
<br />
<br />
Hello Friends,<br>
Here we will learn the black box testing test case design technique :- <br>
<b style = "color:blue">Decision Table Testing </b> :-<br>
1). Decision Table captures system requirements that contain logical conditions.<br>
2). The specification are analyzed, and conditions and actions of the system are identified in a tabular form.<br>
3). The input conditions and actions are most often stated in a way that they must be true or false.<br><br>
Decision table technique is one of the widely used case design techniques for black box testing. This is a systematic approach where various input combinations and their respective system behavior are captured in a tabular form.<br>
That's why it is also known as a cause-effect table. This technique is used to pick the test cases in a systematic manner; it saves the testing time and gives good coverage to the testing area of the software application.<br>
Decision table technique is appropriate for the functions that have a logical relationship between two and more than two inputs.<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirUi3q5ervuk7e1vnDBQgqixLfMtB5fl0X8lM7Vxox79Sm0hpgQqvq6WuJhNlELCDaC1CgKdSnW20vr3YlHozw0V4rSqVw1x42F-_npZ6ht-oTp9aQuG3laqTI8uD28Qqft6DN7OzmzBw/s1168/Decision+table.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="400" data-original-height="367" data-original-width="1168" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirUi3q5ervuk7e1vnDBQgqixLfMtB5fl0X8lM7Vxox79Sm0hpgQqvq6WuJhNlELCDaC1CgKdSnW20vr3YlHozw0V4rSqVw1x42F-_npZ6ht-oTp9aQuG3laqTI8uD28Qqft6DN7OzmzBw/s400/Decision+table.png"/></a></div>
<br><br>
<b style = "color:blue"> Decision Table Example : </b> <br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjo4lHgFP_Wux7ftKimOWlXgN397ddCfVQ2PvLUtBr4ZCHPbb0ZSqgAYW17ZlgZ7KNOWpHXbqKpIAqI0hEhr3ojRVjVN9Chvx3Ry0S1_6ccHk3aat6f6P0xxpGWOUG0tJ7zsbE0xixC6M/s608/Decision+table+example.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="400" data-original-height="146" data-original-width="608" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjo4lHgFP_Wux7ftKimOWlXgN397ddCfVQ2PvLUtBr4ZCHPbb0ZSqgAYW17ZlgZ7KNOWpHXbqKpIAqI0hEhr3ojRVjVN9Chvx3Ry0S1_6ccHk3aat6f6P0xxpGWOUG0tJ7zsbE0xixC6M/s400/Decision+table+example.png"/></a></div>
<br>
<b style = "color:blue">State Transition Diagram Testing technique </b> :-<br>
A state diagram – also known as state chart, state machine diagram or state transition diagram – visualises a sequence of states that an object can assume in its lifecycle. It is used to describe the behavior of a system, subsystem, component, or class.<br>
state-transition diagram (STD) A diagram that indicates the possible states of a finite-state automaton and the allowable transitions between such states. ... Each one depicts the states, transitions, and event(s) that can cause each transition.<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheSus2vyNCO_Wsq79e_COrBfALoqbcitCtjJSzb4XnTKAmHagumyV-QrY9Si-a9GXRf-nKJvMd0ojxlPqQysbZriBaoUz2-PHZkpvlPy8SEoR2k3J5ANPwYd6DdyO0aZobSj5Dk6GnmBo/s1088/State+transition+diagram.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="400" data-original-height="441" data-original-width="1088" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEheSus2vyNCO_Wsq79e_COrBfALoqbcitCtjJSzb4XnTKAmHagumyV-QrY9Si-a9GXRf-nKJvMd0ojxlPqQysbZriBaoUz2-PHZkpvlPy8SEoR2k3J5ANPwYd6DdyO0aZobSj5Dk6GnmBo/s400/State+transition+diagram.png"/></a></div>
<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh63LT7w4XYTQe9UYm1WhmwOookdq7B_Y1r2nGmQ7dPiGMftrsfowJ0S8SES5NrgtpJ-ZdHJkPtL7OGk1J-0T0lCsbM5Ucd_E_vNyhLAxO-4xUkNWrmCNgQKhjPJHTy2Gj9wLHd5DDa16I/s450/State+transition+diagram+2.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="400" data-original-height="350" data-original-width="450" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh63LT7w4XYTQe9UYm1WhmwOookdq7B_Y1r2nGmQ7dPiGMftrsfowJ0S8SES5NrgtpJ-ZdHJkPtL7OGk1J-0T0lCsbM5Ucd_E_vNyhLAxO-4xUkNWrmCNgQKhjPJHTy2Gj9wLHd5DDa16I/s400/State+transition+diagram+2.png"/></a></div>
<br><br>
<b style = "color:blue">Orthogonal Array Testing </b><br>
Orthogonal array testing is a systematic and statistical way of a black box testing technique used when number of inputs to the application under test is small but too complex for an exhaustive testing.
<br><br>
<b style = "color:blue">Orthogonal Array Testing Characteristics:</b><br>
1)OAT, is a systematic and statistical approach to pairwise interactions.<br>
2)Executing a well-defined and a precise test is likely to uncover most of the defects.<br>
3)100% Orthogonal Array Testing implies 100% pairwise testing.<br><br>
Consider a system which has three parameters {country; product; sales person} and each of them has three
values. To test all the possible combinations of these parameters (i.e. exhaustive testing) we will need
a set of 33 = 27 test cases. But instead of testing the system for each combination of parameters, we can
use an orthogonal array to select only a subset of these combinations. Using orthogonal array testing, we
can maximize the test coverage while minimizing the number of test cases to consider. We here assume that
the pair that maximizes interaction between the parameters will have more defects and that the technique works.<br><br>
Orthogonal array<br>
Test case ↓ Country Product Salesperson<br>
TC-1 DE Notebook Charlie<br>
TC-2 DE Desktop Bob <br>
TC-3 DE Mouse Alice<br>
TC-4 US Notebook Bob<br>
TC-5 US Desktop Alice<br>
TC-6 US Mouse Charlie<br>
TC-7 GB Notebook Alice<br>
TC-8 GB Desktop Charlie<br>
TC-9 GB Mouse Bob<br><br><br>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-15944152511261955632021-01-31T09:41:00.004-08:002021-01-31T10:14:19.638-08:00Various Software Development Model Waterfall Model V model etc<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br />
<br />
<br />
Hello friends <br>
In this Article we will learn that how many working software models are being used in IT industries also what all the drwabacks they have and why do have many Software Development models?? due to usage or need of business requirement we use different models:- <br>
<b>1). WaterFall Model :-</b> <b style = "color:blue">
The Waterfall Model was the first Process Model to be introduced. It is also referred to as a linear-sequential life cycle model. It is very simple to understand and use. In a waterfall model, each phase must be completed before the next phase can begin and there is no overlapping in the phases.<br><br>
The Waterfall model is the earliest SDLC approach that was used for software development.<br><br>
The waterfall Model illustrates the software development process in a linear sequential flow. This means that any phase in the development process begins only if the previous phase is complete. In this waterfall model, the phases do not overlap.<br><br>
Waterfall model is an example of a Sequential model. In this model, the software development activity is divided into different phases and each phase consists of a series of tasks and has different objectives.<br><br>
Waterfall model is the pioneer of the SDLC processes. In fact, it was the first model which was widely used in the software industry. <br><br>
</b>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq3e5SgfIMnKF5cq7dGh69XQAcVAtU6LrJ21crdflvWWMp8av9SPnVuc4gd3U2tnhQW7cEV3GjsN7R665Al3_ifOLvWCO1ZTsd9fBTAqcnfka0gENWquv85lNfjmBT_zSZckqr2D77CII/s559/waterfall_model_mobile.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="447" data-original-width="559" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq3e5SgfIMnKF5cq7dGh69XQAcVAtU6LrJ21crdflvWWMp8av9SPnVuc4gd3U2tnhQW7cEV3GjsN7R665Al3_ifOLvWCO1ZTsd9fBTAqcnfka0gENWquv85lNfjmBT_zSZckqr2D77CII/s600/waterfall_model_mobile.png"/></a></div>
<br><br>
<br>
<br>
<b> Prototype Model :- </b> <b style = "color:blue"> </b> <br><br>
Prototype model should be used when the desired system needs to have a lot of interaction with the end users. Typically, online systems, web interfaces have a very high amount of interaction with end users, are best suited for Prototype model.
<br>
Prototyping is defined as the process of developing a working replication of a product or system that has to be engineered. ... In this process model, the system is partially implemented before or during the analysis phase thereby giving the customers an opportunity to see the product early in the life cycle.<br>
This model is flexible in design.<br>
It is easy to detect errors.<br>
We can find missing functionality easily.<br>
There is scope of refinement, it means new requirements can be easily accommodated.<br>
It can be reused by the developer for more complicated projects in the future.
<br><br>
Incremental and Iterative Approach<br>
•In incremental development, the product is built through successive versions
that arerefined and expanded with each iteration– <br>
Three concepts underlie the incrementalapproach: <br>
•The Initialization Step<br>
•The Control List<br>
•The Iteration Step<br><br><br>
Throwaway Approach<br>
•In the incremental approach,<br>
–the initial prototype is revised and refinedrepeatedly until it becomes the final product.<br><br>
•In the throwaway approach,<br>
–the prototype is discarded after the stakeholdersin the development are confident that they havearrived at the correct specifications and thedevelopment on the “real” product can start.<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifrYnnw_qum9Um3MUxQnKsGSbovZXZZ4e1RLQSGPJWVKa34NEso40TzEFql_9U6kJmLVdt0zQ5TRSI8SMztaAPd3OA9NEWPoKCY4F0gpWGKAxodhmVO3te3gLzDOp3zfp0vfq72ms5EJ4/s1280/Prototype+Model.jpg" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="720" data-original-width="1280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifrYnnw_qum9Um3MUxQnKsGSbovZXZZ4e1RLQSGPJWVKa34NEso40TzEFql_9U6kJmLVdt0zQ5TRSI8SMztaAPd3OA9NEWPoKCY4F0gpWGKAxodhmVO3te3gLzDOp3zfp0vfq72ms5EJ4/s600/Prototype+Model.jpg"/></a></div>
<br><br>
<b> Incremental Model :- </b> <b style = "color:blue">
The incremental build model is a method of software development where the product is designed, implemented and tested incrementally until the product is finished. It involves both development and maintenance. The product is defined as finished when it satisfies all of its requirements.<br>
Incremental Model is a software development process where requirements are divided into several stand-alone software development modules. In this example, each module passes through the requirement, design, development, implementation, and testing phases.
</b> <br><br>
This model can be used when the requirements of the complete system are clearly defined and understood. Major requirements must be defined; however, some details can evolve with time. There is a need to get a product to the market early. A new technology is being used.<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkuMaYL_K6HAxcPUQlnILbZkGvzWnLcPt7zNhxbxkK8MFdyFX3jiaLrqos-b0-eKjINBqRC6AkmkY6YY7tOgAGp5SlrllFkwuRO6xw2aRHAs6ZSO1CpBExbFvKrhhizPOYaEQUhYdgQQs/s609/Incremental-Model.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="458" data-original-width="609" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkuMaYL_K6HAxcPUQlnILbZkGvzWnLcPt7zNhxbxkK8MFdyFX3jiaLrqos-b0-eKjINBqRC6AkmkY6YY7tOgAGp5SlrllFkwuRO6xw2aRHAs6ZSO1CpBExbFvKrhhizPOYaEQUhYdgQQs/s600/Incremental-Model.png"/></a></div>
<br><br>
<b>2). Spiral Model :- </b> <b style = "color:blue">
The spiral model combines the idea of iterative development with the systematic, controlled aspects of the waterfall model. This Spiral model is a combination of iterative development process model and sequential linear development model i.e. the waterfall model with a very high emphasis on risk analysis. It allows incremental releases of the product or incremental refinement through each iteration around the spiral.<br><br>
The spiral model is a risk-driven software development process model. Based on the unique risk patterns of a given project, the spiral model guides a team to adopt elements of one or more process models, such as incremental, waterfall, or evolutionary prototyping
</b><br>
<b>Spiral Model</b> - Design
The spiral model has four phases. A software project repeatedly passes through these phases in iterations called Spirals.<br>
<b>Identification</b><br>
This phase starts with gathering the business requirements in the baseline spiral. In the subsequent spirals as the product matures, identification of system requirements, subsystem requirements and unit requirements are all done in this phase.
This phase also includes understanding the system requirements by continuous communication between the customer and the system analyst. At the end of the spiral, the product is deployed in the identified market.<br><br>
<b>Design</b><br>
The Design phase starts with the conceptual design in the baseline spiral and involves architectural design, logical design of modules, physical product design and the final design in the subsequent spirals.<br><br>
<b>Construct or Build</b><br>
The Construct phase refers to production of the actual software product at every spiral. In the baseline spiral, when the product is just thought of and the design is being developed a POC (Proof of Concept) is developed in this phase to get customer feedback.
Then in the subsequent spirals with higher clarity on requirements and design details a working model of the software called build is produced with a version number. These builds are sent to the customer for feedback.<br><br>
<b>Evaluation and Risk Analysis</b><br>
Risk Analysis includes identifying, estimating and monitoring the technical feasibility and management risks, such as schedule slippage and cost overrun. After testing the build, at the end of first iteration, the customer evaluates the software and provides feedback.<br><br>
The following illustration is a representation of the Spiral Model, listing the activities in each phase.<br><br>
</b>. <br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia6b-BPCI6GwGB7yk-T1Q4xiJ9FYQBu_EI_gNt_L94gYG-lLPC-PoK-u4VLUC8pFCI-flnURzVmK8NLdbXbCo7TgHrFLzdj3lkJd6wtoHOTNr82HZlWX4oVoM_V6Ymwvl8bQGE3O0jA4A/s735/spiral_model.jpg" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="616" data-original-width="735" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia6b-BPCI6GwGB7yk-T1Q4xiJ9FYQBu_EI_gNt_L94gYG-lLPC-PoK-u4VLUC8pFCI-flnURzVmK8NLdbXbCo7TgHrFLzdj3lkJd6wtoHOTNr82HZlWX4oVoM_V6Ymwvl8bQGE3O0jA4A/s600/spiral_model.jpg"/></a></div>
<br><br>
<b>3). V Model :- </b> <b style = "color:blue">
In software development, the V-model represents a development process that may be considered an extension of the waterfall model, and is an example of the more general V-model. Instead of moving down in a linear way, the process steps are bent upwards after the coding phase, to form the typical V shape.<br>
V Model is a highly disciplined SDLC model in which there is a testing phase parallel to each development phase. The V model is an extension of the waterfall model in which testing is done on each stage parallel with development in a sequential way. It is known as the Validation or Verification Model.<br>
The V-model is a graphical representation of a systems development lifecycle. It is used to produce rigorous development lifecycle models and project management models.
<br>
<b> What is V & V Testing??</b> <br>
In software project management, software testing, and software engineering, verification and validation (V&V) is the process of checking that a software system meets specifications and that it fulfills its intended purpose. It may also be referred to as software quality control.
<br>
</b>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisgvUCan1BNQoodJsRBaKqzQo2sod_a3UmVa_D1C2CsLBXYk8W2MAymVGnetJElhU2j67o5J1ulAl0BBk5F5cMe_MGFtuSUiA646TboF-goHBki6hw7Rwc4HBx_WtBufLka0tGjdFMoHA/s500/v-model.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="400" data-original-width="500" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEisgvUCan1BNQoodJsRBaKqzQo2sod_a3UmVa_D1C2CsLBXYk8W2MAymVGnetJElhU2j67o5J1ulAl0BBk5F5cMe_MGFtuSUiA646TboF-goHBki6hw7Rwc4HBx_WtBufLka0tGjdFMoHA/s600/v-model.png"/></a></div>
<br><br>
<b>4). Agile Model :- </b> <b style = "color:blue">
Agile SDLC model is a combination of iterative and incremental process models with focus on process adaptability and customer satisfaction by rapid delivery of working software product. Agile Methods break the product into small incremental builds. These builds are provided in iterations.<br>
Agile modeling is a methodology for modeling and documenting software systems based on best practices. It is a collection of values and principles, that can be applied on an software development project. <br>
Well executed Agile software development methodology helps teams significantly improve the quality of their software at each release. Not only that, it allows teams to adapt to change quickly. The Agile process consists of short, time-boxed iterations known as sprints. Each sprint results in a working product.<br>
</b>
<b style = "color:green">
The 12 Agile Principles: What Are They and Do They Still Matter?
Early and Continuous Delivery of Valuable Software. ...<br>
Embrace Change. ...<br>
Frequent Delivery. ...<br>
Business and Developers Together. ...<br>
Motivated Individuals. ...<br>
Face-to-Face Conversation. ...<br>
Working Software. ...<br>
Technical Excellence.<br><br>
</b>
<br><br>
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJrRBTkxEZ9uJkXPUYUoEcCipq7LeBfzvj65hnojUpvW67zmgJ4JSUJ84YovHawGk46wuK6sne-6gsRa5TITa0BZfIRWxq4kK4JpHNSTPz4fjeKoxXOPV9Y4mUO1uC8-72dMi782luJjk/s572/agile-model.png" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" width="600" data-original-height="425" data-original-width="572" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJrRBTkxEZ9uJkXPUYUoEcCipq7LeBfzvj65hnojUpvW67zmgJ4JSUJ84YovHawGk46wuK6sne-6gsRa5TITa0BZfIRWxq4kK4JpHNSTPz4fjeKoxXOPV9Y4mUO1uC8-72dMi782luJjk/s600/agile-model.png"/></a></div>
<br><br>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-317647790719782402020-08-02T05:29:00.002-07:002020-08-02T05:29:48.722-07:00Introduction of Jmeter and Basic definitions<marquee><b style = "color:brown">Introduction of Java & Basic Definitions</b></marquee> <br><br>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br />
<br />
<br />
<b style = "color: blue">Introduction</b>
JMeter is the best open-source load testing tool to measure the performance of an application.<br><br>
jMeter is an Open Source testing software. It is 100% pure Java application for load and performance testing.<br><br>
jMeter is designed to cover various categories of tests such as load testing, functional testing, performance testing, regression testing, etc.,
and it requires JDK 6 or higher.<br><br>
<b style = "color: blue">Performance Testing :-</b><br>
In software quality assurance, performance testing is in general a testing practice performed to determine how a system performs in terms
of responsiveness and stability under a particular workload.<br><br>
<b style = "color: blue">Speed –</b> It Checks whether the response of the application is fast.<br><br>
<b style = "color: blue">Scalability –</b> It determines the maximum user load.<br><br>
<b style = "color: blue">Stability –</b> It checks if the application is stable under varying loads.<br><br>
<b style = "color: blue">Performance Testing Techniques:</b><br><br>
<b style = "color: green">Load testing - </b>It is the simplest form of testing conducted to understand the behavior of the system under a specific load. Load testing will result in measuring important business critical transactions and load on the database, application server, etc., are also monitored.
<br>
<b style = "color: green">Stress testing -</b> It is performed to find the upper limit capacity of the system and also to determine how the system performs if the current load goes well above the expected maximum.
<br>
<b style = "color: green">Soak testing - </b>Soak Testing also known as endurance testing, is performed to determine the system parameters under continuous expected load. During soak tests the parameters such as memory utilization is monitored to detect memory leaks or other performance issues. The main aim is to discover the system's performance under sustained use.
<br>
<b style = "color: green">Spike testing - </b>Spike testing is performed by increasing the number of users suddenly by a very large amount and measuring the performance of the system. The main aim is to determine whether the system will be able to sustain the workload.
<br><br>
Attributes of Performance Testing:<br><br>
Speed<br>
Scalability<br>
Stability<br>
reliability<br><br>
<b>Connection Time : </b> Time to connect to Server from client <br><br>
<b>Response Time : </b> Response time is a measure of how responsive an application or subsystem is to a client request. <br><br>
<b>Throughput : </b> Throughput indicates the number of transactions per second an application can handle, the amount of transactions
produced over time during a test. Requests per second, calls per dat, hits per second, report per year etc. <br><br>
<b>Scenarios : </b> Scenarios In the context of performance testing, a scenario is a sequence of steps in your application. A scenario can
represent a use case or a business function such as searching a product catalog, adding an item to a shopping cart, or placing an order. <br><br>
<b>Bottleneck:</b>Bottleneck used to describe a single part of a system that prevents further processing or significantly degrades
the performance of the system as a whole.<br><br>
<b>Capacity:</b>The degree to which a system can perform data processing until performance degrades. For example, the number of new
customers being added to a database.<br><br>
<b>Concurrency:</b> Normally this means the number of simultaneous virtual users driving transactions across the user journeys
in a given performance test scenario but can also mean the number of transactions synchronized to happen
at exactly the same point.<br><br>
<b>Key Performance Indicators(KPI):</b>The set of targets which set the expected performance targets within the production system.
These may include page response time(e.g. 99% of pages loaded <= 2 seconds), user concurrency, batch
processing times, data throughput volumes, transaction failure rates and underlying infrastructure behavior(e.g. Maximum average CPU used,
minimum free memory available, threshold for remaining physical storage/disk usage, logging space etc.)<br><br>
<b>Load Testing :-</b>A type of performance testing used to evaluate the behavior of a system or component when the load on
the system(via users and transaction) progressively increase up to and including peak levels.<br><br>
<b>Non-functional Requirements</b> NFRs requirements that do not relate to the functioning of the system but to other aspects of the
system such as reliability, usability and performance.<br><br>
<b>Performance Engineering:</b>Activities designed to ensure a system will be designed and implemented to meet specific non malfunction
requirements. Often takes place following completion of testing activities that highlight weaknesses in the design and
implementation.<br><br>
<b>Performance Test Plan:-</b>Typically a written document that details the objectives, scope, approach, deliverable, schedule,
risk, data and test environment needs for testing on a specific project.<br><br>
<b>Performance Testing:-</b>Testing designed to determine the performance level of a system.<br><br>
<b>Reliability :</b>Related to stability, reliability is the degree to which a system provides the same result for the same action
over time under load.<br><br>
<b>Scalability:</b>The degree a which a system's performance and capacity can be increased typically by increasing available
hardware resources with in a set of servers(vertical scaling) or increasing the number of servers available
to services request (horizontal scaling)<br><br>
<b>Soak Testing:</b>A type of performance testing used to evaluate the behavior of a system or component when the system is subjected to
expected load over a sustained period of time.<br><br>
<b>Spike Testing:</b> A type of performance testing used to evaluate the behavior of a system or component when subjected to
large short-term changes in demand. Normally this is to test how the system responds to large increases in demand, e.g.
User Logins, Black Friday-like scales events etc.<br><br>
<b>Stability:</b>The degree to which a system exhibits failures and errors when under normal usage. For example, erroneous errors
when registering new users under load.<br><br>
<b>Stress Testing:</b>A type of performance testing used to evaluate the behavior of a system or component when subjected to
load beyond the anticipated workload or by reducing the resources the system can use, such as CPU or memory.<br><br>
<b>Transaction Volume Model(TVM):</b>A document detailing the user journeys to be simulated, the click-path steps that make up the user
journeys and associated load/transaction volume models to be tested. This should include information regarding
the geographical locale from where users will be expected to interact with the system and the method of
interaction e.g. mobile vs desktop.<br><br>
<b>User Journey:</b> The path through the system under test that a group of virtual users will use to simulate real users.
It should be noted that key performance/volume impacting journeys should be used as it is impractical to performance test
all possible User journeys, a good rule-of-thumb is to use the 20% of user journeys that generate 80% of the volume.<br><br>
<b>Virtual User:</b>A simulated user that performs actions as a real user would during the execution of a test.<br><br>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-79427175264512499892020-05-28T14:55:00.002-07:002022-02-12T02:37:04.027-08:00How to Handle Tool Tip in selenium
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br />
<br />
<br />
Hello friends <br>
In this Article we will learn that how to handle the tooltip operation in selenium, so while automating your website you will get 2 kind of below scenarios :- <br>
<b>1). Tool tip in title tag :-</b> We will use <b style = "color:blue">getAttribute("title")</b> <br>
<br>
<b>2). Tool tip inside div or any other html tag :- </b> we will use here actions class. <br>
Here is the code for both
<div class = "code">
<p style = "backgroud-color : white">
<br>
import java.util.concurrent.TimeUnit;<br>
import org.openqa.selenium.By;<br>
import org.openqa.selenium.WebDriver;<br>
import org.openqa.selenium.WebElement;<br>
import org.openqa.selenium.chrome.ChromeDriver;<br>
import org.openqa.selenium.firefox.FirefoxDriver;<br>
import org.openqa.selenium.interactions.Actions;<br>
import org.testng.annotations.BeforeTest;<br>
import org.testng.annotations.Test;<br><br>
public class Tooltiptest {<br>
WebDriver driver;<br>
@BeforeTest<br>
public void g() throws InterruptedException<br>
{<br>
/*System.setProperty("webdriver.chrome.driver", "D:\\Selenium\\Complete selenium\\ChromeDriver\\83\\chromedriver.exe");<br>
System.setProperty("webdriver.chrome.silentOutput", "true");<br>
driver = new ChromeDriver();*/<br>
System.setProperty("webdriver.gecko.driver", "D:\\Selenium\\geckodriver\\new\\geckodriver.exe");<br>
System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE, "null");<br>
driver = new FirefoxDriver();<br>
driver.manage().window().maximize();<br>
driver.navigate().to("file:///D:/Selenium/Complete%20selenium/tooltip/tooltip.html");<br>
Thread.sleep(3000);<br>
}<br>
@Test<br>
public void gettootltip() throws InterruptedException<br>
{<br>
WebElement tootipelement = driver.findElement(By.className("tooltip"));<br>
Actions action = new Actions(driver);<br>
action.moveToElement(tootipelement).build().perform();<br>
String text = driver.findElement(By.className("tooltiptext")).getText();<br>
System.out.println(text);<br>
Thread.sleep(3000);<br>
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);<br>
WebElement element = driver.findElement(By.xpath("/html/body/form/input[1]"));<br>
String text2 = element.getAttribute("title");<br>
System.out.println(text2);<br>
}<br>
}<br>
</div>
<br>
</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-80045617725879416662020-04-22T11:36:00.010-07:002022-08-11T15:28:55.637-07:00Difference Between Collection and Collections<marquee><b style = "color:brown">Collection and collections in java</b></marquee>
<html>
<head>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- chandan Ads -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-6658533981545355"
data-ad-slot="9308698023"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</head>
<body>
<br><br>
<h2 style = "color : brown">Difference between Collection and Collections</h2>
Difference between Collection and Collections<br><br>
<b>1).</b> Collection is a root level Interface in Java Collection Framework or collection hierarchy.
The Set, List and Queue are the some of the subInterfaces of Collection interface.<br><br>
The important methods of Collection interface are add(), remove(), size(), clear() etc.<br><br>
Collections is a utility class in java.util package which contains only static methods that operate on objects of type collection.<br><br>
Collections class contains only static methods like sort(), min(), fill(), copy(), reverse() etc.<br><br>
<b>2).</b> Before Java 8, interface was not allowed to contain static methods. collection is an Interface & interface can contain static
methods since java 8 and Interface can also contain abstract methods and default methods.<br><br>
But collections class contains only static methods.<br><br><br><br>
<b>3).</b> Collection interface extends iterable interface<br><br>
public interface Collections<E> extends Iterable<E><br><br>
and Collections class extends Object class<br><br>
public class Collections extends Object<br><br><br><br>
<h2 style = "color : brown">Similarities between Collection and Collections in Java </h2><br><br>
<b>1).</b> Both are part of the Java Collections Framework. <br><br>
<b>2).</b> Both are present in java.util package<br><br>
<b>3).</b> Both are added to jdk in java version 1.2<br><br>
<br><br><br><br>
<h2 Style = "color :blue">Example of Collections</h2>
<p style = "background-color:white">
<div class = "code">
import java.io.*; <br>
import java.util.ArrayList;<br>
import java.util.*;<br><br>
public class ConsTest <br>
{<br>
public static void main(String args[]) throws IOException <br>
{<br>
ArrayList<span><</span>Integer<span>></span> alist = new ArrayList<span><</span>Integer<span>></span>();<br>
alist.add(10);<br>
alist.add(20);<br>
alist.add(5);<br>
alist.add(35);<br>
alist.add(45);<br>
System.out.println("maximum value" + " " + Collections.max(alist));<br>
System.out.println("maximum value" + " " + Collections.min(alist));<br>
ArrayList<span><</span>String<span>></span> list = new ArrayList<span><</span>String<span>></span>();<br>
list.add("Chandan");<br>
list.add("Chauhan");<br>
list.add("Cha");<br>
Collections.sort(list);<br>
System.out.println("Sorted Strings" + " " + list);<br>
Collections.sort(list, Collections.reverseOrder());<br>
System.out.println("Reversed Strings" + " " + list);<br>
ArrayList<span><</span>String<span>></span> slist = new ArrayList<span><</span>String<span>></span>(3);<br>
slist.add("Chandan");<br>
slist.add("Chauhan");<br>
slist.add("Cha");<br>
ArrayList<span><</span>String<span>></span> dlist = new ArrayList<span><</span>String<span>></span>(3);<br>
dlist.add("a");<br>
dlist.add("b");<br>
dlist.add("c");<br>
Collections.copy(dlist, slist);<br>
System.out.println(dlist);<br>
Collections.fill(dlist, "way2testing");<br>
System.out.println(dlist);<br>
}<br>
}<br><br>
</div>
<h2>Output :-</h2>
<p>
maximum value 45 <br>
maximum value 5 <br>
Sorted Strings [Cha, Chandan, Chauhan] <br>
Reversed Strings [Chauhan, Chandan, Cha] <br>
[Chandan, Chauhan, Cha] <br>
[way2testing, way2testing, way2testing] <br>
</p>
<br><br>
<b style = "color:red">Collections in java:-</b> <br>
Any group of individual objects which are represented <br>
as a single unit know as collection of objects.<br>
Collection in java is a framework that provides an
architecture to store and manipuate the group of objects.<br>
Java collections can achieve all the operations that you
perform on data like searching, sorting, insertion,
manipuation etc.<br>
"A collection represents a single unit of objects i.e. a group".<br>
The collection interface (java.utill.Collection) and Map interface
(java.util.Map) are two main "root" interface of java collection classes.<br><br>
<b>What is Framework :-</b><br>
A framework is a set of classes and interfaces which provide a
ready-made architecture.<br><br>
<b>List Inerface:-</b><br>
It contains the index based methods to insert, update, delete and search the element.<br>
It can have duplicate elements.<br>
It can have null elements.<br><br>
<b>ArrayList :-</b><br>
> ArrayList class implements the List Interface.<br>
> It uses a dynamic array to store element<br>
> It can store duplicate elements<br>
> Arralist class maintain the insertion order and is non-synchronized.<br><br>
<b>Example :-</b><br>
<div class = "code">
package com.test.practice;<br>
import java.util.ArrayList;<br>
import java.util.Collections;<br>
import java.util.Iterator;<br>
import java.util.LinkedList;<br>
import java.util.List;<br><br>
public class Oopstutorial <br>
{<br>
public static void main(String[] args)<br>
{ <br>
ArrayList<span><</span>Integer<span>></span> al= new ArrayList<span><</span>Integer<span>></span>();<br>
List<span><</span><span>></span> al2= new LinkedList<span><</span>Integer<span>></span>();<br>
al.add(20);<br>
al.add(200);<br>
al.add(40);<br>
al.add(90);<br>
al.add(15);<br>
System.out.println("2nd position object " + al.get(1));<br>
System.out.println("Array list" + al);<br>
System.out.println("Maximum num is " + Collections.max(al));<br>
al2.add(20);<br>
al2.add(20);<br>
al2.add(400);<br>
al2.add(90);<br>
al2.add(15);<br>
System.out.println("linked list" + al2);<br>
System.out.println("Maximum num is " + Collections.max(al2));<br>
System.out.println("Minimum num is " + Collections.min(al));<br>
ArrayList<span><</span>String<span>></span>sl = new ArrayList<span><</span>String<span>></span>();<br>
sl.add("chandan");<br>
sl.add("adhiraj");<br>
sl.add("singh");<br>
Collections.sort(sl);<br>
System.out.println("sorted list is " + sl);<br>
Collections.reverse(sl);<br>
System.out.println("reversed list is " + sl);<br>
Iterator<span><</span>String<span>></span> it = sl.iterator();<br>
while(it.hasNext())<br>
{<br>
System.out.println(it.next());<br>
}<br>
}<br>
}
</div>
<br><br>
<b>Set Interface:-</b><br>
Set Interface in java is present in java.util package <br>
it extends the collection interface
does not allow to store duplicate elements
we can store at most one null value in set. <br><br>
<b>HashSet:-</b> <br>
Hashset class implements the Set Interface.<br>
It represents the collection that uses a hash table for storage.
It contains unique Items.<br><br>
<div class = "code">
import java.util.Set;<br>
import java.util.TreeSet;<br>
public class Oopstutorial <br>
{<br>
public static void main(String[] args)<br>
{ <br>
Set<span><</span>String<span>></span> s = new HashSet<span><</span>String<span>></span>();<br>
Set<span><</span>String<span>></span>ts = new TreeSet<span><</span>String<span>></span>();<br>
s.add("chandan");<br>
s.add("adhiraj");<br>
s.add("chandan");<br>
s.add("chauhan");<br>
System.out.println("Set elements are " +s);<br>
ts.add("chandan");<br>
ts.add("adhiraj");<br>
ts.add("chandan");<br>
ts.add("chauhan");<br>
System.out.println("Treeset elements are" +ts); //Elements in treeset stored in ascending order
<br>
}<br>
}<br><br>
</div>
<b style = "color:red">Map Interface :-</b> <br>
hashMap is a Map based collection class that is used for storing Key & Value(associated with keys).<br>
1).It is donated as HashMap.<br>
2).Hashmap contains only unique elements.<br>
3).Hashmap may have only one null key and multiple null values<br>
4). Hashmap maintains no order.<br><br>
<b>Example:-</b><br>
<div class = "code">
import java.util.HashMap;<br>
import java.util.Map;<br>
import java.util.Set;<br>
public class Oopstutorial <br>
{<br>
public static void main(String[] args)<br>
{ <br>
Map<span><</span> String, Integer <span>></span> record = new HashMap<span><</span> String, Integer <span>></span>();<br>
record.put("chandan", 30);<br>
record.put("baji", 29);<br>
record.put("adhiraj", 31);<br>
System.out.println(record.get("chandan"));<br>
Set<span><</span>String<span>></span> k = record.keySet();<br>
for(String i : k)<br>
{<br>
System.out.println(i+ " "+record.get(i));<br>
}<br>
}<br>
}<br>
<br>
<b>Output:-</b> <br>
baji 29<br>
chandan 30<br>
adhiraj 31<br>
</div>
#Collection
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-58660737085726301912020-04-10T14:32:00.003-07:002020-04-22T11:40:08.118-07:00Static and Dynamic Testing<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br />
<br />
<br />
<center>
<iframe width="560" height="315" src="https://www.youtube.com/embed/cWBhnv4M1gg" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</center>
<br><br>
<html>
<body>
<center><b style = "color:blue">Topics </b> <br><br></center>
:- QA Vs QC <br><br>
:- Verification V/s Validation <br><br>
:- Static V/s Dynamic Testing<br><br>
:- Review, Walkthrough & Inspection<br><br><br><br><br><br>
<center> <b style = "color:blue"> QA V/s QC </b></center> <br><br>
:-QA is process related QC is the actual testing of the software<br><br>
:-QA focuses on building in quality QC focuses on testing for quality<br><br>
:-QA is preventing defects QC is detecting defects<br><br>
:-QA is process Oriented QC is product Oriented.<br><br>
:-QA is for entire life Cycle QC is for testing part in SDLC<br><br>
:-QA focuses on building quality QC focuses on testing for quality and hence detecting defects<br><br>
and hence preventing defects<br><br>
:-Quality Assurance makes sure Quality control makes sure the results of what you done
you are doing the right things, are what you expected.<br><br>
the right way.
fit for purpose & right first time to achieve Reliability, maintainability & safety<br><br><br><br>
<center> <b style = "color:blue"> Verification V/s Validation </b></center> <br><br><br><br>
<p style = "background-color:white">
<b>Verification</b> checks whether we are building the <b>right system</b> <br><br>
<b style = "color:brown"> Verification is a process of finding out the product being developed the right way? </b><br><br>
Verification typically involves <br><br>
:-Review <br><br>
:-Walkthroughs <br><br>
:-Inspections <br><br>
:- Buddy Check <br><br>
<b>Validation </b> checks whether we are building the <b>System Right</b> <br><br>
<b style = "color:brown">Validation is a process of finding out if the product being developed is right? </b><br><br>
-- Generally Takes place after verification are completed <br><br>
-- Validation typically involves actual Testing Like System Testing. <br><br><br><br>
</p>
<b>Reviews </b>:- <p style = "background-color:white"> Conducts on documents to ensure correctness and completeness.<br><br>
Examples :-<br><br>
:- :- Requirement Reviews <br><br>
:- :- Design Reviews<br><br>
:- :- Code Reviews <br><br>
:- :- Test Plan Reviews<br><br>
:- :- Test Cases Reviews etc.</p><br><br><br><br>
<b>Phases of Review</b> :-<br><br><p style = "background-color:white">
:- :- Planning<br><br>
:- :- Kick-off<br><br>
:- :- Preparartion<br><br>
:- :- Review Meeting<br><br>
:- :- Rework<br><br>
:- :- follow up</p><br><br>
<br><br>
<b>Walkthroughs :-</b><br><br><p style = "background-color:white">
:- :- It is a formal review and we can discuss/raise the issue at peer level.<br><br>
:- :- Also walthrough does not have minutes of the meeting/meet. It can happen at any time and conduct just like that no schedule as such.<br></p><br><br><br>
<b>Inspections</b> :-<br><br><p style = "background-color:white">
:- :- It is a formal approach to the requirements schedule.<br><br>
:- :- At lest 3-6 people will sit in the meeting 1-reader 2- writer 3- moderator plus concerned.<br><br>
:- :- Inspection will have a proper schedule which will be intimated via email to the concerned developer/Tester.</p><br><br><br><br>
<b>Buddy Check </b>:-<br><br><p style = "background-color:white">
One person goes through the documents prepared by another person in order to find out if that person has made mistakes i.e. to
find out bugs which the author couldn't find previously.</p><br><br><br><br>
<b style = "color:blue">Static V/s Dynamic Testing</b><br><br><br><br>
:- Static testing is an approach to test project documents in the form of<br><br>
<p style = "background-color:white">
:- :- Reviews<br><br>
:- :- Walkthroughs<br><br>
:- :- Inspections</p><br><br><br><br>
<p style = "background-color:white">
Dynamic Testing is an approach to the actual Software by giving inputs & performing operation and observing results.</p><br><br><br><br>
</body>
</html>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-34443198166623873282020-04-01T13:40:00.001-07:002020-08-02T05:28:20.237-07:00Drag and Drop Test
<br><br><br><br><br>
<!DOCTYPE HTML>
<html>
<head>
<style>
#div1, #div2 {
float: left;
width: 100px;
height: 35px;
margin: 10px;
padding: 10px;
border: 1px solid black;
}
</style>
<script>
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>
<h2>Drag and Drop</h2>
<p>Drag the image back and forth between the two div elements.</p>
<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)">
<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU3Ta0lqrwB_WbXgv15hDEzj78tggOh8wsl5JyBYsH1XDByoFwF_vf02p3XUW0ATSa0tlcTvxmbuSLh5J2lSSeayaB0pEZIw9rhAarO0wA0Ny3EVWXt16_d5QQX9Emc-AIeIVPSHmQosE/s320/w2t.jpg" draggable="true" ondragstart="drag(event)" id="drag1" width="88" height="31">
</div>
<div id="div2" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
</body>
</html>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-12122654831005794662020-01-10T07:45:00.001-08:002020-04-01T13:38:56.754-07:00Path Practice Page<html>
<head>
<style>
ul {
border: 0px solid #555;
padding: 40px;
}
li {
float: left;
}
a {
display: block;
padding: 40px;
background-color: #dddddd;
}
</style>
</head>
<body>
<div class = "mydiv">
<ul class = "cscs">
<li id = "csc1"><a href = "http://www.way2testing.com" target = "_blank">Way2Testing</a></li>
<li id = "csc2"><a href = "http://www.datashop.in" target = "_blank">DataStop</a></li>
<li id = "csc3"><a href = "http://www.way2testing.com" target = "_blank">Way2Testing_1</a></li>
</li>
<li id = "csc4"><a href = "http://www.way2testing.com" target = "_blank">Way2Testing_2</a></li>
</li>
</ul>
<ul class = "cscs2">
<li id = "csc7"><a href = "http://www.way2testing.com" target = "_blank">Way2Testing</a></li>
<li id = "csc8"><a href = "http://www.datashop.in" target = "_blank">DataStop</a></li>
<li id = "csc9"><a href = "http://www.way2testing.com" target = "_blank">Way2Testing_1</a></li>
</li>
<li id = "csc10"><a href = "http://www.way2testing.com" target = "_blank">Way2Testing_2</a></li>
</li>
</ul></div>
</body>
</html><br><br>
<div>
<html>
<head>
<script>
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>
<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<img id="drag1" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3QLuWgWm9y_AI5eh8OtkwUP_Ed_5czmAmFkBrq3t07r55LJZEyLGR_854nAzsDLWkCv5VNIH6h6T0DXlsyVYqChqeOsGSDSUIlJoEJm06EE0Dm4yHpGtoTL05HCfp-cfpRT40j1Od_sg/s400/way2testing.png" draggable="true" ondragstart="drag(event)" width="336" height="69">
</body>
</html></div>
<br><br>
<html>
<head>
<style type = "text/css">
#boxA, #boxB {
float:left;padding:10px;margin:10px; -moz-user-select:none;
}
#boxA { background-color: #6633FF; width:75px; height:75px; }
#boxB { background-color: #FF6699; width:150px; height:150px; }
</style>
<script type = "text/javascript">
function dragStart(ev) {
ev.dataTransfer.effectAllowed = 'move';
ev.dataTransfer.setData("Text", ev.target.getAttribute('id'));
ev.dataTransfer.setDragImage(ev.target,0,0);
return true;
}
</script>
</head>
<body>
<center>
<h2>Drag and drop HTML5 demo</h2>
<div>Try to drag the purple box around.</div>
<div id = "boxA" draggable = "true"
ondragstart = "return dragStart(ev)">
<p>Drag Me</p>
</div>
<div id = "boxB">Dustbin</div>
</center>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<style>
#div1 {
width: 350px;
height: 70px;
padding: 10px;
border: 1px solid #aaaaaa;
}
</style>
<script>
function allowDrop(ev) {
ev.preventDefault();
}
function drag(ev) {
ev.dataTransfer.setData("text", ev.target.id);
}
function drop(ev) {
ev.preventDefault();
var data = ev.dataTransfer.getData("text");
ev.target.appendChild(document.getElementById(data));
}
</script>
</head>
<body>
<p>Drag the way2test image into the rectangle:</p>
<div id="div1" ondrop="drop(event)" ondragover="allowDrop(event)"></div>
<br>
<img id="drag1" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjU3Ta0lqrwB_WbXgv15hDEzj78tggOh8wsl5JyBYsH1XDByoFwF_vf02p3XUW0ATSa0tlcTvxmbuSLh5J2lSSeayaB0pEZIw9rhAarO0wA0Ny3EVWXt16_d5QQX9Emc-AIeIVPSHmQosE/s320/w2t.jpg" draggable="true" ondragstart="drag(event)" width="336" height="69">
</body>
</html>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-1908391346376655539.post-15444455992529453522019-10-17T10:32:00.005-07:002022-02-12T02:38:20.642-08:00Wrapper class in Java<marquee><b style = "color:brown">Wrapper in java</b></marquee> <br><br>
<html><head>
<script async="" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6658533981545355" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="4710877884" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></head><body></body></html>
<br><br>
<html>
<body>
<head>
<style>
.form_caja {
width: 500px;
padding-top: 8px;
padding-bottom: 15px;
margin: 0 auto 20px auto;
background: lightgreen;
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
color: #446bb3;
}
</style>
</head>
<h3>Wrapper Class In java</h3> <br>
<br><br>
<iframe width="1024" height="576" src="https://www.youtube.com/embed/9hsqmcOePWA" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<br><br>
Wrapper Class In Java <br>
before this , there is a question <br>
<b>Question :-</b> Java is 100% Object Oriented Programing Language or not?<br>
<b style = "color : blue">Answer :- </b>Java is 99.9 % object Oriented Programming Language<br>
It is not 100% Object Oriented Programing language , due to its primitive data Types :-<br>
int, float , char, double etc..<br>
These are derived from C and these are not objects<br>
and 100% object oriented means that every thing should be in form of object.<br>
and primitive data types are not object<br>
<b>for example :-</b><br>
int data;<br>
here data is not an object, it's a variable.<br><br>
So in java , we have classes for every data types, we call the as wrapper classes,<br><br>
Table for primitive data type and wrapper classes<br><br>
<div class="form_caja">
<table style = "border : 5px"><tbody>
<tr><td><b style = "color:blue">Primitive Type</b></td><td><b style = "color:blue">Wrapper Class</b></td></tr>
<tr><td>boolean</td><td>BOOLEAN</td></tr>
<tr><td>char</td><td>Character</td></tr>
<tr><td>byte</td>><td>Byte</td></tr>
<tr><td>short</td><td>Short</td></tr>
<tr><td>int</td><td>Integer</td></tr>
<tr><td>long</td><td>Long</td></tr>
<tr><td>float</td><td>Float</td></tr>
<tr><td>double</td><td>Double</td></tr>
</tbody></table></div>
for example for <b>int</b>, we have class <b>Integer</b> <br>
primitive int variable <br>
int x = 20;<br>
not if i want to convert this varibale into an object, then i have to write<br>
Integer i = new Interger(x); OR Integer i = new Interger(20);<br>
now i is 20;<br>
This way of converting primitive into object is called as <b>AutoBoxing</b><br><br>
Now, how to take out value from Integer Object<br>
Interger i = new Integer(20);<br>
direct value can't be assigned to object so we need to use a method <b>datatypeValue</b><br>
int j = i.intValue();<br>
now j = 10;<br>
So getting the priitive value from object is called as <b>Unboxing</b><br>
public class Wrappractice<br>
{<br>
public static void main(String args[])<br>
{<br>
int i = 20;<br>
Interger mydata = new Integer(i); //Autoboxing<br>
System.out.println("value of i is " + i);<br>
int j;<br>
j = mydata.intValue();<br>
System.out.println( "value od j is " +j); //Unboxing<br>
}<br>
}<br>
</body>
</html>
--------------------------------------------------------<br><br>
<b><h3>Wrapper class are Immutable in Java<h3></b><br>
<p style = "color:blue">
All primitive wrapper classes (Integer, Byte, Long, Float, Double, Character, Boolean and Short) are immutable in Java, so operations like addition and subtraction create a new object and not modify the old.<br><br>
</p>
<br>
<H2>Example to prove that wrapper classes are Immutable </h2>
<div class = "code">
<div style = "background-color:white">
public class Wrap<br>
{<br>
public static void main(String[] args)<br>
{<br>
Integer x = new Integer(20);<br>
System.out.println("before modification value of x is :" +x);<br>
add(x);<br>
System.out.println("After modification value of x is :" +x);<br>
}<br>
public static void add(int x)<br>
{<br>
x = x+1;<br>
System.out.println(x);<br>
}<br>
}</div><br><br>
</div>
<h3>Output :- </h3> <br>
before modification value of x is :20<br>
21 <br>
After modification value of x is :20<br><br>
<b>Note : </b> String isn't a primitive type.Unknownnoreply@blogger.com0