<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sree Lasya Vallabhaneni</title>
    <description>The latest articles on DEV Community by Sree Lasya Vallabhaneni (@vsreelasya).</description>
    <link>https://dev.to/vsreelasya</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F200513%2F0e2a43c0-af9c-4c6e-9f2c-87a24287020c.jpeg</url>
      <title>DEV Community: Sree Lasya Vallabhaneni</title>
      <link>https://dev.to/vsreelasya</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/vsreelasya"/>
    <language>en</language>
    <item>
      <title>Estimation</title>
      <dc:creator>Sree Lasya Vallabhaneni</dc:creator>
      <pubDate>Thu, 27 Feb 2020 02:57:17 +0000</pubDate>
      <link>https://dev.to/vsreelasya/estimation-2d8e</link>
      <guid>https://dev.to/vsreelasya/estimation-2d8e</guid>
      <description>&lt;p&gt;How do you estimate on a project or a task that you have never worked on before or have no idea what it takes to complete it? &lt;br&gt;
I have some hard times where I underestimate the time and effort to finish a project and come under pressure that I am not completing it within the time I have committed to.&lt;/p&gt;

</description>
      <category>devlive</category>
      <category>estimation</category>
      <category>devops</category>
    </item>
    <item>
      <title>Looping in Puppet </title>
      <dc:creator>Sree Lasya Vallabhaneni</dc:creator>
      <pubDate>Tue, 20 Aug 2019 21:35:52 +0000</pubDate>
      <link>https://dev.to/vsreelasya/looping-in-puppet-1a8c</link>
      <guid>https://dev.to/vsreelasya/looping-in-puppet-1a8c</guid>
      <description>&lt;p&gt;A simple example of how to loop an array of hash maps in a puppet manifest to template&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    targets =&amp;gt; [
      {
        host =&amp;gt; 'example.com',
        port =&amp;gt; '443',
      },
      {
        host =&amp;gt; 'example1.com',
        port =&amp;gt; '8081',
      },
      {
        host =&amp;gt; 'example2.com',
        port =&amp;gt; '80',
      },
    ]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This part is for looping in the erb template.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;% @targets.each do |variable | -%&amp;gt;
    &amp;lt;%= variable['host'] %&amp;gt; &amp;lt;%= variable['port'] %&amp;gt; 
  &amp;lt;% end -%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;targets&lt;/strong&gt; is the array of list and &lt;strong&gt;variable&lt;/strong&gt; is the name of the varible you would like to specify &lt;/p&gt;

</description>
      <category>devops</category>
      <category>puppet</category>
      <category>ruby</category>
    </item>
    <item>
      <title>A handy selenium selector syntax in different languages </title>
      <dc:creator>Sree Lasya Vallabhaneni</dc:creator>
      <pubDate>Fri, 16 Aug 2019 00:18:52 +0000</pubDate>
      <link>https://dev.to/vsreelasya/a-handy-selenium-selector-syntax-in-different-languages-o90</link>
      <guid>https://dev.to/vsreelasya/a-handy-selenium-selector-syntax-in-different-languages-o90</guid>
      <description>&lt;p&gt;&lt;strong&gt;Java&lt;/strong&gt;:&lt;br&gt;
