I'm looking for a way to open a new window and have control over it so i can continue testing it. The select window command requires the handle of the new window but I have not yet found how to retrieve this handle. Please do not answer me if you have not personally tried the solution you want to propose with version 3.17.0 or later of Selenium IDE.
I spent many hours looking for a solution that works with the Selenium IDE in version 3.17.0 or higher. I am not looking for a solution that makes use of java code or other language, i am looking for a solution that can be used in the Selenium IDE plugin, especially for the Firefox browser. The web is full of examples and tutorials but none working with version 3.17.0 o superior.
This is an example (not working because win_ser_1 is not good) of what i'm trying to achieve:
Thanks for any help
For the example you give I don't have an exact answer since you open a new window with JS.
But if you for instance have link that opens a new window there is options in SeleniumIDE to store the new window handle.
I'll show an example. I have a button that triggers a new window to pop up.
Here is how to store the handle:
Be sure to check the checkbox:
here is how I use it in the script:
Related
I have looked at many answers
Selenium IDE:Opening in new tab and shift focus to new tab not working
How to open link in new tab etc....
posted regarding this question but not even a single one is 100% relevant therefore, I am asking this again.
I need to open three different links:
google.com
yahoo.com
microsoft.com
in three different tabs but under same window and I am using selenium IDE, I know, it is easier using WebDriver but unfortunately I am using IDE. If I use Open it just opens the next link in the same tab and when I use OpenWindow or openWindowAndWait, it just opens the new window which I do not want.
Can someone please help..
There's no command within Selenium IDE which directly relates to Tabs, Selenium IDE is just not built to work with them. There's a post fro ma few years ago which references an answer from a selenium dev stating this (Selenium IDE for Firefox Ctrl-Tab)
The only way to potentially get it working would be to use send Keys to simulate Ctrl+T to open a new tab. There's a post here which gives details on it.
I recently started using robotframework with the Selenium2Library. I haven't tested using Selenium before, but I know it is possible to record tests using Selenium. In RobotFramework, it says, "it is not possible". I mean even for a simple login test, I need to write the test, specifying the id of username, password and submit button.
However, is there any way by which these tests can be recorded using robotframework? such as clicking on a text box, entering a string and then clicking on submit button etc., and automatically generate the test case source code instead of having me to write the test cases. Is this possible with robotframework or any external library that it supports?
robotframework wasn't designed to be a record-and-play tool, and has nothing built-in to support that.
There was someone who wrote a selenium IDE plugin that would generate robot keywords, but that was years ago. The github repository is here: https://github.com/denschu/selenium-ide-format-robotframework
The code hasn't been touched since 2012, so I doubt it's of much use.
Using this Firefox add-on, FireRobot we can generate most of the code and also using this you can select the elements on the screen and get related code suggestions on right click like
Wait Until Element Is Visible
Click Element
and all operations to perform on the selected element.
I'm trying to make automated tests for a site, using Selenium IDE (not Selenium Server, RC, 2.0, and WebDriver).
I want to be logged in with user 1 in Firefox window 1 and open a Firefox private window to sign in with user 2. I need this because the website I want to test doesn't allow multiple users signed in in the same browser at the same time.
So:
1) Is there a way to open a private/incognito window?
2) How do I then switch back to the main window?
Here's how switching between simple windows looks like:
http://i.stack.imgur.com/P5bbt.png
In the attached image you can see how I solved the problem:
It works fine with Firefox version 42.0 (and earlier versions). With Firefox 43 I have some problems because "openWindow screen2" does not overwrite my window I open with javascript but opens an own window. I'm looking for a solution for this issue.
As far as I'm aware this isn't something that Selenium IDE can do. The best solution I can think of would be to use something like Autohotkey and combine the it with Selenium.
With AHK you can set a script to mimic the keyboard command to open a private window (ctrl+shift+p). When I've used it with selenium in the past I've set the AHK script to start when it detects a certain window title, and then had selenium call a javascript function from the user-extensions to amend the title of the page you're on to the title which will trigger the function when you need the AHK script to run. (Best not to use the default one, otherwise you could end up with countless private windows if it hits that page multiple times).
Try this,
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.setPreference("browser.private.browsing.autostart",true);
I am having an issue with finding a popup window in some selenium test code. I am looking at the screen on the test runner and there are two IE windows, one of them is the popup and one of them the page which generated the popup. However selecting that window with
SelectWindow("name=SomeName")
fails. Putting a break point in there and running some diagnostics shows that
GetAllWindowNames()
returns only one window. Very odd. I have duplicated the problem in IE, chrome and firefox so I don't think it is browser specific. I am using C# to drive my tests. Any idea how I might solve this issue?
Edit:
I looked a bit more at how this page actually creates its popup by reloading itself with window.open added to its code. It is rather an odd way to open a popup but I don't see any reason why it isn't valid.
Is there title or some other attribute in popup window's source code? You can locate that using any info you find there. Try to record open popup window in Se IDE and click on something in that popup window. Usually this trick works.
IIRC, there are some situations where SElenium fails to register the window. In this case you can register the window anyway by using the openWindow(ยดยด, ). I think this is described in the explanation of openWindow in Selenijum IDE...
I've got a rather Javascript-heavy page with lots of contents generated via AJAX or other scripts. On some of these elements Selenium can record mouse clicks, while on others it ignores them. I haven't found any correlation. Perhaps there are some known common scenarios where Selenium cannot intercept mouse clicks?
Unfortunately not all clicks in Selenium are equal. Some are mouseDown and MouseUp or a variation on that. I would play around with that to get your app working.
Unfortunately Selenium IDE has been misrepresented. It is a Record/Tweak/Playback tool not a record/playback tool.
There's no list of actions that are unreliable. In my experience there's no pattern to which elements work, but it's consistent throughout executions of the test. In case you were thinking about it, playing around with locators or UI-Elements is very unlikely to improve your results.
I recently had a situation with a number of dropdown menus, all implemented in the same way, on multiple different pages. On certain pages, dropdown #2 and #3 wouldn't work, yet on other pages they would work, but dropdowns #1 and #2 wouldn't.
As has already been pointed out, the best thing to do is stop thinking about Selenium IDE as a record-playback tool.
On a sidenote, you may be asking this question for a similar reason I was, which was wanting to use Selenium IDE as a frontend for teammates without Selenium programming experience to create tests with, then one thing I did find helpful was extending the Selenium IDE by adding a Command Builder, which allows you to control what appears in the right-click menu when using the IDE.
This means you can press record, go about recording your test as normal while keeping an eye on what has been recorded. Once you see Selenium IDE has failed to record an action, you can just right-click the element and the action you wanted to record will be easily available.
Not a solution to your original question, but it's helped me out. It's very simple to write an extension to the right-click menu, there's some really good examples on this Selenium website.
I'm a 100% selenium noob, but I had the same problem and solved it through the following workaround:
Right-click the to-be-clicked item
Choose a random command that has the entire locator text, e.g. assertText //div[2]/div[5]/table/tbody/tr[1]/td[1]/div IR or something. Look inside "Show all available commands" too.
In the Selenium IDE, change the command to "click" and remove the 2nd argument (the Value field; if any)
Hacky, and should be easily improved with a custom command in the right-click menu, but for now this works fine for me.
Did you try clickAt with location (0,0)? It sometimes helps
If you have assigned an ID to the element you want to click I would suggest you try a simple script, you can perform this through the IDE:
runScriptAndWait
jQuery("#yourButton").trigger('click');
I have used this in the past and it works just fine.