<?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: Divita Goswami</title>
    <description>The latest articles on DEV Community by Divita Goswami (@divinashun).</description>
    <link>https://dev.to/divinashun</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%2F455856%2F5303c4b9-2802-413c-a4a3-488ceedc8c21.jpg</url>
      <title>DEV Community: Divita Goswami</title>
      <link>https://dev.to/divinashun</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/divinashun"/>
    <language>en</language>
    <item>
      <title>Automate tweeting using selenium</title>
      <dc:creator>Divita Goswami</dc:creator>
      <pubDate>Mon, 21 Sep 2020 06:18:05 +0000</pubDate>
      <link>https://dev.to/divinashun/automate-tweeting-using-selenium-3hj7</link>
      <guid>https://dev.to/divinashun/automate-tweeting-using-selenium-3hj7</guid>
      <description>&lt;p&gt;I have joined a challenge in twitter called the #100DaysOfCode challenge. It's a exciting challenge that keeps you motivated to learn and code. Link: &lt;a href="https://www.100daysofcode.com/"&gt;https://www.100daysofcode.com/&lt;/a&gt; .&lt;/p&gt;

&lt;h2&gt;
  
  
  About the challenge
&lt;/h2&gt;

&lt;p&gt;The challenge is to code or do code related tasks till 100 days and tweet about each day's progress using the hash tag 100DaysOfCode.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://twitter.com/hashtag/100DaysOfCode?src=hashtag_click"&gt;https://twitter.com/hashtag/100DaysOfCode?src=hashtag_click&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Birth of an idea
&lt;/h2&gt;

&lt;p&gt;In this challenge i have a repetitive task of logging in and typing the same hash tag, i was learning selenium when it suddenly clicked, why not use the knowledge for automating my tweets!&lt;/p&gt;

&lt;p&gt;Task steps that i have automated:&lt;br&gt;
     1. Logging on to twitter by giving credentials.&lt;br&gt;
     2. Typing the required # tags automatically, Typing my tweet &lt;br&gt;
        is manual for now.&lt;br&gt;
     3. Click on tweet.&lt;/p&gt;
&lt;h2&gt;
  
  
  A brief about the tool - Selenium
&lt;/h2&gt;

&lt;p&gt;Selenium is the tool that i used to automate my task, so here is something about the tool and packages that I've used. It's a vast topic but here i have mentioned some important areas and explained it with my code.&lt;/p&gt;

&lt;p&gt;Selenium has following two packages&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;WebDriver&lt;/li&gt;
&lt;li&gt;WebElement&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;WebDriver&lt;/strong&gt; : It is Open source API collection used to automate web applications.It supports different browsers. Has got method to load a web application on browsers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;WebElement&lt;/strong&gt; : It is an interface, anything on a web page is called a web element eg: input box,textbox, buttons etc. we identify and operate on web elements using the object and methods of WebElement.&lt;/p&gt;

&lt;p&gt;code block&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The above code imports our packages - drivers, we need chrome driver to launch our app in  the browser&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class autoTweet {
  WebDriver driver;
    System.setProperty("webdriver.chrome.driver","C:\\Users\\xyz\\chromedriver.exe"); // setting our driver path
      driver = new ChromeDriver();
      driver.get("https://twitter.com/home");// using driver loads twitter
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Above code snippet is just launching twitter on chrome.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public void f() {
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

WebElement username = driver.findElement(By.xpath("/html/body/div/div/div/div[2]/main/div/div/div[1]/form/div/div[1]/label/div/div[2]/div/input"));
    username.sendKeys("xya@abc.com");// Give valid mail id, this is example

WebElement password = driver.findElement(By.xpath("/html/body/div/div/div/div[2]/main/div/div/div[1]/form/div/div[2]/label/div/div[2]/div/input"));
    password.sendKeys("*****"); // give your password
    driver.findElement(By.xpath("/html/body/div/div/div/div[2]/main/div/div/div[1]/form/div/div[3]/divSdiv")).click();// find Log in button and click
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I have used time out because sometimes the script tries to find the element even before the page is loaded. So we wait for page to load all the elements. &lt;br&gt;
Then i identify using locator xpath, the Username and password textbox and pass values using sendKeys() method.&lt;/p&gt;

&lt;p&gt;(more about xpaths here : &lt;a href="https://www.guru99.com/xpath-selenium.html"&gt;https://www.guru99.com/xpath-selenium.html&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;( About sendKeys here : &lt;a href="https://www.guru99.com/accessing-forms-in-webdriver.html"&gt;https://www.guru99.com/accessing-forms-in-webdriver.html&lt;/a&gt; )&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WebElement tweet = driver.findElement(By.xpath("/html/body/div/div/div/div[2]/main/div/div/div/div/div/div[2]/div/div[2]/div[1]/div/div/div/div[2]/div[1]/div/div/div/div/div/div/div/div/div/div[1]/div/div/div/div[2]/div/div/div/div")); // find the tweeting text box

    tweet.sendKeys("#100DaysOfCode #codeNewbies"); //type auto #100DaysOfCode #codeNewbies
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Lastly i identify the &lt;strong&gt;web element&lt;/strong&gt; text box for tweeting and pass my &lt;strong&gt;#100DaysOfCode #codeNewbies&lt;/strong&gt; &lt;br&gt;
There is a lot of scope for improvement and this particular twitter case can be extended further, i have the idea but need to work on it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Future Scope
&lt;/h2&gt;

&lt;p&gt;Fetching my log information from git hub and putting it directly to my tweet, as in this case i mostly tweet the same update as in git hub logs.&lt;/p&gt;

&lt;p&gt;This is my first technical post on dev.to Please help me improve.&lt;br&gt;
I welcome all feedbacks, constructive criticism.&lt;br&gt;
&lt;strong&gt;Feel Free to give Feedbacks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Thanks!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>what are the type of questions that might be asked in QA interview?</title>
      <dc:creator>Divita Goswami</dc:creator>
      <pubDate>Thu, 03 Sep 2020 07:26:57 +0000</pubDate>
      <link>https://dev.to/divinashun/what-are-the-type-of-questions-that-might-be-asked-in-qa-interview-1nia</link>
      <guid>https://dev.to/divinashun/what-are-the-type-of-questions-that-might-be-asked-in-qa-interview-1nia</guid>
      <description>&lt;p&gt;Hi There,&lt;/p&gt;

&lt;p&gt;I am a newbie in the world of dev.to, i am currently preparing to be a quality analyst/tester. What type of questions can i expect in my interviews? i have basic knowledge of coding but do they really stress upon the coding part? will they ask a tester to write a piece of code? any suggestions?&lt;/p&gt;

&lt;p&gt;Thanks &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>help</category>
    </item>
  </channel>
</rss>
