Gmail login Functionality error

Asked by Prasanjit on 2018-02-06

My Sikuli Automation scenario is

a) Load www. google.com
b)Click on Gmail link at the top right
c)Login page displayed
d)Type emailid in the email id/phonenumber field
e)Click Next
f)Password field is displayed
g)Type password
f)Click Next and user is logged in

What happens is that the emailid never gets typed and the Next button gets clicked as a result of which the test fails .

Console Log however says Type emailid is successful

Please find the below code:

package popsocketsautomation;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Pattern;
import org.sikuli.script.Screen;
import org.sikuli.script.SikuliException;
import org.testng.annotations.Test;

public class SikuliFirstProgram {

 @Test

 public void gmailLogin() throws InterruptedException
 {

  Screen screen = new Screen();

  Pattern image1 =new Pattern("D:\\PopsocketsAutomation\\popsocketsautomation\\PopsocketsImages\\GmailLogo.png");

  Pattern image2 =new Pattern("D:\\PopsocketsAutomation\\popsocketsautomation\\PopsocketsImages\\Username.png");

  Pattern image3 =new Pattern("D:\\PopsocketsAutomation\\popsocketsautomation\\PopsocketsImages\\Password.png");

  Pattern image4 =new Pattern("D:\\PopsocketsAutomation\\popsocketsautomation\\PopsocketsImages\\Next.png");

WebDriver driver = null;

System.setProperty("webdriver.chrome.driver","lib/chromedriver.exe");
driver = new ChromeDriver();
 driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.get("https://www.google.com");

        screen.click(image1);
 screen.type(image2, "<email address hidden>");//this is not happening but console log says this is fine"
 screen.click(image4);
        screen.type(image3, "test");
        screen.click(image4);

}

}

Console : [log] CLICK on L(1132,136)@S(0)[0,0 1366x768] (570 msec)
[log] CLICK on L(649,716)@S(0)[0,0 1366x768] (536 msec)
[log] TYPE "<email address hidden>."
[log] CLICK on L(826,510)@S(0)[0,0 1366x768] (548 msec)
FindFailed: D:/PopsocketsAutomation/popsocketsautomation/PopsocketsImages/Password.png:

Please help me as I need to give a demo to my client pertai ing to Sikuli. Your help will be deeply appreciated

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2018-02-06
Last reply:
2018-02-06
RaiMan (raimund-hocke) said : #1

one of the most often pitfalls:
type() does not allow to enter special characters as such
see faq 933

use paste() instead.
... in any case check, wether the image is there, the GUI is ready and the text field has focus.

use the imagepath feature to set the bundlepath for the images.
No need to define patterns - just use the image file name (.png not needed), if you do not define a smilarity score and/or target offset.

Can you help with this problem?

Provide an answer of your own, or ask Prasanjit for more information if necessary.

To post a message you must log in.