The 29-year-old driver stopped her Vauxhall Corsa on the A89, near the former Bangour Hospital, in Dechmont, at about 16:15 on Monday.
After rolling down her window to speak to the female pedestrian, she was hit in the face before a man tried to open the front passenger door.
The woman managed to drive off before contacting police.
The female suspect was described as white, about 5ft 3in tall with tied-back brown hair. She was wearing a blue, hooded top.
The male suspect was described as wearing a dark-coloured jacket.
Insp Scott Robertson, from Police Scotland, appealed for witnesses to come forward.
He said: "Fortunately, the woman was not injured during this incident and neither suspect was able to gain entry to her car.
"Nevertheless, she was left extremely shaken as a result and we are pursuing various lines of inquiry to trace both suspects."
A woman was attacked in her own car after being flagged down by a pedestrian in West Lothian.