Forum 2.0

Replies

  • public static void main(String[] args) throws InterruptedException
    {
    System.setProperty("webdriver.chrome.driver", "C://DriversC//chromedriver.exe");
    WebDriver driver = new ChromeDriver();
    driver.get("http://toolsqa.com/iframe-practice-page/");
    driver.switchTo().frame("IF2"); // --> Getting into the frame., 'IF2' is the ID of the frame.
    Thread.sleep(2500);
    WebElement findElement = driver.findElement(By.xpath("(//a[@rel='bookmark'])[3]"));
    findElement.click();
    Thread.sleep(2000);
    driver.switchTo().defaultContent(); // --> Getting out of the frame..
    Thread.sleep(2000);
    WebElement findElement2 = driver.findElement(By.xpath("(//img[@class=' preload-me'])[4]"));
    findElement2.click();
    }

  • In software testing services before working on frames first we need to understand what is a frame. Frame is a part of web page which is embedded in another web page or an HTML document embedded inside another HTML document.


    Below are the ways to switch over the elements in iframes using Web Driver commands:
    By Index:

    • driver.switchTo().frame(0);
    • driver.switchTo().frame(1);

    By Name or Id:

    • driver.switchTo().frame("iframe1");
    • driver.switchTo().frame("id of the element");

    By Web Element:

    • driver.switchTo().frame(WebElement);
    The Best Software Testing Services Company - QASource
    Partner with the leading software testing company, QASource, and accomplish all your software testing goals within strict deadlines and budget. We pr…
This reply was deleted.
    results->result as $result) { ?>
  1. jobtitle;?>
    company;?>(formattedRelativeTime;?>)city;?>, state;?>

    APPIUM

    Blockchain Testing

    Welcome to Mobile QA Zone, a Next Generation Software Testing Community.Invite your friends to join this community.Write to us to become a featured member.