Is it possible to instruct Selenium to use a randomly generated value (name) for further testing?
I have only just started using Selenium and have very little knowledge on the program. I have created a script that generates a random name, I want to be able to take this name and include it in another test
hope this makes sense! appreciate anyone's input
Capture the random name to a string and make it static. Use in other tests by calling it.
Can you please post some code where exactly you stuck? Are you using Selenium Webdriver?
Related
I have a situation where the IDs of all elements are unique GUIDs, regenerated on each page load.
So I can't use IDs, although Selenium IDE defaults to IDs for obvious reasons.
My workaround is to record with Selenium IDE, then go back and manually edit the IDs to replace them with the right XPath, but this is really time-consuming.
Is there a way it can be set to use XPaths instead of IDs, by default?
Or is there another similar application/extension which can do this?
Selenium IDE/Katalon... recordings can be an OK starting point, depending on who you ask, but you need to go over them.
XPath expressions are specially tricky and often need to be worked on after a recording tool obtains them.
There is no way around this even if you can get the tool you are using to use xpath by default somehow.
I have a selenium test that i need to repeat, but each test i need to use a different value and different linkText target. Is there a way to do this? Included is a screenshot with the highlighted parts i need to change each time i run the test.
Eager to learn. Your help/advice would be much appreciated.
Screenshot of Test
Basically, I want a free testing program that will allow me to create MANUAL tests with a series of steps where I can mark steps as passed or failed. I would like it to behave much like SpiraTest but it must be Non-web based.
In other words, I might write a test like:
Step Description Expected Actual Pass/Fail
1. Run Program Program should start Pass
2. Click Open Open dialog displays Pass
3. Select file Program opens file Pass
Anyone know if such a thing exists?
And no, I do not want any automated testing stuff, this must be manual user testing. Thanks!
I use Excel / Spreadsheet for recording detailed test steps. I think that should pretty well solve your problem.
I'm using Selenium IDE and would like to know if it is possible to use a Selenium command, within a Selenium command.
For example to use verifyElementPresent('someelement') within a storeEval command to store true/false.
I know this could be using JS, but using Selenium IDE's built in commands would be very time-saving!
If I understand correct, you want to create Selenium Nested function. The answer is No, it cann't.
For the SeleniumIDE reference, you will see that there are 3 parts of command (command, target, value). it also no function to store the command result, if you see the HTML code when you create the Selenium test script, you will see that it totally seperated the command to three sections.
I cannot find the document that selenium said it doesn't support to create the nested function. However, it will be get more complexity when you going to test something but the test script itself already complex. I would suggest you to store something you needs in user-extension.js, otherwise, done it by test script in your programming language you want.
Selenium have command storeElementPresent(locator, variable)
See http://release.seleniumhq.org/selenium-core/0.8.0/reference.html
I am trying to build a macro in selenium ide that stores the page source to a file. I see there is a command storeHtmlSource() that stores the page source to a variable, but I can't figure out how to store the contents of the variable to a file. Is there some direct way to do this or do I need to somehow have it execute javascript to do that?
I am totally new to selenium if that was not already obvious, but I have looked around the docs for a while and haven't figured it out.
Unfortunately you can not do this with Selenium IDE. The IDE has not been designed to do things like this since there is Selenium Rc that allows you to do what the IDE can do and more since you use your favourite language to speak to a proxy and then use that language's ability to write things to the disk.
The IDE is designed to help you get the skeleton of a test case with the record function, you then tweak it, replay to see it works and then export to your favourite language