SAN JOSE, Calif.—For the first time in her criminal-fraud trial, Elizabeth Holmes on Tuesday took aim at the most serious allegations made against her by prosecutors, offering a narrative of herself as a well-intentioned if inexperienced entrepreneur who had some success in her effort to transform healthcare.

Ms. Holmes’s full day of testimony was her longest yet in her defense against 11 charges of fraud and conspiracy relating to her time running defunct startup Theranos Inc., which collapsed in 2018. It followed 11 weeks of testimony supporting the prosecution’s case that Ms. Holmes ran into trouble trying to build her blood-testing company and knowingly misled investors and patients about her technology’s capabilities.