ALL >> Education >> View Article
Selenium Webdriver Methods- Selenium Online Training
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 seconds if an element not found on the page of a software web application.
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
7. Applying Explicit wait in webdriver – This will wait for 15 ...
... seconds for the expected text “Time left: 7 seconds” to appear on the 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 the Current Page URL In Selenium WebDriver- It will retrieve the current page URL and you can use it to compare with your expected URL.
driver.get current URL();
10. Get domain name using javascript executor – This will retrieve your software application’s domain name using web driver's java script executor interface and store it into the variable.
JavascriptExecutor javascript = (JavascriptExecutor) driver;
String CurrentURLUsingJS=(String)javascript.executeScript(“return document.domain”);
For more details please visit: https://nareshit.com/selenium-online-training/
Add Comment
Education Articles
1. Study In Europe 2027: A Complete Guide For Indian StudentsAuthor: Nivesa EdTech
2. Planning For Nclex? A Practical Guide For Nursing Students In Mohali
Author: Vertex Nursings Hub
3. Synopsys Collaborates With Cii Dx-edge To Accelerate Digital Transformation Among India’s Msmes
Author: Madhulina
4. How Ai Is Changing Fashion Trend Forecasting
Author: Vogue Institute of Art and Design
5. Gmat Home Tuition Singapore
Author: Tutor4me
6. Best Copado Robotic Testing Training Course | Visualpath
Author: Vamsi Ulavapati
7. Generative Ai Training Program With Practical Work
Author: golla kalyan
8. Ai Testing Course And Practical Ai Testing Training
Author: Subahan
9. Bim Course In Ncr: Build Industry-ready Skills With Bim Certification
Author: AEODC
10. Mdi Gurgaon Online Pgdm: Complete Guide To Course & Admission
Author: Rohit Verma
11. Best Copado Devops Training | Hands-on Projects
Author: Visualpath
12. Power Automate Online Training | Microsoft Power Platform
Author: naveen
13. Canva For Beginners: Where Should You Start?
Author: Digital Marketing sample
14. Graduate Program In Management Studies: How It Can Support Your Career Growth
Author: Hetal Patel
15. Nebosh Fire Safety Course: Is The Fire Certificate Right?
Author: Gulf Academy Safety






