stefanroess / puppeteer-apex Goto Github PK
View Code? Open in Web Editor NEWApplication Express will be controlled via node.js API Puppeteer
Application Express will be controlled via node.js API Puppeteer
HI there Stefan,
Writing this issue in here as searching around does not have much result in puppeteer apex dialog modal .
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 )
//`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.