-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFramePractice
More file actions
33 lines (27 loc) · 1.02 KB
/
FramePractice
File metadata and controls
33 lines (27 loc) · 1.02 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
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Support.UI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ecommerce_Project
{
public class IFrameClass
{
[Test]
public void Test()
{
IWebDriver driver = new ChromeDriver();
driver.Manage().Window.Maximize();
driver.Navigate().GoToUrl("https://rahulshettyacademy.com/AutomationPractice/");
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
IWebElement element = wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.Id("courses-iframe")));
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
js.ExecuteScript("arguments[0].scrollIntoView(true);", element);
driver.SwitchTo().Frame("courses-iframe");
driver.FindElement(By.XPath("//a[text()='All Access plan']")).Click();
}
}
}