Results 1 to 3 of 3

Thread: Page object identifier

  1. #1
    Sencha User
    Join Date
    Oct 2017
    Posts
    7
    Vote Rating
    0
      0  

    Default Page object identifier

    What is the best practice when selecting a locator for a component on your page object? I have read to use XPath and DOM Queries on the sencha test resources, and I have seen webinars saying to simply use the text or field label identifiers.. Are these not susceptible to tedious errors when a label or name is changed and breaks test all over? Obviously id is not a safe identifier, but the documentation provided by the Sencha Test pages is not clear on what the best practice for reliable long term test are.

    Could you enlighten me?

  2. #2
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Vote Rating
    0
      0  

    Default

    I personally like to use "Composite Queries". Since Sencha Test is smart enough to understand EXT components, it allows you to combine Component queries with CSS selectors to create a Composite Query.

    See the locators section here.
    https://www.sencha.com/blog/sencha-t...amples-part-2/

  3. #3
    Sencha - Sales Team daniel.gallo's Avatar
    Join Date
    Apr 2009
    Location
    Redwood City, CA
    Posts
    157
    Answers
    16
    Vote Rating
    22
      0  

    Default

    In some of the demos I've done, I've leveraged various properties on the components to generate locators. If things like field labels are likely to change, then you should instead use something more stable like "itemId", "reference" etc, if they're defined.

    You can use the Inspector tool within Sencha Studio to help generate various different locators, along with this Chrome extension which suggests possible locators that could be used in your test suites.
    Daniel Gallo
    Senior Solutions Architect
    Sencha Inc.

Similar Threads

  1. Page Object value change
    By gmigliorini in forum Q&A
    Replies: 3
    Last Post: 26 Oct 2017, 3:46 PM
  2. Replies: 3
    Last Post: 22 Aug 2017, 2:47 AM
  3. display pb for several Ext object on same jsp page
    By jhgfd69 in forum Ext: Discussion
    Replies: 1
    Last Post: 28 Jun 2012, 8:46 AM
  4. [CLOSED] can't add identifier object to a model
    By Vandeplas in forum Sencha Architect 2.x: Bugs
    Replies: 3
    Last Post: 15 May 2012, 11:24 AM
  5. EXTJS: How to pass the userinfo object from login page to actual js page
    By balaji1_1 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 18 Aug 2010, 12:02 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
  •