I have a code like this:
driver.manage().window().setPosition(newPosition("4.5,4.5"));
The above code gives me an error in the Eclipse IDE and it says:
The method
newPosition(string)
is undefined for the type
WebDriverMethods.
How to fix this?
0
You are completely doing wrong in your code. The syntax is wrong.
There is no such method called newPosition
in WebDriver
.
Read Java Docs for Selenium WebDriver.Window
-
setPosition
method takesPoint
object as an argument. -
Point
constructor takes two argumentsx
andy
which are of typeint
.
Fix your code to this:
driver.manage().window().setPosition(new Point(5, 5));