I have a problem with Sitecore and Glass Mapper, we are using Glass Mapper in our project and all works fine, but when trying to set an A/B testing I got an exception about null datasource. The strange thing is that if I check the "Test the Component" window I can see that the Test Content Item field shows the wrong content item (Home):
What am I missing, could you please advise me?

This looks like it is a known issue in the MvcContext in GlassMapper v5.6.162 and earlier. As per a Slack comment by Neil Shack:-
A fix has been submitted as a pull request and should be fixed in a newer version soon. https://github.com/mikeedwards83/Glass.Mapper/pull/423