Autoit script fails to run in Chrome web browser

Here is the code snippet for uploading files using Firefox (.au3 file):

ControlFocus("File Upload","","Edit1")
ControlSetText("File Upload","","Edit1","C:\Users\chaithu\Desktop\fileupload.html")
ControlClick("File Upload","","Button1")

And here is the code for Chrome:

Sleep(1000)
ControlFocus("Open","","Edit1")
Sleep(2000)
ControlSetText("Open","","Edit1","E:\Selenium Jar files\screenshots\March\testimgs\general-surgery-1.jpg")
Sleep(2000)
ControlClick("Open","","Button1")

I encountered an issue where the code only works with Firefox and not with Chrome. Even though I created separate files for each browser due to dialog title changes, Chrome does not show any response when running the script directly or through Selenium WebDriver.

Answer №1

The code you've written for Chrome seems to function perfectly within the SciTE Editor. Perhaps the issue lies with Selenium? Have you considered utilizing the command-line interface instead?

Run("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe file:///E:/Selenium Jar files/screenshots/March/testimgs/general-surgery-1.jpg")

Opting for the command-line approach may present a more straightforward solution.

Answer №2

Consider enclosing this section of your code in a try-catch block as shown:


try {
   Runtime.getRuntime().exec("E:\\Script\\open.exe");
} catch(Exception e) {
   System.out.println("An exception occurred:" + e);
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Automatically refresh the webpage until the element becomes clickable using Python

Goal: Locate an available appointment Script: from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options from selenium.webdriver.support.ui import WebDriverWait from selenium. ...

Saving an alert message triggered by an action in Selenium using JAVA

I am currently working on running a test in TESNG to check for the presence of a specific popup message displayed on the screen. My experience with Selenium and Java is still at a beginner level. After performing an action by clicking a button, I expect ...

Is it possible to use Beautiful Soup to locate elements only partially?

During my attempt to parse content using Beautiful Soup, I encountered an issue. The specific link in question is: The information I am trying to extract from the site is at this location: https://i.stack.imgur.com/pEZHp.png Upon examining the HTML stru ...

How can we determine the selected web form element using the tab key in Selenium WebDriver with Java?

My current approach involves using the sendKeys(key,Keys.TAB) method to navigate a form. Actions action = new Actions(driver); CharSequence key = null; for(int i=0;i<42;i++) { action.sendKeys(key,Keys.TAB).build().perform(); } Aft ...

Tips for preventing errors when dealing with a non-clickable element in Selenium using Python

I encountered an issue with my selenium python script where I am trying to click on an element but it is not clickable due to some required conditions not being met. The error message displayed is as follows: selenium.common.exceptions.ElementClickIntercep ...

When trying to export a JSON file from an Angular app, the URL is prefixed with 'unsafe' and the download fails with a network error message

Looking for guidance on exporting a JSON file from an angular app. Below is the code snippet I am using: app.js file: app.config(['$compileProvider', function ($compileProvider) { $compileProvider.aHrefSanitizationWhitelist(/^\s*(htt ...

The captureNetworkTraffic method is not compatible with webbacked selenium

While conducting my tests with webdriverbackedSelenium, I noticed that it does not support the capture network traffic method. This is strange because webdriverbackedselenium should extend default selenium. Can anyone explain why captureNetworkTraffic me ...

Python: Determine the condition for exiting the loop

My goal with this code is to scrape data from a multi-page table on a website. Using selenium and bs4, I have successfully achieved this. However, I am facing an issue where the program gets stuck in a loop on the last page as the 'next' button ...

Chrome geolocation feature does not display the permission popup for JavaScript

After the latest Chrome update, we have noticed that the popup to Allow/Block accessing a user's location from a website is no longer appearing. We tested this on Edge, Firefox, and different mobile devices, where it seems to be working fine. Current ...

Steps for logging into a Google account using Selenium1. Open the browser

I attempted to access my Google account using Selenium and encountered a roadblock. From what I understand, there are some settings that need to be configured for this task. I have already attempted the following: View But unfortunately, it did not provi ...

A comprehensive method for locating every image on a website using Selenium with Python

I'm on a mission to locate all the images on a website without having to click through each one individually. Imagine the scenario where you land on a page full of images, clicking on the first image takes you to another page with more images or a sto ...

Having trouble with finding elements using the driver.find_element_by_xpath method?

<div id="primefacesmessagedlg" class="ui-message-dialog ui-dialog ui-widget ui-widget-content ui-corner-all ui-shadow ui-hidden-container" role="dialog" aria-labelledby="primefacesmessagedlg_title" aria-hidden=&qu ...

The type 'WebDriver' from Selenium cannot be resolved, and the type 'FirefoxDriver' cannot be resolved as well. This is not a duplicate issue

My first experience using this forum has been quite frustrating. My questions keep getting deleted as duplicates, even though the suggested solutions are not working for me. The initial problem was caused by incorrect jars, but I believe I have the correct ...

Ways to employ "before" in cucumber

Can you explain the process of using "before" to set up the driver instance and launch Firefox within a cucumber feature file? I have experience with background setup, but I am looking for guidance on how to utilize "before." ...

Unable to perform automated testing on Internet Explorer 11 on Windows Server 2016 with Selenium and IEWebDriverServer version 3.4.0

Operating System: Windows Server 2016 Datacenter (64 bit) Browser: Internet Explorer 11.0.14393.0 Protractor Version: 5.1.2 Selenium Standalone Server Version: 3.4.0 IEWebDriverServer.exe Version: 3.4.0 Java Version: 1.8.0_131 We are currently facing chal ...

unable to access Chrome's web inspector during a Selenium test

While conducting an integration test, I attempted to inspect the page by adding a breakpoint to my test. Once the test started and Chrome launched, the breakpoint was hit and the browser became idle. However, when I opened the web inspector, Chrome crashed ...

Unable to perform downward scrolling in Chromedriver using the Selenium WebDriver in Java

I've been experimenting with scrolling functionality using Selenium Webdriver. It seems to work fine in Firefox, but I'm encountering issues when trying it in Chrome driver. Below is the basic code snippet I'm using for scrolling: Actions a ...

Guide on using Selenium WebDriver for downloading APK files

I am currently facing an issue with downloading an .apk file using SeleniumWebDriver on FireFox. Even though I have configured the profile to auto-save, clicking on the download link for the .apk file triggers the opening of a download confirmation dialog ...

The input field keeps losing focus when typing in an AJAX search

I am facing an issue that I have been unable to resolve on my own. I created a search input with AJAX that provides suggestions while typing. The script works perfectly fine in Firefox, but when I try to use it in Chrome, the input field loses focus while ...

Encountering a problem with Chrome Extension localization upon installation - receiving an error message claiming default locale was not specified, despite having

Error Message: "The package has been deemed invalid due to the following reason: 'Localization was utilized, however default_locale was not specified in the manifest.' Issue: I have developed a customized extension and defined a default locale, ...