driver.get('&lt;a href="http://google.com'"&gt;http://google.com'&lt;/a&gt;)&lt;br&gt;
&lt;em&gt;ID&lt;/em&gt;      - driver.findElement(By.id("ui-div"));&lt;br&gt;
&lt;em&gt;CSS&lt;/em&gt;     - driver.findElement(By.cssSelector("text-t"));&lt;br&gt;
&lt;em&gt;Xpath&lt;/em&gt;   - driver.findElement(By.xpath("//div[&lt;a class="comment-mentioned-user" href="https://dev.to/id"&gt;@id&lt;/a&gt;
='ui-div']"));&lt;br&gt;
&lt;em&gt;Name&lt;/em&gt;    - driver.findElement(By.name("element name"));&lt;br&gt;
&lt;em&gt;Link&lt;/em&gt;    - driver.findElement(By.link("link"))&lt;br&gt;
&lt;em&gt;TagName&lt;/em&gt; - driver.findElement(By.tagName("tag name"))&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt;:&lt;br&gt;
driver.get('&lt;a href="http://google.com'"&gt;http://google.com'&lt;/a&gt;)&lt;br&gt;
&lt;em&gt;ID&lt;/em&gt;      - driver.find_element_by_id("idname")&lt;br&gt;
&lt;em&gt;CSS&lt;/em&gt;     - driver.find_element_by_css_selector('body &amp;gt; div &amp;gt; button')&lt;br&gt;
&lt;em&gt;Xpath&lt;/em&gt;   - driver.find_element_by_xpath('body/name')&lt;br&gt;
&lt;em&gt;Name&lt;/em&gt;    - driver.find_element_by_name('username')&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;:&lt;br&gt;
driver.get('&lt;a href="http://google.com'"&gt;http://google.com'&lt;/a&gt;)&lt;br&gt;
&lt;em&gt;ID&lt;/em&gt;      - driver.findElement(webdriver.By.id("password"));&lt;br&gt;
&lt;em&gt;CSS&lt;/em&gt;     - driver.findElement(webdriver.By.css('body &amp;gt; div &amp;gt; div));&lt;br&gt;
&lt;em&gt;Xpath&lt;/em&gt;   - driver.findElement(webdriver.By.xpath('body/name'));&lt;br&gt;
&lt;em&gt;Name&lt;/em&gt;    - driver.findElement(webdriver.By.name('q'));&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;c#&lt;/strong&gt;&lt;br&gt;
driver.Navigate().GoToUrl("&lt;a href="http://www.google.com%22"&gt;http://www.google.com"&lt;/a&gt;);&lt;br&gt;
&lt;em&gt;ID&lt;/em&gt;      - driver.FindElementById("droppable");&lt;br&gt;
&lt;em&gt;CSS&lt;/em&gt;     - driver.FindElementByXPath("//[&lt;a class="comment-mentioned-user" href="https://dev.to/id"&gt;@id&lt;/a&gt;
=\"droppable\"]/p")&lt;br&gt;
&lt;em&gt;Xpath&lt;/em&gt;   - driver.FindElementByCssSelector("div.form-actions &amp;gt; button")&lt;br&gt;
&lt;em&gt;Name&lt;/em&gt;    - driver.FindElementByName("password")&lt;/p&gt;

</description>
      <category>testing</category>
      <category>selenium</category>
    </item>
    <item>
      <title>Java Selenium Utilities that you can reuse </title>
      <dc:creator>Sree Lasya Vallabhaneni</dc:creator>
      <pubDate>Fri, 16 Aug 2019 00:04:07 +0000</pubDate>
      <link>https://dev.to/vsreelasya/java-selenium-utilities-that-you-can-reuse-250c</link>
      <guid>https://dev.to/vsreelasya/java-selenium-utilities-that-you-can-reuse-250c</guid>
      <description>&lt;p&gt;--Selenium Helper classes&lt;br&gt;
--SeleniumUtilities.java&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;package test.java.SeleniumUtilities;
import java.net.MalformedURLException;
import java.net.URL;
import org.json.JSONObject;
import org.openqa.selenium.*;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;

public class SeleniumUtilities {
    private WebDriver driver;

/**
 * Created by SreeLasya.Vallabhanenion.
 */ 

    public SeleniumUtilities(WebDriver driver) {
        this.driver = driver;
    }


    /**
     * Wait for an element to be displayed in the DOM
     *
     * @param elementLocator - CSS of the element
     * @return - WebElement
     */

    public WebElement waitForElement(String elementLocator) {
        WebElement webElement = null;
        int timeout = 20; //in seconds
        WebDriverWait wait = new WebDriverWait(driver, timeout);
        try {
            System.out.println(elementLocator);
            webElement = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(elementLocator)));
        } catch (WebDriverException e) {
            //do nothing, don't want to log this
        }

        if (webElement == null) {
            assertFalse(true, "WebElement not found within " + timeout + " seconds. Failing test!" + " of element: " + elementLocator + "\nCurrent page: " + driver.getCurrentUrl());
        }
        return webElement;
    }


    public WebElement waitForElementPrescence(String elementLocator) {
        WebElement webElement = null;
        int timeout = 10; //in seconds
        WebDriverWait wait = new WebDriverWait(driver, timeout);
        try {
            System.out.println(elementLocator);
            webElement  = wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(elementLocator)));

        } catch (WebDriverException e) {
            //do nothing, don't want to log this
        }

        //if element wasn't found -&amp;gt; fail test
        if (webElement == null) {
            assertFalse(true, "WebElement not found within " + timeout + " seconds. Failing test!" + " of element: " + elementLocator + "\nCurrent page: " + driver.getCurrentUrl());
        }
        return webElement;
    }

    public void postUrl(String elementLocatorUrl) {
        try{
            driver.get(elementLocatorUrl);
        } catch (WebDriverException e) {
            System.out.println("Cannot get the requested url" + elementLocatorUrl);
        }
    }

    public void click(String elementLocator) {

        WebElement webElement = waitForElement(elementLocator);
        try {
        webElement.click();
        } catch(Exception ex) {

        }
    }

    public void enterText(String elementLocator, String text) {
        System.out.println(text);
        System.out.println(elementLocator);
        WebElement webElement = waitForElement(elementLocator);
        webElement.clear();
        webElement.sendKeys(text);
    }

    /**
     * Method to wait for page to update following an action that changes the pages state.
     * This is needed to avoid any race conditions between page updates and Selenium, which can sometimes occur.
     */

    public void waitForPageLoad() {
        try {
            Thread.sleep(250);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    public void refreshPage() {

        String currentURL = getCurrentURL();
        driver.navigate().to(currentURL);
    }

    public String getCurrentURL() {
        return driver.getCurrentUrl();
    }

    public String getElementText(String elementLocator) {

        WebElement webElement = waitForElement(elementLocator);
        return webElement.getText();
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>java</category>
      <category>selenium</category>
      <category>testing</category>
    </item>
    <item>
      <title>How to move items in terraform state without force replacement</title>
      <dc:creator>Sree Lasya Vallabhaneni</dc:creator>
      <pubDate>Thu, 15 Aug 2019 23:33:39 +0000</pubDate>
      <link>https://dev.to/vsreelasya/how-to-do-move-items-in-terraform-state-without-force-replacement-9e6</link>
      <guid>https://dev.to/vsreelasya/how-to-do-move-items-in-terraform-state-without-force-replacement-9e6</guid>
      <description>&lt;p&gt;I have started working on terraform very recently, One of the biggest annoying factors was when you have to change the terraform state without a forced replacement of the resource.&lt;/p&gt;

&lt;p&gt;Terraform remembers a state which is nothing but how the infrastructure looks in the remote real world and in the local configuration. &lt;br&gt;
So when you change a few attributes in the resource like name of the resource, instances, modules which are already created, in the plan it specifies that as not an in-place change&lt;/p&gt;

&lt;p&gt;Thankfully there is a command that my colleague has mentioned is "mv"&lt;/p&gt;

&lt;p&gt;This command is nothing but like a Linux mv command.&lt;/p&gt;

&lt;p&gt;You need to specify source and destination:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;terraform state mv  aws_subnet.main aws_subnet-us-west-2c&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This will move the existing terraform state to an updated terraform state and when you run a terraform plan, you should not see any infrastructure changes if done correctly.&lt;/p&gt;

&lt;p&gt;For more information, you can refer: &lt;a href="https://www.terraform.io/docs/commands/state/mv.html"&gt;https://www.terraform.io/docs/commands/state/mv.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>aws</category>
      <category>devops</category>
    </item>
    <item>
      <title>Add aws credentials in terraform</title>
      <dc:creator>Sree Lasya Vallabhaneni</dc:creator>
      <pubDate>Thu, 15 Aug 2019 00:41:12 +0000</pubDate>
      <link>https://dev.to/vsreelasya/add-aws-credentials-in-terraform-2mod</link>
      <guid>https://dev.to/vsreelasya/add-aws-credentials-in-terraform-2mod</guid>
      <description>&lt;p&gt;Create a terraform.tfvars file in your terraform directory &lt;/p&gt;

&lt;p&gt;If you give the name as mentioned above, terraform by default recognize that as a local environment file and you do not version control it.&lt;/p&gt;

&lt;p&gt;Edit the file add these two variables &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;aws_access_key = "XXXXXXXXXXX"&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;aws_secret_key = "XXXX+XXXX"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this way, you do not have to specifically mention the credentials every time you want to run:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;terraform plan&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;terraform apply&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you create a file with a different name, you can pass the file name while running terraform commands &lt;/p&gt;

&lt;p&gt;The above concept is keeping in mind AWS is the default provider and the credentials associated is the default user. &lt;/p&gt;

</description>
      <category>aws</category>
      <category>terraform</category>
    </item>
  </channel>
</rss>
