I'm new to Selenium IDE. Right now I'm trying to store the filepath/URL of an image on a webpage, and then verify that the filepath/filename follows a set of filename conventions.
The progress so far:
I've installed a user extension that allows me to use a command called "storeImagePath". I can store the filepath/filename of the image and save it as a variable called imagePath.
What I'm stuck on:
I can echo ${imagePath} and it's giving me the correct filepath, but I don't know how to even compare the imagePath variable to the real filepath. I want to do something like a VerifyEval of the variable and compare it to the path that I paste in for testing purposes. I tried "type"-ing the variable into an input element and then doing some sort of VerifyText against that but it didn't work. Am I overlooking a very easy solution?
Keep in mind I'm using Selenium IDE and I'd like to stick with this until I'm proficient at it before moving onto RC. Although if what I'm trying to do isn't possible in IDE, you can tell me that. Thanks in advance.
Edit: I'm not sure how clear I'm making this; for the time being I just want to compare ${imagePath} to the URL that I'll paste in myself. Once I'm done with that I can start figuring out how to define the accepted filepath/filename conventions.
If your ultimate intention is to verify that the stored variable match a specific format, then you can use verifyeval function eg.
verifyEval | storedVars['imagePath'].search("ur reg ex")>0 | true
or any of the javascript string methods to do the comparison
Related
I'm new to uipath so forgive me if this is an easy question. I am using Get Text to retrieve some data from a table. I select Save For Later. How would/can I use a variable as part of the values name? Im not sure if it can actually be done, I'm just thinking of what I can do in php but I know uipath is a different beast. I've tried the following code in the "Give your value a name" field but it dosent work.
"random text" + variable
Lets say I have a variable called "money", I then create another variable but I want the value of the variable "money" to be part of the 2nd variables name...if that makes sense
You should first go to the (free) UiPath Academy, as this is such a basic question, actually.
But anyway to give you something here, let me solve your question.
Go to your Get Text activity
Rightclick into the Output value field
Select Create variable and set name to e.g. "test"
Now you can use that variable wherever you want (keep care of the scope for sure)
Enterprise Architect 13.5.
I made MDG technology extending Object metatype. I have a shape script for my stereotype working well. I need to print several predefined run-state parameters for element. Is it possible to access to run-state params within Shape ?
As Geert already commented there is no direct way to get the runstate variables from an object. You might send a feature request to Sparx. But I'm pretty sure you can't hold your breath long enough to see it in time (if at all).
So if you really need the runstate in the script the only way is to use an add-in. It's actually not too difficult to create one and Geert has a nice intro how to create it in 10 minutes. In your shape script you can print a string restult returned from an operation like
print("#addin:myAddIn,pFunc1#")
where myAddIn is the name of the registered operation and pFunc1 is a parameter you pass to it. In order to control the script flow you can use
hasproperty('addin:myAddIn,pFunc2','1')
which evaluates the returned string to match or not match the string 1.
I once got that to work with no too much hassle. But until now I never had the real need to use it somewhere in production. Know that the addin is called from the interpreted script for each shaped element on the diagram and might (dramatically) affect rendering times.
I am currently working on a Testing Automation team, using Python and Allure to make reports of all the test cases that we run. Sometimes we deal with sensible data (e.g: passwords) that I can't show on the reports. If I use a function with a step decorator, something like this:
Which takes an element (a text box) and enters the value in it. In the step function I display the value that I want to enter, I could easily change that but the problem resides in the actual report. No matter what I enter on the step title, the report always shows the info that was passed as arguments to the function:
Thus, the "value" argument will always be displayed and that is something that I cannot have on certain projects. Is there anyway to make a custom step function that solves my problem?. I could either use with not showing the value at all or to change it to something like '*****'.
Just a thought.
#allure.step("Entering a value in element {3}")
def setSecureBoxValue(driver, element, value, box_name):
I solved my problem with the use of Fernet cryptography library.
I created a new function for the sensible data that encrypts the strings and then, inside this new function I call the one I shared on the screenshot (with a slight modification to decrypt the data). This results in the following report:
I have a file variable in d3 pick basic and I am trying to figure out what file it corresponds to.
I tried the obvious thing which was to say:
print f *suppose the file variable's name is f in this case
but that didn't work, because:
SELECTION: 58[B34] in program "FILEPRINTER", Line 7: File variable used
where string expression expected.
I also tried things like:
list f *didn't compile
execute list dict f *same error
execute list f *same error
but those also did not work.
In case any one is wondering, the reason I am trying to do this in the first place is that there is a global variable that is passed up and down in the code base I am working with, but I can't find where the global variable gets its value from.
That file pointer variable is called a "file descriptor". You can't get any information from it.
You can use the file-of-files to log Write events, and after a Write is performed by the code, check to see what file was updated. The details for doing this would be a bit cumbersome. You really should rely on the Value-Add Reseller or contract with competent assistance for this.
If this is not a live end-user system, you can also modify an item getting written with some very unique text like "WHAT!FILE!IS!THIS?". Then you can do a Search-System command to search the entire account (or system) to find that text. See docs for proper use of that command.
This is probably the best option... Inject the following:
IF #USER = "CRISZ" THEN ; * substitute your user ID
READU FOO FROM F,"BLAH" ELSE
DEBUG
RELEASE F,"BLAH"
END
END
That code will stop only for one person - for everyone else it will flow as normal. When it does stop, use the LIST-LOCKS command to see which file has a read lock for item "BLAH". That's your file! Don't forget to remove and recompile the code. Note that recompiling code while users are actively using it results in aborts. It's best to do this kind of thing after hours or on a test system.
If you can't modify the code like that, diagnostics like this can be difficult. If the above suggestions don't help, I think this challenge might be beyond your personal level of experience yet and recommend you get some help.
If suggestion here Does help, please flag this as the answer. :)
I am working on an application to search for and build a list of all the times a string (or variable of) is in a text file. Kind of like a Find All function in a text editor that I can build a list with the info that is found, such as
S350
S250
S270
S5000
What can I use to do this search? It will have one value that does not change (The S in this case) followed by up to 4 digits
RegEx seems like a good choice.
Something like.. S(\d{1,4})? might work for you.
Expresso is my preferred regular expression composer.