c# - Chrome instead of firefox, element not found -


i'm starting use selenium , have problems.

here code (c#):

namespace selenium1 { [testclass] public class unittest1 {     firefoxdriver firefox;      [testmethod]     public void testmethod1()     {         firefox = new firefoxdriver();         firefox.navigate().gotourl("https://www.google.com");         firefox.findelement(by.id("gbqfq")).sendkeys("google");         firefox.findelement(by.id("gbqfq")).sendkeys(keys.enter);     }      [testcleanup]     public void teardown()     {         firefox.quit();     } } } 

but instead of opening firefox opening chrome , invoking error:

test method selenium1.unittest1.testmethod1 threw exception:  openqa.selenium.nosuchelementexception: unable locate element: {"method":"id","selector":"gbqfq"} 

where mistake?

thx.

have here: how run selenium tests in multiple browsers cross-browser testing using java?

and here http://www.widecodes.com/7qjywvuwvx/how-to-initialize-a-c-selenium-webdriver-test-to-pass-in-different-browser-types.html


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -