Rayrun
← Back to Discord Forum

**Issue:** Single click or double click on an element refreshes the page. How do I avoid that?

tester_11943posted in #help-playwright
Open in Discord
tester_11943

Code Snippet:

if (createUser) await loginPage.uploadModel();

await pd.selectAndRightClick(page, locators);
// Wait for the context menu to render and appear
await page.waitForTimeout(1000);

await page.locator(homePageLocators.simulateModelMenuItem).click();
// Click the save button
await page.locator(homePageLocators.saveBtn).click();

await delay(10000);

await page.locator(bpnmmodelSimulationLog).dblclick(); 

await delay(15000);
console.log("DOUBLE CLICK DONE");

const newPage = await switchToDiscovererTab(page);

This thread is trying to answer question "How can I prevent a single or double click on an element from refreshing the page in JavaScript?"

1 reply
tester_11943

Issue: Single click or double click on an element refreshes the page. How do I avoid that?

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].