Most of the time I would say 'plugged-in' rather than 'off the socket.'
You could use this several ways, each of the following examples makes the separation of the two trials more explicit:
I tried running the laptop both on
battery power and plugged-in.
I tried both running the laptop on
battery power and plugged-in.
I tried running the laptop from the
battery, and then tried it plugged-in.
You could also use battery power and wall power or cord power together to have a more parallel construction, such as:
I tried running the laptop on battery power first, then on wall power.
I tried running the laptop both from the battery and from the cord, but neither worked.
Or if you meant you tried to run it from battery power and wall power at the same time, you might say:
I tried to get the laptop to draw
power from both the battery and the
cord at the same time.
This is one of those situations where the common knowledge of how these things work (laptops normally draw power from battery or a cord, but not both at the same time) is going to inform most peoples interpretation of your statement. Really the only situation you'd need to worry about people understanding is if you really did mean you tried to get the laptop running from two power supplies at the same time.