forked from Sonal0409/8PMJulyBatchJava-SeleniumPrograms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFramesDemo.java
More file actions
61 lines (23 loc) · 1.11 KB
/
FramesDemo.java
File metadata and controls
61 lines (23 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package seleniumScripts;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class FramesDemo {
public static void main(String[] args) throws InterruptedException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "C:\\Users\\vishal mittal\\Downloads\\chromedriver_win32 (12)\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize(); // maximize the browser window
driver.manage().deleteAllCookies();
driver.get("https://www.selenium.dev/selenium/docs/api/java/index.html");
Thread.sleep(3000);
driver.switchTo().frame("packageListFrame");
driver.findElement(By.linkText("com.thoughtworks.selenium.webdriven")).click();
Thread.sleep(5000);
driver.switchTo().defaultContent();
driver.switchTo().frame("classFrame");
driver.findElement(By.linkText("com.thoughtworks.selenium.webdriven.commands")).click();
Thread.sleep(5000);
driver.close();
}
}