IOS Automation Tests: Button Shortcuts Not Recognized by Tools

I am currently working on script automation (JavaScript) for an iOS application. I am not a programmer, just a tester who wants to look for errors.

Relevant software: Xcode, Tools .

Here is the problem: in my application there are buttons that do not have a name, which is important for automatic tests, so I gave them a shortcut in the "Availability" field of Xcode. But the devices still do not recognize the name of the buttons.

For example: what I want but does not work:

target.frontMostApp().mainWindow().scrollViews()[2].buttons()["Settings"].tap(); 

What I don't want but works:

 target.frontMostApp().mainWindow().scrollViews()[2].buttons()[1].tap(); 

This is just one of many situations that I have encountered. I chose simple, and this may seem trivial, but some others are really problematic.

Any idea how to fix this?

+4
source share
1 answer

Do you create code by typing it or capturing it?

If you didnโ€™t capture it, you can do this using this small write button in the JavaScript editor. After capturing, the tools show you a code that automates the actions you did manually. Then you can find out if there is another way to place the button. This way you can learn how to launch your button. I did not configure my GUI elements with accessibility properties, because this way I can learn how to run elements.

Sometimes it takes several attempts to succeed.

enter image description here

In addition, if animation is applied when the screen changes, there must be a delay before you can fire the following GUI event:

 target.delay(1); 

This creates a delay of 1 second until the next event is fired.

Hope this helps

0
source

Source: https://habr.com/ru/post/1402463/


All Articles