Sameera De Silva
2 min readMay 27, 2022

--

WebElement sn_polaris_layout=sn_canvas_appshell_root.findElement(By.cssSelector("sn-polaris-layout"));// So had to use css , here passes tag name.
WebElement iframe=sn_canvas_appshell_root.findElement(By.cssSelector("iframe"));// Tag is used
driver.switchTo().frame(iframe);
WebElement html=driver.findElement(By.cssSelector("html[class='ltr date-calendar tabbed']"));// Class is used
WebElement sn_polaris_layout=sn_canvas_appshell_root.findElement(By.cssSelector("sn-polaris-layout"));// So had to use css , here passes tag name.
// Using sn_polaris_layout, capture the iframe tag.(title=Main Content)
WebElement iframe=sn_canvas_appshell_root.findElement(By.cssSelector("iframe"));// Tag is used
driver.switchTo().frame(iframe); // There is #document but no need to capture it, simply switch to the iframe.
// Since now inside of iframe using class can capture the elements inside of it,
WebElement html=driver.findElement(By.cssSelector("html[class='ltr date-calendar tabbed']"));// Class is used

--

--

Recommended from Medium

Lists

See more recommendations