Hi have problem i create test when i run it from selenium IDE everything is ok, test be passed. When i run my test by selenium testRunner the page was opened but any command eg. clickandwait cannot run in log error "Illegal operation on WrappedNative prototype object". Any idea?
There's an issue for this in their bug tracker:
http://code.google.com/p/selenium/issues/detail?id=703
Related
I have a simple test created from selenium IDE and I have saved it as a .side file
In my cmd i execute the command: selenium-side-runner C:\path\to\file\prueba2.side and the test is successful.
But when I run the test with chrome headless with the command: selenium-side-runner -c "goog:chromeOptions.args=[headless]" C:\path\to\file\prueba2.side it throws the following error:
TimeoutError: Waiting for element to be located By (css selector, div:
nth-child (2)> .rc .LC20lb) Wait timed out after 15163ms
I tried to solve the problem by adding a pause of 5 seconds before the line that generated the problem is executed but it did not work, throws the same problem.
In the following link I found the solution: https://medium.com/#griggheo/running-selenium-webdriver-tests-using-firefox-headless-mode-on-ubuntu-d32500bb6af2
When we use the browser headless mode we must change the instruction find_element_by_id for find_element_by_xpath because the browser in headless mode sometimes does not find the element by id but by XPath
You could try adding the --nogpu argument to your chromeOptions. I've had to use that before to get headless working properly.
selenium-side-runner -c "goog:chromeOptions.args=[--headless,--nogpu]" C:\path\to\file\prueba2.side
I know I am a little late, but ...
For me it works if I specify the browserName like this:
selenium-side-runner -c "broswserName=chrome goog:chromeOptions.args=[-headless]" C:\path\to\file\prueba2.side
Normally you do not have to say that you use chrome, because it is the default, but the moment I started using the "-c" flag, I had to specify the name.
I have test cases which i have written in robot framework. I have written one library for robot framework but it all for selenium. I am using firefox browser. This test cases are working fine if i am running through command line.
If I start test cases using jenkins this error will show. I am using shell command to start robot framework.
NoSuchElementException: Message: Unable to locate element: {"method":"link text","selector":"Config Box"}
Stacktrace:
at FirefoxDriver.prototype.findElementInternal_ (file:///tmp/tmpkRQ7Lc/extensions/fxdriver#googlecode.com/components/driver-component.js:10770)
at FirefoxDriver.prototype.findElement (file:///tmp/tmpkRQ7Lc/extensions/fxdriver#googlecode.com/components/driver-component.js:10779)
at DelayedCommand.prototype.executeInternal_/h (file:///tmp/tmpkRQ7Lc/extensions/fxdriver#googlecode.com/components/command-processor.js:12661)
at DelayedCommand.prototype.executeInternal_ (file:///tmp/tmpkRQ7Lc/extensions/fxdriver#googlecode.com/components/command-processor.js:12666)
at DelayedCommand.prototype.execute/< (file:///tmp/tmpkRQ7Lc/extensions/fxdriver#googlecode.com/components/command-processor.js:12608)
When running tests with Jenkins there are different timings on when the elements are available. Try to use keywords of Wait For ... or Sleep.
I'm trying to run an HTML testSuite with Selenium RC. The browser starts, the first test runs, and it stops. It doesn't continue to the second test case. I named both the test cases with .html extension. I am using Firefox.
If I run them manually, individually from the selenium RC test runner window they run ok. What am I missing, this seems pretty simple but yet I'm not able to get this working.
I am using Selenium RC 1.0.3
java -jar selenium-server.jar
-firefoxProfileTemplate"C:\Users\sicky\AppData\Roaming\Mozilla\Firefox\Profiles\zvt0jj7c.default"
-htmlsuite "*firefox" "https://4.17.8.9/" "C:\Users\sicky\Documents\selenium scripts\suite.html"
"C:\Users\sicky\Documents\selenium scripts\results.html"
What am I missing?
ok I figured this out. What I was doing was , I was converting the existing scripts into HTML. Apparently it doesnt work that way. It looks like I have to name them with html extension when I make those test cases itself, then the whole suite will run –
Actually I had the same behaviour and my test scripts were in fact created in Selenium IDE and had the proper .html extension.
However! The test suite itself didn't have the .html extension. I just added it and it started working properly.
I'm trying to run an HTML testSuite with Selenium RC. The browser starts, the first test runs, and it stops. It doesn't continue to the second test case. I named both the test cases with .html extension. I am using Firefox.
If I run them manually, individually from the selenium RC test runner window they run ok. What am I missing, this seems pretty simple but yet I'm not able to get this working.
I am using Selenium RC 1.0.3
java -jar selenium-server.jar
-firefoxProfileTemplate"C:\Users\sicky\AppData\Roaming\Mozilla\Firefox\Profiles\zvt0jj7c.default"
-htmlsuite "*firefox" "https://4.17.8.9/" "C:\Users\sicky\Documents\selenium scripts\suite.html"
"C:\Users\sicky\Documents\selenium scripts\results.html"
What am I missing?
ok I figured this out. What I was doing was , I was converting the existing scripts into HTML. Apparently it doesnt work that way. It looks like I have to name them with html extension when I make those test cases itself, then the whole suite will run –
Actually I had the same behaviour and my test scripts were in fact created in Selenium IDE and had the proper .html extension.
However! The test suite itself didn't have the .html extension. I just added it and it started working properly.
I have a set of tests that I've developed using the Selenium IDE in Firefox. Tests run fine and all pass. Now I'm trying to port those over to C# and run the tests for IE using MSTest and selenium-server. Here's the sequence of events:
Run all tests on Firefox via Selenium IDE. All tests pass.
Export tests to MSTest (Nunit export, rename some stuff etc.)
Start selenium-server-1.0.3
Run the tests in VS2008. Selenium setup is: selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://localhost/theSite/");; note that I can browse to http://localhost/theSite/ just fine.
4a. Confirm test is launching Firefox. Got result:
17:00:30.290 INFO - Preparing Firefox profile...
17:00:33.842 INFO - Launching Firefox...
First test ( waitForText "Login" in control "ctl00_TopNavBar_LoginStatus1") fails. Can't find the control.
if ("Login" == selenium.GetText("id=ctl00_TopNavBar_LoginStatus1")) break;
or
if ("Login" == selenium.GetText("ctl00_TopNavBar_LoginStatus1")) break;
All other tests fail as well -- same reason. Each test has a waitForText at the top.
Tried running the test in *chrome, *iexploreproxy and *firefox. All fail for the same reason.
Tried dumping a screenshot using selenium.CaptureEntirePageScreenshot("c:\\temp\\screenshots\\seleniumSite.png", "background=#FFFFFF"); and the screenshot is just a white bar.
So, my question is, how do I go about debugging this and figuring out what the real problem is? Clearly the page will render and the tests will pass. It's just when I try those tests in Selenium-RC that it fails so badly. Does the Selenium IDE have some bugs related to exporting tests to C#? (I have noticed one bug).
Are you executing selenium.Start() and selenium.Open()? Do you see the page opened in the browser?
Full initialization should be something similar to:
selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://localhost/");
selenium.Start();
selenium.Open("/theSite/");
Important Note! test your IDE tests by starting with an empty page. Also, when using the IDE, if a command only has one parameter put it in the Target field, even if it isn't a control name.