self.browser = self.playwright.chromium.launch(
headless = False,
slow_mo = 2000,
devtools= True,
args = [
r"--user-data-dir=C:UsersuserAppDataLocalTempchrome_profile",
"--allow-pre-commit-input" ,
"--disable-background-networking","--disable-backgrounding-occluded-windows","--disable-blink-features=AutomationControlled",
"--disable-browser-side-navigation","--disable-client-side-phishing-detection","--disable-default-apps" ,"--disable-dev-shm-usage","--disable-extensions",
"--disable-features=VizDisplayCompositor","--disable-gpu","--disable-hang-monitor" ,"--disable-infobars" ,
"--disable-popup-blocking" ,"--disable-prompt-on-repost","--disable-setuid-sandbox" ,"--disable-software-rasterizer","--disable-sync","--disable-web-security","--enable-automation",
"--enable-logging ","--ignore-certificate-errors" ,"--log-level=0 "," --no-first-run",
"--no-sandbox","--no-service-autorun","--password-store=basic","--proxy-bypass-list=*" ,"--proxy-server='direct://'","--remote-debugging-port=0" ,"--test-type" ,
"--use-mock-keychain","--user-data-"
]
self._browser = BrowserType.create_browser(browser_type)
self._context = self._browser.new_context(
no_viewport = True,
accept_downloads=True,
bypass_csp=True,
ignore_https_errors=True,
permissions=["geolocation", "notifications"],
)
self._context.clear_cookies()
self._context.add_cookies([{
'name': 'name',
'value': 'value',
'domain': 'domain',
'path': '/'
}])
self._page = self._context.new_page()
<!-- BUTTONS START -->
<br>
<input type="button" id="rules" name="rules" value="Rules" class="button-raised-primary" onclick="execute(this.form, 'rules');" accesskey="" style="">
<input type="button" id="marketReport" name="marketReport" value="Launch market report" class="button-raised-primary" onclick="execute(this.form, 'marketReport');" accesskey="" style="">
<input type="button" id="factReport" name="factReport" value="Launch fact report" class="button-raised-primary" onclick="execute(this.form, 'factReport');" accesskey="" style="">
</tr>
</tbody></table>
</div>
<!-- BUTTONS END -->
This is how i am launching the playwright browser and navigating to pages and when clicked on certain buttons the expected alert pop-up is not coming but if i refresh the browser manually by pausing the execution the pop-up starts appearing on those button click.
Also have provided the HTML of those buttons
say When i click to marketReport button the alert pop-up should appear but through playwright browser nothing is happening.Also in console execute function is not searchable which if i search through manually launched browser it works fine.
Button clicks should throw alert pop-up every time.
I have tried modifying the args that we pass to browser during launch but it didnt work.the alert pop-up should open on clicking buttons without manual intervention