【问题标题】:X and Y axis of browser浏览器的 X 和 Y 轴
【发布时间】:2017-10-20 16:02:01
【问题描述】:

我试过这段代码:

WebDriver f1=new FirefoxDriver();
f1.get("http://google.com/");
Point P=f1.manage().window().getPosition();
System.out.println(P);
System.out.println(P.getX());
System.out.println(P.getY());

但是我收到了这个错误:

Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
    Type mismatch: cannot convert from org.openqa.selenium.Point to java.awt.Point

    at Inbox.XandYaxisofbrowser.main(XandYaxisofbrowser.java:14)

【问题讨论】:

    标签: javascript java selenium selenium-webdriver


    【解决方案1】:

    您的导入语句可能是错误的。检查以确保您正在导入 org.openqa.selenium.Pointnot java.awt.Point

    【讨论】:

    • 当然可以。如果有帮助,请投票并选择此作为答案。谢谢。
    • 为什么你现在完全编辑了你的问题?现在我的回答对任何遇到同样问题的人都没有意义。
    猜你喜欢
    • 2022-01-16
    • 1970-01-01
    • 2020-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多