Buy, Sell and Find almost anything - anywhere
search
location_on
arrow_circle_down
Sort by Categories
Selenium WebDriver Methods in Hyderabad - INDIA
This advertisement is Not Verified. Contacting advertiser is not advised.
Posted few weeks ago

1. Creating New Instance Of Firefox Driver – this will open an new Empty browser
WebDriver driver = new FirefoxDriver();
2. Command To Open URL In Browser
driver.get(“http://selenium-suresh.blogspot.com”);
This syntax will open specified URL of software web application in web browser.
3. Clicking on any element or button of webpage
driver.findElement(By.id(“id of any element or button”)).click();
4. Store text of targeted element in variable – This will retrieve text from targeted element of software web application page and will store it in variable = suresh
String suresh = driver.findElement(By.tagName(“select”)).getText();
5. Typing text in text box or text area.
driver.findElement(By.name(“txtboxname”)).sendKeys(“My First Name”);
6. Applying Implicit wait in webdriver – This syntax will force webdriver to wait for 15 second if element not found on page of software web application.
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
7. Applying Explicit wait in webdriver – This will wait for till 15 seconds for expected text “Time left: 7 seconds” to be appear on targeted element.
WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.textToBePresentInElementLocated(By.xpath(“xpathofelement”), “Time left: 7 seconds”));
8. Get page title in selenium webdriver
driver.getTitle();
9. Get Current Page URL In Selenium WebDriver- It will retrieve current page URL and you can use it to compare with your expected URL.
driver.getCurrentUrl();
10. Get domain name using java script executor – This will retrieve your software application’s domain name using webdriver’s java script executor interface and store it in to variable.
JavascriptExecutor javascript = (JavascriptExecutor) driver;
String CurrentURLUsingJS=(String)javascript.executeScript(“return document.domain”);
For more details please visit: https://nareshit.com/selenium-online-training/