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.
Comments
Post a Comment