Herta is under contract to Andretti Autosport in IndyCar until the end of 2023
The 22-year-old American drove the team's 2021 car at Portimao in Portugal on Monday and Tuesday.
Herta said: "It's a goal of mine and has been for a while. There have been instances when I have been close. It [the test] is just to get seat time."
McLaren were using the test as part of their young driver evaluation programme.
Team principal Andreas Seidl said it was too early to make a judgement on whether Californian Herta was a candidate for the team in future.
"We take it step by step," he said, adding it was not possible to compare lap times to those done by the car at last year's Portuguese Grand Prix at the track because conditions and the tyres used were different.
"The team was quite impressed with how Colton was dealing with these challenges and his physical preparation was enabling him to keep going for two days, knowing how challenging this can be in an F1 car on a track like Portimao. We're very happy with how the test went."
In the coming days, Seidl said the team would "go into the data in detail to get an initial idea of the potential and then we will have a better picture".
Herta, who spent a season as team-mate to McLaren race driver Lando Norris in the Euroformula Open championship in 2016 when he was coming up through the ranks, said he was confident he could make it in F1.
"I do think I'm fast enough," he added. "Whether they agree or not, I guess time will tell."
Of his experience in the test, Herta said: "I felt like I got to the limit midway through the first day. By the end of the second day I was pretty confident putting the laps together.
"I did get really comfortable, I could feel the limit. Maybe not the consistency that would come from a few more days but I felt like I was close."
Like all F1 teams, McLaren are obliged by regulations to run young drivers in two free practice sessions this season.
Seidl said this would take place after the August summer break and plans had not yet been confirmed.
Herta said he would welcome the chance to run in a Friday practice at a grand prix weekend.
He is under contract to Andretti Autosport in IndyCar until the end of 2023, which is when Daniel Ricciardo's McLaren deal ends, while Norris is contracted to the end of 2025.
Australian Ricciardo's future is the subject of speculation as he has been struggling for pace this season.
Among the names linked with the second McLaren seat for 2023, if Ricciardo did leave, are Alpine reserve Oscar Piastri and Williams driver Alex Albon.
Four-time champion Sebastian Vettel is also potentially available as he is out of contract with Aston Martin at the end of this season, although the German, 35, could retire after the 2022 campaign.
-- Courtesy of BBC Sport