Hello all,
new user to ranorex and have a question.
I have a File > open dialog box which changes it default opening location depented on the last location used to open a file.
For example,
I select open > File and its in the default install folder.
browse to C:/Test/images and open an image.
Close the app
Reopen and the default location has changeged from install folder to "C:/Test/images "
I want to be able to check the drop down box of the File open dialog value and if its not the default install folder then browse to that folder.
Any help would be great
Cheers
Validate with Ifs for combobox
Re: Validate with Ifs for combobox
First option is to read the text of the dialog at runtime. If it is not what you want, then perform the action to change the location.
Second option is to always perform the option to change the location. It's not like it is a large time consumer to change the option, and you have to write the change location method regardless of the first or second option.
Second option is to always perform the option to change the location. It's not like it is a large time consumer to change the option, and you have to write the change location method regardless of the first or second option.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
Re: Validate with Ifs for combobox
I have the option to change the location done and all, its just making it work based on an If.
For example, I have one recorded script that does the change, named FileOpenDemoImageLocation
So when the script checks the drop down box for "images" text it should continue the test as nomarl.
If "images" is not in the drop down, it must run FileOpenDemoImageLocation to move to this location.
if "combobox" text ois not images
then run FileOpenDemoImageLocation
else
continue test
Been trying many ways but my syntax isn't up to scratch yet
Thanks
J
For example, I have one recorded script that does the change, named FileOpenDemoImageLocation
So when the script checks the drop down box for "images" text it should continue the test as nomarl.
If "images" is not in the drop down, it must run FileOpenDemoImageLocation to move to this location.
if "combobox" text ois not images
then run FileOpenDemoImageLocation
else
continue test
Been trying many ways but my syntax isn't up to scratch yet
Thanks
J
Re: Validate with Ifs for combobox
Here is some c# pseudo code... Since I don't know your elements, XPaths etc I can't write specific code for you...
Code: Select all
//First read the test in the combobox and set to a variable
ranorex.combobox MyCombo = XPath to the combobox;
string MyPath = Mycombo.text;
//Now do the test
if (MyPath != "C:/Test/images")
{
//Do your work here to set the combobox path
FileOpenDemoImageLocation ();
}
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
Re: Validate with Ifs for combobox
thanks Ciege, your a gent, was able to get it working now.
Thanks
J
Thanks
J