Need Help on chrome drive run test, everytime i run test I Agree appear and test stops - selenium

hello everyone i am new .
last night i was trying to do a test looking at tutorial but when i start run test chrome opens up at the screen "before you continue to Google Search " Customise or I agree screen , test does not go further. i will post screen shot too, i have been looking for answer for few hours on internet but i can not find any. enter image description ,no matter what for test i run test stops when chrome browser pops up .i have downloaded in correct way chrome drive
everytime run test it stops at Customise I Agree screen
everytime run test it stops at Customise I Agree screen
everytime run test it stops at Customise I Agree screen

Hmm, Selenium is better for opening a website and not searching. If you have a website in mind I would just put in the URL instead of searching. You could do:
https://www.google.com/search?q={thing you are searching here}
If you need any more help let me know!

Related

Selenium IDE "Tab not found' although it is open

I'm using Selenium IDE to automate some browser processes, I need to do a test from which I open the source code of a page (view-source:https://www.youtube.com/watch?v=JeQuelXsUYA) and trying to find a certain word, I am using youtube as an example, however when clicking on "Select target in page" the following error appears "Tab not found / No guide is available for this test case, please keep recording or play. " I've tested it with several pages, and command recording works fine, but every time I open the page's source code, the selenium IDE doesn't record the commands.
Thanks in advance.
[![This is the image of the error, the first script I ask to open the page's source code works, however when I try to select target in page, the error appears, as if the page were not open.1

Element link not found in Selenium

I am executing a simple recorded script in Selenium , in which i just search a page in Google and then click it , but when Run that recorded script it is giving me the "Error [error] Element link not found".
And following is the Script which i am running,any help would be very useful.
New Test
New Test
open
/
type
q
Bill Gates
click
link=Bill Gates: Chairman
click
link=Bill Gates: Chairman
I got the same error message while going through the tutorials online. I found out that the scripts were running too fast for FF to load the links. If you slow down the playback by moving the green button on the Fast-Slow bar to somewhere in the middle the scripts run without any errors.
I guess I know the answer. It might be bcz of any javascript error(you can see that on the status bar at the
Right corner(IE)) or that link element might not be placed correctly in the box(box model).
Here you can use
Selenium.focus("link=text")
:selenium.keyPressNative("10") . It presses the enter key.but while selenium is executing this statement
Do not change the focus from your AUT (don't touch the mouse).
In IDE ,just paste the above statement on click().
Well, I don't think you have to slow the speed down. You know the problem is caused by clicking on the link before it is available, so you could add an extra command waitForVisible (e.g. link=Bill Gates: Chairman) before the clickAndWait command.
Im assuming you are using Google instant as there is no "click search button" command, the link is probably not preset because selenium is not waiting for Google instant to respond or the javascript to render the link. If you manually add in a click command to search it should solve it.
My solution is almost the same as Cuongs. Though I change the speed by using a command and change it back afterwards.
Before you click the link, you can set the speed to slow:
Command: setSpeed
Target: 3000
You can change the speed afterwards again to ~1000
I also had same problem. I did two things which fixed the problem. I changed the speed in Selenium IDE from fast to slow (located at top left of IDE), and I minimized the IDE after hitting play button. I guess for people using only one monitor, minimizing Selenium IDE would help the test find the thing it is looking for; for ppl with two screens, opening Selenium IDE in one screen, and opening browser in another screen would be best.
Info: Installing this plug-in (Selenium IDE: Flow Control) fixed lots of unexpected errors for me while playing with Selenium IDE:-
https://addons.mozilla.org/en-US/firefox/addon/flow-control/?src=dp-dl-othersby

Why are Selenium IDE playback controls inactive? (How can I run recorded tests?)

I started learning how to use Selenium today. I have never used it before. I downloaded the Selenium IDE (1.0.10) plugin for FireFox (3.5.16). The way it's behaving is not matching up to the docs.
When I click the record button and perform actions in my browser, nothing happens in the IDE (nothing is recorded). (Actually, initially it did record, but now it doesn't) I tried restarting FireFox and that had no effect.
Also, the main controls are now inactive. I've included a screen shot to show what I mean by that. The controls remain inactive even it I click or double click on the name of a test case in the panel on the left.
And one final question -- it appears that a Selenium test case mentions Chrome in its default configuration even though the docs say you can only record tests using FireFox. Should I do anything about that?
If anyone can shed light on any of the above mysteries I would appreciate it. Thanks!
UPDATE
I restarted FireFox again and now it's recording actions, but the controls are still greyed-out as in the screenshot, so I can't play back the test.
The issue is that you are not in the HTML runner mode. The IDE has no concept of ruby or python or c# or Java. That is up to plugins which just essentially do a find an replace.
*chrome means Firefox Chrome. Something that has been around for a lot longer than Google Chrome the browser. It means use the browser chrome which removes a couple sandboxing issues.
If you want to play back the tests you can't go out of the table mode otherwise the IDE won't understand what to do. The code in the screenshot should be stored in a .rb file and that should be executed.
Let me try to unravel mysteries -
As soon as you launch the IDE it would be in recording mode. Do you see last Red button which is enabled.
IDE Tests can be executed only when in the selenese/html format (aka table format). I guess you have changed the format to ruby (I guess so), from Option > Format.
To be able to execute tests change it back to html from option > Format > HTML
Take my words, IDE is only and only for firefox

How to test File Download dialog box using cucumber/capybara

I searched around and couldn't find how to test a file download box using capybara/cucumber?
The following image asks the question much clearer.
This was similar to another question I just answered, hope it helps Anybody have idea how to test file download using cucumber?
#Millisami Capybara::NotSupportedByDriverError Fixed for me!
What i had to do is removing the #javascript tag from my cucumber test, which was included. I mean:
#search
Scenario: Recieving a file
...
instead of
#search
#javascript
Scenario: Recieving a file
...
Hope it helps :-)
The download box is a function of the browser. Capybara simulates a browser but without all the UI etc.. (e.g. it looks like a browser to your application, so using it you'd mostly skip over the whole file download UI stuff. It would look to the browser like someone did whatever they needed to in order to tell the browser where to put the file and start the download)
If you are trying to test a download box, (beyond clicks needed to start the download) you are now testing the browser, not your application. As yourself if that's part of your charter and worth your time.
To actually test the download box you are going to have to have a browser instance going, and use a tool like Firewatir/Watir or Selenium, to actually 'drive' the browser, and some other gem to actually automate up at the OS UI level (on windows we usually use autoit) in order to click things and fill in values of the browser's file download UI.

Automation of DOH Robot tests interrumped by Pop-up message

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.