As per the HTML you have shared to click on the element with text as Login you have to induce WebDriverwait twice to switch through 2 child frame
and then again to locate the desired element as follows:
//SwitchTo mytestTopsubframe
new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(By.Name("mytestTopsubframe")));
//SwitchTo mytestsubframe
new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.FrameToBeAvailableAndSwitchToIt(By.Name("mytestsubframe")));
//Locate the desired element
new WebDriverWait(driver, TimeSpan.FromSeconds(20)).Until(ExpectedConditions.ElementToBeClickable(By.XPath("//a[@class='clslogin' and @href='linkref']"))).Click();
Note: You don't have to consider the presence of <frameset>
and can safely ignore those tags.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…