javascript - Scalatest PlusPlay Selenium not able to resize a window -
been digging @ while, , can't seem find way resize window using scalatest plus.
the method i've found searching online or documentation @ http://doc.scalatest.org/2.1.5/index.html#org.scalatest.selenium.webbrowser
is executescript("window.resizeto(700,700);")
but has been unresponsive me (no errors, no nothing). there method covers missing? brief sample of code:
import java.util.concurrent.timeunit import org.scalatestplus.play._ import org.openqa.selenium._ import com.sun.xml.internal.bind.v2.todo import scala.collection.javaconverters._ import controllers.application import models.{item, itemprioritybucket} import play.api.test._ import org.scalatest.time._ class webspec extends playspec oneserverpersuite allbrowserspertest { implicit override val patienceconfig = patienceconfig(timeout = scaled(span(5, seconds)), interval = scaled(span(20, millis))) override lazy val browsers = vector( // firefoxinfo(firefoxprofile), chromeinfo // safariinfo ) implicit override lazy val app: fakeapplication = fakeapplication(additionalconfiguration = testutil.inmemorydatabase("default", map())) val base: string = "http://localhost:" + port def sharedtests(browser: browserinfo) = { "home page" should { "render item" + browser.name in { executescript("window.resizeto(700,700);") item.deleteall() delete cookies val itemid = testutil.createrandomitem(some(itemprioritybucket.low), some(application.english)) val item = item.find(itemid).get go (base + "/") { assert(cssselector(selectors.all_items).webelement.isdisplayed) } } } }
one of tests see different elements based on window size, need control, can't find out there doing in scala.
thanks help,
edit: should mention other scripts run using execute script functioning expected, not resize window script
i able resolve issue adding following line of code:
webdriver.manage.window.setsize(new org.openqa.selenium.dimension(1000, 600))
it's not intuitive, since have explicitly access implicit webdriver, works.
Comments
Post a Comment