You may need the Magnesium test if you are experiencing symptoms such as muscle weakness, tremors, seizures, irregular heartbeats, or other unexplained symptoms. This test can also be done if you have a kidney disorder, uncontrolled diabetes, gastrointestinal disorder, or if you are taking certain medications that may affect magnesium levels.