Re: [selenium-users] Selenium IDE - Yahoo Login Issue

120 views
Skip to first unread message

Krishnan Mahadevan

unread,
Jun 1, 2017, 11:55:38 AM6/1/17
to seleniu...@googlegroups.com

Unrelated question: Why are you trying to automate Yahoo Mail ?

You can make use of a programming language such as Java for interacting with a Yahoo mailbox.

 

Take a look at this : https://stackoverflow.com/a/11356464

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <seleniu...@googlegroups.com> on behalf of AutoEngr <youn...@gmail.com>
Reply-To: <seleniu...@googlegroups.com>
Date: Thursday, June 1, 2017 at 6:52 PM
To: Selenium Users <seleniu...@googlegroups.com>
Subject: [selenium-users] Selenium IDE - Yahoo Login Issue

 

Hey all you Selenium Guru.... Here's an interesting one for you all...

 

When I tried to build an auto script for a Yahoo Login.. I can't seem to get the script to capture the object for the "Enter your email" textbox.. I tried using "sendKeys" so it will type in "whatever" I input, and when I run the script, it passes, but nothing is shown within that field.. It's showing up blank... HELP.... I need this so I can proceed with testing email notifications.

Thoughts??? Please look at the image attached for more clarification.

Thanks a BUNCH!

AutoEngr-

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/fc114a5a-7c4c-440c-9c39-d7b7333f0233%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anda Cristea

unread,
Jun 7, 2017, 2:41:01 PM6/7/17
to Selenium Users
Are you interested to write a script for Yahoo email?

Akshat Gupta

unread,
Jun 7, 2017, 11:25:32 PM6/7/17
to Selenium Users
package com.example.tests;

import java.util.regex.Pattern;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.*;
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;

public class Yahoo {
  private WebDriver driver;
  private String baseUrl;
  private boolean acceptNextAlert = true;
  private StringBuffer verificationErrors = new StringBuffer();

  @Before
  public void setUp() throws Exception {
    driver = new FirefoxDriver();
    baseUrl = "https://login.yahoo.com/";
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }

  @Test
  public void testYahoo() throws Exception {
    driver.get(baseUrl + "/beta?.src=fpctx&.intl=in&.lang=en-IN&.done=https%3A%2F%2Fin.yahoo.com&authMechanism=primary&yid=&done=https%3A%2F%2Fin.yahoo.com%2F&eid=100&add=1");
    driver.findElement(By.id("login-username")).clear();
    driver.findElement(By.id("login-username")).sendKeys("****");
    driver.findElement(By.id("login-signin")).click();
    driver.findElement(By.id("login-passwd")).click();
    driver.findElement(By.id("login-passwd")).clear();
    driver.findElement(By.id("login-passwd")).sendKeys("*****");
    driver.findElement(By.id("login-signin")).click();
    //driver.findElement(By.linkText("I'll secure my account later")).click();
  }

  @After
  public void tearDown() throws Exception {
    driver.quit();
    String verificationErrorString = verificationErrors.toString();
    if (!"".equals(verificationErrorString)) {
      fail(verificationErrorString);
    }
  }

  private boolean isElementPresent(By by) {
    try {
      driver.findElement(by);
      return true;
    } catch (NoSuchElementException e) {
      return false;
    }
  }

  private boolean isAlertPresent() {
    try {
      driver.switchTo().alert();
      return true;
    } catch (NoAlertPresentException e) {
      return false;
    }
  }

  private String closeAlertAndGetItsText() {
    try {
      Alert alert = driver.switchTo().alert();
      String alertText = alert.getText();
      if (acceptNextAlert) {
        alert.accept();
      } else {
        alert.dismiss();
      }
      return alertText;
    } finally {
      acceptNextAlert = true;
    }
  }
}
Reply all
Reply to author
Forward
0 new messages