Gmail login through third party

0 votes

import org.openqa.selenium.By;

import org.openqa.selenium.JavascriptExecutor;

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.WebElement;

import org.openqa.selenium.WrapsElement;

import org.openqa.selenium.chrome.ChromeDriver;

import org.openqa.selenium.chrome.ChromeOptions;

import org.openqa.selenium.ie.InternetExplorerDriver;

import org.openqa.selenium.remote.DesiredCapabilities;

import org.openqa.selenium.support.ui.ExpectedConditions;

import org.openqa.selenium.support.ui.WebDriverWait;

import org.testng.annotations.Test; 

import autoIT.AutoITClass;


public class sample1 

{

public static void main(String[] args) throws Exception 

{

DesiredCapabilities capabilities = DesiredCapabilities.chrome();

ChromeOptions options = new ChromeOptions();

options.addArguments("incognito");

capabilities.setCapability(ChromeOptions.CAPABILITY, options);

System.setProperty("webdriver.chrome.driver","D:\\Testing\\softwares\\chromedriver.exe");

WebDriver driver=new ChromeDriver(capabilities);

      

driver.get("https://dicom-poc.firebaseapp.com");

driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);

WebElement patient = driver.findElement(By.xpath("//span[contains(text(),'Sign in as Patient')]"));

patient.click();

try

            {

driver.get("https://accounts.google.com/signin");


WebElement email = driver.findElement(By.xpath("//input[@type=\"email\"]"));

email.sendKeys("myemail@gmail.com");

WebDriverWait wait=new WebDriverWait(driver, 5);               


WebElement emailNext = driver.findElement(By.xpath("//span[contains(text(),'Next')]"));

emailNext.click();


        

WebElement element = wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("password")));


        driver.findElement(By.xpath("//input[@name='password']")).sendKeys("your password");


        


        driver.findElement(By.xpath("//span[@class='RveJvd snByac']")).click();


driver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);



} catch (Exception e) {

// TODO Auto-generated catch block

System.out.println(e.getMessage());

e.printStackTrace();

}


}

}

Mar 10 in Selenium by anonymous
• 120 points

edited Mar 12 by Gitika 574 views
Hey,

Can you please elaborate, what kind of problem statement you are getting?

1 answer to this question.

+1 vote
This issue probably occurs when multiple Gmail accounts have already been created from the same Device/IP.

Google somehow is marking those accounts and blocks them if they are launched by automation frameworks/extensions.

As a workaround, you could try creating a fresh Gmail account from a new device or use an alternative like nodemailer.
answered Mar 12 by Sirajul
• 50,440 points

Related Questions In Selenium

+9 votes
15 answers

How to automate gmail login process using selenium webdriver in java?

Check the below code: Here is the working ...READ MORE

answered Apr 24, 2018 in Selenium by Vardy
• 2,370 points
96,530 views
0 votes
2 answers

How to Change gmail login page settings

Hey @Suganth, from August 2018, google has ...READ MORE

answered Feb 6, 2019 in Selenium by Priyaj
• 57,530 points
616 views
0 votes
1 answer

Login test for Gmail with Cucumber and Selenium Webdriver

Hi Devendra, following feature-file shows the scenario ...READ MORE

answered Aug 5, 2019 in Selenium by Abha
• 27,800 points
1,002 views
0 votes
1 answer

Login page test script using selenium and java in Eclipse IDE

Here is an example to login to ...READ MORE

answered Apr 23, 2018 in Selenium by Meci Matt
• 9,460 points
4,550 views
0 votes
1 answer

How to login a forum using Selenium with Python

You should try to directly log in ...READ MORE

answered Apr 27, 2018 in Selenium by Samarpit
• 5,870 points
544 views
0 votes
1 answer

Getting different texts from the HTML DOM through Selenium and Python

Try Below code: something = elem.find_element_by_xpath('./td[5]') text1 = driver.execute_script('return ...READ MORE

answered May 14, 2018 in Selenium by Samarpit
• 5,870 points
828 views
+1 vote
1 answer
0 votes
1 answer

Login window session expiry using Selenium

The details you can find in below ...READ MORE

answered Jul 13, 2018 in Selenium by Samarpit
• 5,870 points
711 views
0 votes
1 answer

Not able to login using selenium webdriver using Java Language

Try to send text to the username ...READ MORE

answered Jul 17, 2018 in Selenium by Samarpit
• 5,870 points
570 views
0 votes
1 answer

Selenium WebDriver: naukri.com login fails every time

Use the following code after driver.get(URL), String URL1="https://login.naukri.com/nLogin/Login.php"; String ...READ MORE

answered Jul 24, 2018 in Selenium by Samarpit
• 5,870 points
640 views