Visual Studio 2012 UI tests and AX2012

I have created a test script to select the legal entity and Navigation path in the first web page and this works perfectly in MTM however when moving this script toVisual Studio 2012 and executing it, the job fails because it can’t find an item in the navigation path such as ,Sales and marketing’. Can anyone help?