I don’t think there is a way to do this as straightforward as you’d like. But you could add a listener that picks up the profile setting and assigns it via WebUI.setViewPortSize(). As a refinement, you could use -1 to indicate “maximize”.
| GlobalVariable | Value |
|---|---|
| viewportX | 375 |
| viewportY | 812 |
class Listener_VPSize {
/**
* Executes before every test case.
* @param testCaseContext related information of the executed test case.
*/
@BeforeTestCase
def beforeTestCase(TestCaseContext testCaseContext) {
if(GlobalVariable.viewportX == -1) {
WebUI.maximizeWindow()
} else {
WebUI.setViewPortSize(GlobalVariable.viewportX, GlobalVariable.viewportY)
}
}
}
I haven’t tested this, but it looks okay from here.