It sounds like you are not really practising scrum but 'timeboxed waterfall'. With this approach each sprint is it's own mini waterfall project, with dev up front and testing at the end. As you have identified this results in wasted time as testers have little to do at the start of the sprint and devs have little to do at the end of the sprint.
Instead the team should be working to ensure everyone is as fully employed as possible. During the daily standups and at sprint planning your team should try to work out how they can deliver something to the testers immediately, and then iterate on that during the sprint so the testers can be testing the functionality in parts as it is delivered.
A common part of the standup might be for a tester to say they have nothing to work on later that day. Perhaps a dev then offers to fix a couple bugs they know then can close that morning rather than starting something bigger. That then fills a gap for the tester while another dev is finishing off a piece of work for them to start testing on tomorrow. No one is busting a gut, but you've got a higher throughput of work.