Question #224833 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/224833

    Status: Answered => Open

Rajesh Sama is still having a problem:
Actually my problem is as follows:

I am working with Selenium RemoteWebDriver. I am using two machines.
Machine 1 as hub, machine 2 as node. My java file is in machine 1 (hub),
images are in machine 1 shared directory "\\192.168.173.20\\My
Sharing\\Web". I mapped the shared directory "\\192.168.173.20\\My
Sharing" to a driver letter "R" in both the machine 1 and machine 2. I
am using the path for images as s.type("R:\\Web\\Username.png",
"moderator");

If I run the java file in machine 1 with WebDriver (not RemoteWebDriver)
it is working fine. Also if I run the same java file in machine 2 with
WebDriver (not RemoteWebDriver) it is also working fine. There is no
issue with resolution for the images.

But the problem arises here:

I am running the java file in machine 1 using RemoteWebDriver. URL is
opening in firefox browser in the machine 2  but the images like
username are not recognizing in the machine 2 and throwing an error as
"FindFailed: can not find R:\Web\Username.png on the screen.".

My code is as follows:

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.sikuli.script.FindFailed;
import org.sikuli.script.Screen;
import org.testng.annotations.Test;

public class moderator163 {
        
        @Test()
        public void searchTest() throws MalformedURLException, 
InterruptedException{
                
                DesiredCapabilities cap = DesiredCapabilities.firefox();
                cap.setBrowserName("firefox"); 
                cap.setPlatform(Platform.ANY);

                RemoteWebDriver driver = new RemoteWebDriver(new 
URL("http://localhost:4444/wd/hub";),cap);         
                //WebDriver driver = new FirefoxDriver();
                driver.get("http://192.168.0.170/avc";);
                driver.manage().timeouts().pageLoadTimeout(20, 
TimeUnit.SECONDS);
                driver.manage().window().maximize();
                Thread.sleep(8000L);
                
                Screen s = new Screen();
                                
                try{
                        Thread.sleep(3000L);
                        s.type("R:\\Web\\Username.png", "moderator");
                        Thread.sleep(2000L);
                        s.type("R:\\Web\\Password.png", "moderator");
                        s.click("R:\\Web\\1360953169692.png");
                        driver.manage().timeouts().implicitlyWait(20, 
TimeUnit.SECONDS);
                        Thread.sleep(2000L);
                        s.click("R:\\Web\\1360953235255.png");
                        driver.manage().timeouts().implicitlyWait(20, 
TimeUnit.SECONDS);
                        s.doubleClick("R:\\Web\\c0urse163cIa-1.png");
                                                
                }catch(FindFailed e){
                        e.printStackTrace();
                }
                //driver.quit();
                
        }

        }


Thanks in Advance.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to