I am new to Selenium and I need help whatever I can get. I will try to provide detailed info as much as I can. I need to call the object imgBtn01
or imgBtn02
inside the FIRST Class (ImagesRepo
) from the SECOND Class. The reason I want to separate it, I want all to store all the image objects from a different class.
Selenium + Sikuli > Java > Maven Project
First Class from different Package
public class ImagesRepo {
public void imageRepoApp() {
//Images assigning object
Screen screen = new Screen();
Pattern imgBtn01 = new Pattern("/Images/Btn_ButtonName01.png");
Pattern imgBtn02 = new Pattern("/Images/Btn_ButtonName02.png");
}
Second class, from a different package:
public class testBed {
public static void callRepoImages() throws FindFailed {
ReporImages();
}
@Test
public static void ReporImages() {
Screen screen = new Screen();
screen.click(imgBtn01); //the imgBtn01 has a redline
screen.click(imgBtn02); //the imgBtn02 has a redline
return;
}
}