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, 2020 in Selenium by anonymous
• 120 points

edited Mar 12, 2020 by Gitika 2,113 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, 2020 by Sirajul
• 59,230 points

Related Questions In Selenium

+10 votes
17 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,360 points
197,415 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
• 58,100 points
4,354 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
• 28,140 points
19,001 views
0 votes
1 answer
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
13,731 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,910 points
2,652 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,910 points
3,056 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,910 points
3,198 views
0 votes
4 answers

How to close login pop up message in Selenium Webdriver?

did you find solution for this? READ MORE

answered Nov 5, 2020 in Selenium by anonymous

reshown Nov 5, 2020 by Sirajul 5,394 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP