I downloaded the Microsoft WebDriver C# Sample Project and was able to automate a simple test to open the Bing web page and type in a sample search.
I then tried to modify this sample to work with our own website. However we use iFrames and I have so far been able to get the "switchToFrame" command working for these.
The block of JSON I supply to the ExecuteCommand function is as follows (where the id has been obtained by running a "fineElement" command to locate the iFrame):
{"command": {"name": "switchToFrame","parameters": {"id": "f5d2cc0b-2ec9-4406-be34-5a2ec0fbc1ce" },"sessionId": "7285f02b-0dac-478f-b0b8-72204e1eb8d9" } }
However, this results in the following response being returned:
{"sessionId":null,"status":"unknown error","value":"JSON format error: For all commands, command object must contain pair with name \"name\"" }
The only thing that I can see that looks peculiar is that the "switchToFrame" command is the only WebDriver method to actually take a JSON "command" parameter. Although I tried without this parameter and got an unknown command response.
Would anyone know how to fix this and get the new WebDriver "switchToFrame" command working?