L
L
Lebanon-QA2020-07-08 17:39:23
Swift
Lebanon-QA, 2020-07-08 17:39:23

Cannot infer contextual base in reference to member 'staticTexts' how to fix?

func test() {
        let app = XCUIApplication()
        app.textFields.element.tap()
    func app;.staticTexts["Войти"].tap()
    let app2 = app
    func app2;.tables/*@[email protected]*/.staticTexts["Eсть"]/*@[email protected]*/.tap()
    func app;.textFields["auth_login_field"].tap()
    let authPassFieldSecureTextField = app.secureTextFields["auth_pass_field"]
    func authPassFieldSecureTextField;.tap()
    authPassFieldSecureTextField.tap()
    app2/*@[email protected]*/.staticTexts["Войти"]/*@[email protected]*/.tap()
    app2/*@[email protected]*/.staticTexts["Настрою позже"]/*@[email protected]*/.tap()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yaroslav Astafiev, 2014-11-21
@Assada

This is how you can iterate through all the JSON elements of the 1st level. And already ask them the value of the field nick, lvl and others.

for (var key in obj1) {
  if (obj1.hasOwnProperty(key)) {
    alert(key + " -> " + obj1[key].nick);
  }
}

But why do you need such an approach? Why not store everything as an array of JSONs, then there will be no confusion with the order, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question