Tool Automation Tool: Script completed without explicitly closing this test

I played with the Automation tool in tools today, but I had problems writing a working test. The following example ends with Issue: Script ended without explicting closing this test . Yes, the message really says that. I assume this is a typo introduced in the latest version of Xcode. This is the first time I have tried to use this tool. Setting cellCount to 6 leads to the transition, but something gives me the script message has ended. Am I doing this wrong or is there a mistake with the automation tool.

 UIALogger.logStart("Start Simple Test"); var target = UIATarget.localTarget(); var cellCount = 7; UIALogger.logMessage("cell count: " + cellCount); if (cellCount != 6) { UIALogger.logFail("Failed"); } UIALogger.logPass("Passed"); 
+1
source share
5 answers

I think it happened that you are closing your journal group incorrectly. When you say logStart() , you start a group of logs in the tools and everything that you log after that with logMessage() or logError() will be enclosed in this group.

You close groups with logFail() or logPass() , which look like you tried to do, but you can only call one or the other. You need an else clause to call logPass() as follows:

 if (cellCount != 6) { UIALogger.logFail("Failed"); } else { UIALogger.logPass("Passed"); } 

Strange, when I pasted the code snippet in UI Automation, I did not get the error of the problem you were talking about. He simply printed two logs in the trace log. Try using the else clause, as I mentioned above, and see if it works.

+2
source

I found a real problem here. Basically, this suggests that your application is not in an easy-to-use mode for further testing at a specified point. Therefore, please go through or skip or add the appropriate delay in this place.

The easiest solution to avoid this is to have one delay function 2 seconds after each page navigation. This will load the data on each page after retrieving and displaying the data in the panel. And the script will run smoothly.

// Step: 1 Navigation / tapping

 UIATarget.localTarget().delay(2); 

// check

// Step: 2 Navigation / tapping

 UIATarget.localTarget().delay(2); 

// check

+1
source

How strange. I ran into the same problem as described above and I also use the else clause.

In addition, I tried the double-logging method, as described above, the same way as before my if goes to the log or fails:

 UIALogger.logMessage("My Story Title: " + titleDisplayed); UIALogger.logMessage("Innocuous Message."); 

And I got FAIL, which is good - I wanted nothing but the result of " Issue " and the message " script ended without expliciting ". So, I then commented // on the second logMessage and repeated the test, and this time got the β€œ Issue ” and β€œ script ended without explicating ” again.

So, its top tip has been tested as real.

I am running Xcode and Instruments version 4.6 with an iPhone emulator working as project 6.1.

--- Update -

I can’t get a pass / not work properly no matter what I do. On one run, I get the outrageous " Issue: Script ended without explicating " message in my journal, and then if I make any changes to the script - even if it just adds extra spaces and saves it, and then runs again - I will get good pass or result of failure.

But if I immediately run the test again without any changes, I will get the message β€œ Issue: Script ended without explicating ”, and this will not disappear until I make a meaningless change in the script and save, and then run again, and then MAYBE at that moment I could get a decent result / failure (it doesn’t always happen), but if I run the script again, I will get " Issue: Script ended without explicating " again.

What the hell? I really took the time to reinstall Xcode 4.6, but no luck in changing the behavior. I am deeply upset. This seems to be a bug in the Tools. Is there any way to report this to Apple?

0
source

I also had this problem. You should have a string that you overlay on your logStart method in the logPass or logFail method - that’s it! This will mean, for example:

 UIALogger.logStart("Add to Whishlist"); //here comes your automation code UIALogger.logPass("Add to Whishlist"); 

Then you can open another test using logStart() and close it either using the logPass() methods

0
source

I found out that if you put delays between different messages, they actually detect and evaluate problems. The problem I started with was that two consecutive logMessages did not display correctly (the last one was deleted)

 UIALogger.logMessage("This is some text"); UIALogger.logMessage("This is some text"); //UIATarget.localTarget().delay(1); 

showed only one output line. Uncommenting shows two ... It seems somewhat ... inconsistent - and there is still: (This concerns Wolfe)

 UIALogger.logStart("Add to Whishlist"); UIALogger.logMessage("My Story Title: "); //UIATarget.localTarget().delay(1); UIALogger.logMessage("Innocuous Message."); //UIATarget.localTarget().delay(1); if (true) UIALogger.logPass("Add to Whishlist"); else UIALogger.logFail("Add to Whishlist"); 

Here I got a "problem". Disapproval helped solve this problem. I know this is not a solution. But it helped me get around.

The "string" in logStart, logFail or logPass is not really important to me.

0
source

All Articles