i have following selenium java code.
import org.junit.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.firefoxdriver; import org.openqa.selenium.remote.desiredcapabilities; import org.openqa.selenium.remote.remotewebdriver; import java.net.url; import static org.junit.assert.assertequals; import static org.junit.assert.asserttrue; import static org.junit.assert.fail; @beforeclass public static void setup() throws exception { driver = new remotewebdriver(new url(system.getproperty("webdriverurl")), desiredcapabilities.firefox()); baseurl = system.getproperty("baseurl"); driver.get(baseurl + "/"); } @test public void testscreensize(){ driver.manage().window().setsize(992, 768); }
i still cant seem resize window screen. text 'window' seen error. idea why?
update:
i can run code. doesnt show error. because of dependency version number. current code in beforeclass. firefox browser opens doesnt resize size want. also, need resize width. height not important.
driver = new remotewebdriver(new url(system.getproperty("webdriverurl")), desiredcapabilities.firefox()); baseurl = system.getproperty("baseurl"); driver.get(baseurl + "/"); driver.manage().window().setsize(new dimension(992, 768));
this works absolutely fine me without issues on selenium-server 2.48.2 ff41.0.2
import org.junit.*; import org.openqa.selenium.*; import org.openqa.selenium.remote.desiredcapabilities; import org.openqa.selenium.remote.remotewebdriver; import java.net.url; import java.util.concurrent.timeunit; public class so35079080 { static webdriver driver; @beforeclass public static void setup() throws exception { driver = new remotewebdriver(new url("wdurl"), desiredcapabilities.firefox()); driver.get("https://www.google.co.in"); driver.manage().window().maximize(); driver.manage().timeouts().pageloadtimeout(10, timeunit.seconds); } @test public void testscreensize(){ driver.manage().window().setsize(new dimension(992, 768)); } @afterclass public static void teardown() { driver.quit(); } }
Comments
Post a Comment