There is a code. It takes the links from the file and runs them on the device. We thereby check the site. Here is the code section

import os from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice def record(): with open('C:\op\link.txt') as inp : try: temp = inp.readlines() url = temp.pop(0) with open ('C:\op\link.txt','w') as out: for i in temp : out.write( i) return ''.join(['', url] ) except IndexError: print('1') PACKAGE = 'com.android.browser' ACTIVITY = '.BrowserActivity' COMPONENT = PACKAGE + "/" + ACTIVITY URI = record() device = MonkeyRunner.waitForConnection(0.1,'1777cda7') device.startActivity(component=COMPONENT, uri=URI) 

Then it starts, it does not start. Tell me, please, where is the error?

  • Try to write more detailed questions. Explain exactly what you see the problem, how to reproduce it, what you want to get as a result, etc. - Nicolas Chabanovsky

1 answer 1

Without clarifying the details of the problem, I would venture to suggest that it does not have time to start during the time specified in the argument to the waitForConnection method. Try to increase the timeout value.