0% found this document useful (0 votes)
15 views2 pages

Sample Python

Uploaded by

Manoj Raj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Sample Python

Uploaded by

Manoj Raj
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

JAVA:

import [Link];
import [Link];
import [Link];
import [Link];
public class GoogleSearch {
public static void main(String[] args) {
// Create a new instance of the html unit driver
// Notice that the remainder of the code relies on the interface,
// not the implementation.
WebDriver driver = new FirefoxDriver();
// And now use this to visit Google
[Link]("[Link]
// Find the text input element by its name
WebElement element = [Link]([Link]("q"));
// Enter something to search for
[Link]("Hello Selenium WebDriver!");
// Submit the form based on an element in the form
[Link]();
// Check the title of the page
[Link]("Page title is: " + [Link]());
}
}

C:
using System;
using [Link];
using [Link];
using [Link];
class GoogleSearch
{
static void Main()
{
IWebDriver driver = new FirefoxDriver();
[Link]().GoToUrl("[Link]
IWebElement query = [Link]([Link]("q"));
[Link]("Hello Selenium WebDriver!");
Introduction 3
[Link]();
[Link]([Link]);
}
}

JAVA SCRIPT:
var webdriver = require('selenium-webdriver');
var driver = new [Link]()
.forBrowser('chrome')
.build();
[Link]('[Link]
[Link]([Link]('q')).sendKeys('webdriver');
[Link]([Link]('btnG')).click();
[Link]([Link]('webdriver - Google Search'), 1000);
[Link]([Link]);

PYTHON:
from selenium import webdriver
driver = [Link]()
[Link]("[Link]
elem = driver.find_element_by_name("q")
elem.send_keys("Hello WebDriver!")
[Link]()
print([Link])

You might also like