한 패키지에 클래스가 있고 다른 패키지에 다른 클래스가 있습니다. 첫 번째 패키지에는 두 번째 클래스에서 액세스하려는 공개 정적 변수가 있습니다. 여기 다른 패키지 클래스의 정적 변수에 액세스 할 수 없습니다.
내 첫 클래스의 코드는 다음과 같습니다package first;
import org.openqa.selenium.WebDriver;
public class first{
public static WebDriver driver;
}
내 두 번째 클래스의 코드 : 내 IDE는 "first.driver.findElement (By.xpath ('에서 오류를 표시
package second;
import first.*;
public class second{
first.driver.findElement(By.xpath("html/body/form/div[5]/div/div[1]/div[2]/table/tbody/tr[1]/td[2]/input")).click();
}
/div/div [1]/table/tbody/tr [1]/td [2]/input ")). 이 줄. findElement
- -하지 유효하지 않은 방법 내에서
감사
죄송합니다. 내 실수는 이제 내 게시물을 수정했습니다. –