Selenium WebDriver
is the most as often as possible utilized device among every one of the apparatuses accessible in the Selenium instrument set. In this way it is imperative
to see how to utilize Selenium to communicate with web applications. In this module, how to connect with GUI objects utilizing Selenium webDriver can be known. Following are the GUI objects."F1"
, "F2"
, "Tab"
, "Control"
, and so on. On the off chance that key to Press is a grouping of characters, distinctive driver executions might chance a special case or to read just the main character in the succession.
Sends a progression of keystrokes onto the component Parameters:Charsequence
- any string esteem speaking to the grouping of keystrokes to be sent.
OnElement
- component that will get the keystrokes, for the most part a content field."sendkeys"
technique. Essentially, likewise it recover content from a content box utilizing the getattribute("value")
command. Percent calculator has taken as example. driver.navigate().to("URL");
method is used to navigate to the selected web site, here used the web site called calculation.net .
[java]driver.navigate().to("http://www.calculator.net/percent-calculator.html");[/java]
To maximize the browser following is the code need to be written.
[java]driver.manage().window().maximize();[/java]
Send key is used to send a progression of keystrokes onto the component Parameters and Thread.sleep();
method is used to stop the thread for particular interval of time, here taken the 5000 ms of time.
[java]Thread.sleep(5000);[/java]