I am using selenium for one for my Java applications on linux. The application invokes a mozilla browser, fills login details (username and password), and then submits the form. I am able to achieve this using selenium, but every time a url is selected 2 instances of mozilla is getting invoked. One instance is that of the url selected and the other instance is a RemoteRunner.html which has selenium command history and other details.
I don't want this page to be invoked. Is there a way to stop this page from getting invoked?
Thanks and Regards,
Sunil.
The RemoteRunner window is required as it is controlling the application under test within the other window. You can run Selenium in a single window using the command line option multiWindow=false however this uses frames, which can sometimes cause issues with the application under test.
Related
I am new to selenium automation testing, Is there a way to kill remotewebdriver session without closing the browser?
Also is it possible to wait for user intervention (say Click on certain element)
I googled my queries, but couldn't find any answer I was looking for.
EDIT 1:
I was doing a little POC on a customer relation service app, where csr will click a button and it will open an external application, and take him to a form, where some information will be populated automatically by selenium and some information will be populated by csr's manual input.
So far in the Project, I have a spring mvc 4 application. There is a REST controller. Upon posting a json to my controller, it call invokes a service method which opens selenium remote webdriver.
1.I want my browser to stay opened until user press submit button.
2.I want to take csr to the desired page and lose the control of selenium, afterwards csr will submit the page or close the browser depending on situation.
currently during debug of test cases selenium is opening a new firefox window, in whatever desktop screen it chooses. I want to be able to have selenium attach to the existing window (and not close the window when the test is over.)
I see this in the selenium documentation
webdriver.firefox.useExisting Never use in production Use a running instance of firefox if one is present
but I do not see how to set it from rails/rspec/capybara
I have looked at the related SO answers, and they are more to do with attaching to a running test. I just want to control where the window is, and be able have the window open with the developer console, so we can see what is going on, and finally have the window stay open at the end of the test
Depends on the issue 2163 it was a feature of Selenium 1 and not implemented to Selenium 2 but still stays in documentation. Check this issue.
Using Selenium IDE, I recorded one testcase that contained a click url, then give the username and password and clicked the button to navigate to next page.
In the render page, if I click any link the error is shown as Element link=linkname not found.
Why does this error occur?
Page is fully loaded when that command is executing?
If not just put waitForPageToLoad or pause command.
waitForPageToLoad | timeout
Or
pause | 5000
Also you can use command clickAndWait for button after entering username and password
There are different ways via which you can handle such issues. The issues can be of rendering as username and password click is fine as you will rest on same page when you enter values in these test boxes.
But as soon as you click on submit button then application has to load a new page with the credentials you have just added.
So this requires some time in terms selenium. What you can do is you can put some waits just after this action. So far selenium provides two types of waits Explicit and Implicit waits.
And you can try thread.sleep() , its a java type of method which is also a kind of wait. But implicit and explicit waits are highly recommended in Selenium coding.
You can refer to this blog for more knowledge on waits (http://khyatisehgal.wordpress.com/2013/05/09/how-to-handle-timeouts-implicit-and-explicit-waits-in-selenium/)
Khyati Sehgal
In order to automate DOH tests during our build process, I use Selenium RC to launch different browsers (IE and Firefox) on a server placed on a different domain than the build machine. Each browser is directed to our runTests.html in order to start DOH.
Sometimes, when a test that uses doh.robot starts, the following message is shown:
"DOH has detected that the current web page is attempting to access DOH, but belongs to a different domain than the one you agreed to let DOH automate. If you did not intend to start a new DOH test by visiting this Web page, press Cancel now and leave the Web page"
but since these tests are unattended it just sits there waiting for someone to click OK, and Selenium times out (in IE 8 it seems like the pop-up disappears automatically but the robot does nothing afterward).
As I said, it doesn't always happen. After you click OK on the Pop-up, the message will stop showing, and the message can go away for several sessions, but then it will show again in which seems to be an arbitrary way.
Does anyone knows a way to prevent this pop-up from showing?
This is probably not the correct way to do it, but in util/doh/robot/DOHRobot.java, you may be able to modify the code to not check that or always simulate pressing "OK". I haven't tried it myself, but I may also need to do that for some of our automated testing.
When the DOH robot is initialized, it first tries to click in the upper left corner of the page you are trying to test. If you obscure this div (you can see it with firebug), then the message will pop up. I think the problem is that your page isn't always loading up quick enough.
It is somewhat of a challenge to fix this. I haven't used DOH in awhile, but I don't think there is any way you can use a setTimeout to fix this. (You can try using setTimeout on the doh.run command, but it might be the case that the DOH robot clicks that div before parsing any doh commands.)
Another thing you might be able to do is add a sort of "wait" command to Selenium, or whatever shell command you are using to fire up the system.
I am using Selenium-python script for web test automation. When ever I use selenium inbuilt commands, I will get Attribute error during run time.
Ex: selenium.WindowFocus("preview_email") throws "AttributeError: class selenium has no attribute 'WindowFocus'"
I am new to test automation. Help me to sort out this problem.
The command that you are looking for is selenium.window_focus()
I have never used the Python client personally, but a quick glance at the selenium.py file reveals that there is a window_focus command which gives the currently "selected" window focus ("selected" in Selenium terms is the window that Selenium is currently executing commands against and not necessarially the window that has user focus).
Executing the select_window command with a window ID will set tell Selenium which window you want to execute commands against.
I have had some trouble w/ popups in general and the way the Selenium IDE and RC clients attempt to locate new windows and/or there parents. Good luck.
I think you want to force web-driver to go to another window with name "preview_email".
For this purpose, you need to use selenium.switch_to_window("preview_email"); because selenium.window_focus() just gives focus to the currently selected window and accepts no arguments. Additionally you used it in JAVA mode (I mean selenium.windowFocus()).