testcases = int(input())
for _ in range(testcases):
N,K = map(int,input().split())
S = input()
if S.find("*"*K)!=-1:
print("Yes")
else:
print("No")
I tried your code in my IDE and your script seems to freeze.
I think instead of giving an output your program is expecting an input().The fix is probably indenting the code after the for loop(line 5-9)