Skip to content

[Question] page.keyboard.press('Enter') not working on Firefox #3231

@sreekanthjkprojects

Description

@sreekanthjkprojects

Hi Team,

I was trying to login to application, below is the code:

const playwright1 = require('playwright');
const PAGE_URL ="https://xxxxxx";
const browser_run = "Chrome";
const HomePage = require('../POM/homepage.js');
const assert = require('assert');

describe(`Test app`, () => {
    //this.timeout(10000); 
let browser;
let page;
let context;
before(async () => {
 
});

after(async () => {

});
beforeEach(async () => {
    browser = await playwright1.firefox.launch({headless:false});
    context = await browser.newContext();
    page = await context.newPage();
    await page.goto(PAGE_URL); //, {        waitUntil: 'load', timeout: 0 //waitUntil: "networkidle0",
      //});
            
   await page.fill('id=userID',userid);
    await page.fill('id=password',password);
    //await page.press('id=loginbtn','Enter');
    await page.keyboard.press('Enter');  //**not working only on firefox**
     

});//.timeout(5000);
afterEach(async () => {
   await page.close();
   await context.close();
});



it('Validate Account viewer browser error pop up', async () => {
    await page.waitForSelector("//input[@placeholder='Enter Account ID']", {
        visible: true, timeout: 90000
        })
        await page.waitForSelector("(//button[text()='Go'])[2]", {
        visible: true, timeout: 90000
        })
    
    await page.fill('//input[@placeholder="Enter Account ID"]',"34324");
    
    await page.click('(//button[text()="Go"])[2]');
    
});//.timeout(60000)

});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions