Jump to content

Recommended Posts

Posted

Hi,

I'm using AutoIt in a robotframework test to handle a windows file dialog. The AutoIt script runs fine on my machine but the same

script on the PC of my colleague has a wrong @scriptDir path.

The line is: ControlSetText("Öffnen", "", "Edit1", @ScriptDir & "\..\data\Test.xml")

On my PC the path is as expected.

On the PC of my colleague the path is the windows user directory. I'm really puzzled.

 

Cheers,

Marc

Posted

@ScriptDir only shows the current scripts path, can you confirm where the script is running from?  What exactly does Windows user directory mean?  Do you mean the system account?

Posted

- The script is in the path G:\git\test\team_test\PBI_1\src\Script.exe

- The "Test.xml" file has the path G:\git\test\team_test\PBI_1\data\Test.xml

- With "user directory" I mean e.g. "c:\users\User_ABC"

 

Posted

Within g:\git is the git-repo. Inside the test is called which executes the AutoIt "Script.exe" file.

My guess is that's a (windows) configuration issue or something similar...

Posted (edited)
8 hours ago, marc1 said:

- The script is in the path G:\git\test\team_test\PBI_1\src\Script.exe

- The "Test.xml" file has the path G:\git\test\team_test\PBI_1\data\Test.xml

So the script is under the folder SRC, This means the path is wrong, since what you're saying to the script is basically that the test.xml is in a subdir of SRC..which is not, it is under data.

@scriptDir = G:\git\test\team_test\PBI_1\src

So when you combine it, like this @ScriptDir & "\..\data\Test.xml" it becomes:

G:\git\test\team_test\PBI_1\src\data\Test.xml

What you have to do, to keep the things as they are, is to simply remove some characters from the @scriptDir.

example:

StringTrimRight(@scriptDir, 4) ;Remove \src

This would equal G:\git\test\team_test\PBI_1

Then you can add the rest of the path on top of this and all will be fine, because Data does reside under it.

Sry for the long post.

Edited by careca
Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Posted

This is very weird. 

The solution was that my colleague compiled the same ".au3" script on his PC. It works.

Then I tried his .exe on my machine. It also works.

Posted

Maybe you have some fileinstall lines?

Lines that place the needed files in the right folders.

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...