How to access a html page using selenium?

0 votes
I have a html code for a website and want to access it how can I do that?
Jan 14, 2019 in Selenium by Anjali
• 2,940 points
400 views

1 answer to this question.

0 votes

You will use driver.get() and instead of using a url you will specify the path where your file is. Here is an example:-

System.setProperty("webdriver.chrome.driver","C:\\Users\\Downloads\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("C:\\Users\\Desktop\\test.html");
answered Jan 14, 2019 by Pranjali

Related Questions In Selenium

0 votes
1 answer

How to know the exact time to load a page using Selenium WebDriver?

Normally WebDriver should return control to your ...READ MORE

answered Aug 23, 2018 in Selenium by Meci Matt
• 9,460 points
2,549 views
0 votes
1 answer

How to get a page name using Selenium Webdriver (C#)?

I believe the below thing works: driver.Title; READ MORE

answered Sep 14, 2018 in Selenium by Martin
• 4,320 points
351 views
0 votes
1 answer

How to get the HTML source of a webpage using Selenium in Java?

There is a method called getPageSource() in ...READ MORE

answered Jan 10, 2019 in Selenium by Sneha
4,944 views
0 votes
1 answer
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,510 points
2,218 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,870 points
1,825 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,870 points
1,819 views
0 votes
1 answer

How to extract text from a web page using selenium and save it as a text file?

Hello Isha, you can checkout this code ...READ MORE

answered May 7, 2019 in Selenium by Anvi
• 14,010 points
11,270 views
0 votes
1 answer

How to scroll up/down a page using Actions class in Selenium?

Hi Naetik, you can use Actions class ...READ MORE

answered Jul 4, 2019 in Selenium by Anvi
• 14,010 points
3,727 views