Coder Social home page Coder Social logo

puppeteer-apex's People

Contributors

stefanroess avatar

Stargazers

 avatar

Watchers

 avatar

puppeteer-apex's Issues

dialog/modal iframe

HI there Stefan,

Writing this issue in here as searching around does not have much result in puppeteer apex dialog modal .

chrome_xbqaigLTbS

this modal dialog appears when clicking on :

await frame.click ("ul#P11_MAIN_CONTAINER_cards a:nth-child(1) > span")

Apex dialog.modal doesnt seem to have id or name only src. i am unable to access the elements in this dialog/modal .

wonder if you have any guidance on this issue type. how does puppeteer cater to this type of "popup"

contentFrame[0] is valid
contentFrame[1] is valid at the base page.

however apex modal dialog appears after the click and thus blocks the puppeteer, so how does one go about handling dialog/modal? popup?

appreciate if have anything to share.

`

const puppeteer = require('puppeteer')
const config = require('../lib/config')
const homePage = require('../pages/HomePage')
const homePageObjects = require('../pageObjects/homePageObjects')
const loginPage = require('../pages/LoginPage')
const helper = require('../lib/helper')

describe('Home Menu Tests',() => {
let browser
let page

before(async function(){
    browser = await puppeteer.launch({
        ignoreHTTPSErrors: true,
        headless:config.isHeadless,
        slowMo:config.slowMo,
        devtools:config.isDevtools,
        timeout:config.launchTimeout,
        Args: ['--disable-notifications','--disable-web-notification-custom-layouts'
        ,'--user-data-dir=/home/aspats3/ess/profile','--disable-features=site-per-process' ],
        executablePath:'/usr/bin/google-chrome-stable',
     
        
    })
    
    page = await browser.newPage()
    
    page.setDefaultNavigationTimeout(0);
    await page.setDefaultTimeout(config.waitingTimeout)
    await page.setViewport({
        width:config.viewRepotWidth,
        height:config.viewRepotHeight,  
  
    })
   


    await helper.loadUrl(page,config.baseUrl);
    await loginPage.Login(page,'AB0001','concept');

})

//after(async function() {
  //  await homePage.Logout(page)
    //await browser.close()
    
//})



it('Verify My Team - List  ',async()=>{
     

    await page.reload({ waitUntil: ["networkidle0", "domcontentloaded"] });
    await helper.hover(page,homePageObjects.homeMenu);
    await page.waitFor(3000);
    await helper.clickX(page,"//a[@id='WJ2000']");
    await page.waitForNavigation({ waitUntil: ["networkidle0", "domcontentloaded"] });
    await page.waitFor(8000);
    //await helper.shouldExistX (page,"//*[contains(.,'Team Details')]")
    //await helper.shouldExistX (page,"//*[contains(.,'Management')]")
    //await helper.shouldExistX (page,"//*[contains(.,'Leave')]")
    //await helper.shouldExistX (page,"//*[contains(.,'Timesheets')]")
    await page.waitForSelector('iframe');
    await page.waitForSelector('#P1_IFRAME')
    console.log('childFrames count:', page.mainFrame().childFrames().length);
    console.log('pageFrames count:', page.frames().length);

    const iframeHandles = await page.$$('iframe');
    
    console.log('contentFrame[0] is valid:', await iframeHandles[0].contentFrame() !== null);
    console.log('contentFrame[1] is valid:', await iframeHandles[1].contentFrame() !== null);


    const elementHandle = await page.$('div#P1_LAUNCHER iframe');
    const frame = await elementHandle.contentFrame();
    await page.waitFor(8000);


    const newPagePromise = new Promise(x => browser.on('targetcreated', target => x(target.frame())));	
    

    await frame.click ("ul#P11_MAIN_CONTAINER_cards a:nth-child(1) > span")   click this for dialog modal iframe
	
	
    await frame.waitForNavigation({ waitUntil: ["networkidle0", "domcontentloaded"] });
    await page.waitFor(20000);
	
	
	//  from  here on cant get into dialog modal iframe ( nested iframe ) 
           //`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.