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