Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: How maximize browser

  1. #1
    Sencha User
    Join Date
    Jan 2017
    Posts
    9

    Default Answered: How maximize browser

    How i can maximize Chrome browser window in Sencha test 2.2.0 when the test is run via WebDriver?
    Hack ST.defaultContext.driver.windowHandleMaximize (); for version 2.2 does not work!
    I use Chrome 67 and Windows 10





  2. Which specific build of 2.2.0 are you using (you can check the full version number under Preferences) - is it the GA release (2.2.0.148)? And are you using the Embedded selenium server, or a custom selenium server?

    I'm unable to replicate the issue on Windows 10, Chrome 67, and a WebDriver scenario running against the Embedded selenium server. Running this code maximizes the browser window for me:

    Code:
    ST.defaultContext.driver.windowHandleMaximize();

  3. #2
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    330
    Answers
    51

    Default

    Which specific build of 2.2.0 are you using (you can check the full version number under Preferences) - is it the GA release (2.2.0.148)? And are you using the Embedded selenium server, or a custom selenium server?

    I'm unable to replicate the issue on Windows 10, Chrome 67, and a WebDriver scenario running against the Embedded selenium server. Running this code maximizes the browser window for me:

    Code:
    ST.defaultContext.driver.windowHandleMaximize();
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  4. #3
    Sencha User
    Join Date
    Jan 2017
    Posts
    9

    Default

    Quote Originally Posted by daniel.gallo View Post
    Which specific build of 2.2.0 are you using (you can check the full version number under Preferences) - is it the GA release (2.2.0.148)? And are you using the Embedded selenium server, or a custom selenium server?

    I'm unable to replicate the issue on Windows 10, Chrome 67, and a WebDriver scenario running against the Embedded selenium server. Running this code maximizes the browser window for me:

    Code:
    ST.defaultContext.driver.windowHandleMaximize();
    i am use Sencha Test 2_2_0_148 and selenium server 3.4.
    I do:
    Code:
    it('resize window', function () {
                if (ST.browser.is.Chrome) {
                    ST.defaultContext.driver.windowHandleMaximize();
                }
    })
    and i get:
    Code:
    TypeError: Cannot read property 'windowHandleMaximize' of undefined
    because driver is undefined. I learned through the console.log object ST.defaultContext, it does not driver

  5. #4
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    330
    Answers
    51

    Default

    You would only get this error ("ST.defaultContext.driver" being undefined) on an In-Browser scenario. Please double-check the settings of the Scenario, and make sure that the WebDriver option is selected ("WebDriver" should be dark blue):

    Screen Shot 2018-07-26 at 12.20.08 PM.png
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  6. #5
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    330
    Answers
    51

    Default

    Also, after you change the Scenario type, you will need to close the scenario test runner screen (the tab with the list of browsers), and re-open it to pick up the changes.
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  7. #6
    Sencha User
    Join Date
    Jan 2017
    Posts
    9

    Default

    You can show me the contents of a file project.json when you select WebDriver option?

  8. #7
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    330
    Answers
    51

    Default

    The project.json would look something like this, where the scenario's "sandbox" config is set to true (indicating a WebDriver scenario):

    Code:
    {
        "framework": "jasmine",
        "libs": [],
        "coverageFilters": [],
        "scenarios": [
            {
                "libs": [],
                "coverageFilters": [],
                "webdriverContext": "webdriver",
                "sandbox": true,
                "globals": "*",
                "directory": "basicTests",
                "page": "https://www.google.com/",
                "name": "basicTests",
                "framework": "jasmine"
            }
        ],
        "pageObjects": [],
        "subjectUrl": "https://www.google.com/"
    }
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  9. #8
    Sencha User
    Join Date
    Jan 2017
    Posts
    9

    Default

    In sandbox: true mode, scripts located in lib do not work

  10. #9
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    330
    Answers
    51

    Default

    Please can you be more specific - are you getting a specific error? How is it not working - are you trying to reference one of the scripts from a test suite? What does the script inside the "lib" folder contain?
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

  11. #10
    Sencha User
    Join Date
    Jan 2017
    Posts
    9

    Default

    In general, everything is fine. I figured it all out. Thanks for the help!

Page 1 of 2 12 LastLast

Similar Threads

  1. Sencha 2.0.2 - How to Maximize browser window
    By SenderowiczP in forum Q&A
    Replies: 4
    Last Post: 20 Apr 2017, 12:07 AM
  2. Maximize tab to the whole browser
    By dekely in forum Ext: Q&A
    Replies: 7
    Last Post: 26 Jul 2013, 8:11 AM
  3. Maximize Panel To Browser Window
    By jr_core in forum Ext: Discussion
    Replies: 2
    Last Post: 13 Jun 2012, 6:21 AM
  4. is it possible to maximize the browser window without JSNI?
    By pauloallonso in forum Community Discussion
    Replies: 1
    Last Post: 14 Oct 2011, 5:59 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •