I have some seleniumtest
they include a fileupload
<tr>
<td>type</td>
<td>css=input.rf-fu-inp</td>
<td>C:\seleniumtestresources\user.csv</td>
</tr>
now the tests must run under a linux environment (suse 12.1). Has anybody an idea how to define the path that he is working on both plattforms?
I recently had the same problems.
I am running my test cases on Selenium Grid and I am programmatically replacing / with \ and vice versa depending on what OS is running on a node.
There is no format that works for both win and linux as far as I know.
Related
I want to use a gpu when I execute a program but it's impossible
because the application is already hardcoded "--disable-gpu --disable-software-rasterizer" options
I already read the api document and chromium source code but
I can't find out any way to enable gpu with that options.
case1) fail (not worked)
"--enable-gpu" : is not worked
case2) fail (not worked)
"--enable-gpu --enable-oop-rasterization --enable-gpu-rasterization --force-gpu-rasterization"
Is there any way to enable gpu in this condition?
chromium --disable-gpu --disable-software-rasterizer
I have a problem with Selenium IDE's command - waitForTextPresent.
<tr>
<td>waitForTextPresent</td>
<td>*saved successfully</td>
<td></td>
</tr>
I had a couple of tests which are using this command. All tests worked fine, but now, during executing this command web application freeze, after while Firefox crashed, whole Firefox freezed and i received from Selenium IDE timeout exception after a while. So my question is, why is it happening?
I didn't change tests or selenium settings.
One time I received error:
A script on this page may be busy, or it may have stopped responding. You can stop the script now, open the script in the debugger, or let the script continue.
Script: chrome://selenium-ide/content/…nium-core/scripts/htmlutils.js:679
Windows 7
Firefox 38.0.5
Selenium IDE: 2.8.0
I am using couple of add-ons related to Selenium (e.g.: Sel Block).
waitForTextPresent is a deprecated command, try using just waitForText with a CSS locator as the target, and the '*saved successfully' bit as the value.
Update:
You can use XPath for detecting the contained text as well For example:
waitForElementPresent | //*[#id="objectid" and contains(text(),"Text You Want")]
Older solution with waitForText:
You have to use WaitFortext
waitForText | Locator | Textpattern
for example
waitForText | //* | *saved successfully
asterisk can be used on beginning, middle or end of the text pattern
I use Selenium IDE.I needed if-else construction and I found a Javascript file. I used the file in IDE easily. However when I tried to use the file with Selenium RC, I followed the steps:
Opened selenium.jar file and changed the user-extensions file(this file is in core->scripts->user-extensions) with what I found(which includes if-else functions) from internet.
I started selenium rc with the command:
-java -jar selenium.jar -userExtensions user-extensions.js
-htmlSuite "*chrome" "linkofsite" "staj\Projects\SikayetTestleri.html" "result2.html" -port 4445
Selenium server started firefox but nothings happend...
I've found another way to solve my problem.Instead of user-extensions I used storeEval command and wrote 2 lines of javascript code.I used conditional statement instead of if statement.
Selenium IDE command:
<tr>
<td>storeEval</td>
<td>
selenium.isElementPresent('Element I control')?selenium.doClick('Element which will be clicked if the element present'):seleniumdoClick('Element which will be clicked if the element NOT present')
</td>
</tr>
I have a problem with Selenium and can't get it to work.
What I want to do:
A customer of ours sends us a Selenium test case which shall be executed automatically in several locations and the time taken shall be recorded.
We want to use Selenium and Firefox Portable, because we want to make the tests completely independent of any user input and the installed software at the different locations.
So much for the starting conditions ;)
What we did so far:
The first version was completely written in Java, we exported the test case from the customer to Java with the Selenium IDE Plugin -> Export to Java WebDriver.
This cannot be done anymore, because the customer now uses some functions the WebDriver export does not support. And as we don't want to alter the test from the customer, Java export is no longer an option.
So for the first run we are using this command (any variables are set correctly):
java -jar selenium-2.33.0/selenium-server-standalone-2.33.0.jar -port 5555
-firefoxProfileTemplate "Firefox\Data\profile" -log logs\selenium_server.log
-htmlSuite "*firefox" http://localhost:5555 Testsuite.html
logs\results-firefox-%curTimestamp%.html
This starts my preinstalled firefox, not the portable one. On the customers machine, no firefox is started whatsoever, because it is not installed. So I had to provide the path to the firefox instead, using the "custom" htmlSuite:
java -jar selenium-2.33.0/selenium-server-standalone-2.33.0.jar -port 5555
-firefoxProfileTemplate "Firefox\Data\profile" -log logs\selenium_server.log
-htmlSuite "*custom %FF_DIR%\FirefoxPortable.exe" http://localhost:5555 Testsuite.html
logs\results-firefox-%curTimestamp%.html
This does not work, as the Selenium Server cannot execute this command if run under Windows, which we do (see: http://code.google.com/p/selenium/issues/detail?id=3274)
As comment #6 has some diffs, we patched the selenium Server standalone Jar and ran the test again. Now the browser could be started, but the test could not be run. After the first page loaded we get the error "Permission denied to access property 'document'".
A solution here suggests, a user-rights problem could be the cause and you should try the "chrome" htmlSuite (see: https://sqa.stackexchange.com/questions/1453/how-to-fix-permission-denied-to-access-property-document)
So we did:
java -jar selenium-2.33.0/selenium-server-standalone-2.33.0-patched.jar
-port 5555 -firefoxProfileTemplate "FirefoxPortable\Data\profile"
-log logs\selenium_server.log -htmlSuite "*chrome %FF_DIR%\FirefoxPortable.exe"
http://localhost:5555 Testsuite.html logs\results-firefox-%curTimestamp%.html
Notice our "patched" selenium and the "chrome" htmlSuite.
That didn't work, as well.
So, here in short the results:
htmlSuite = firefox: the preinstalled Firefox is used, if installed, not the Portable one. In case, no FF is installed, the test fails altogether
htmlSuite = chrome: the server cannot start the browser, as it tries to set EnvironmentVariables, which is not supported running Windows (see: http://code.google.com/p/selenium/source/browse/java/client/src/org/openqa/selenium/os/WindowsProcessGroup.java#67 lines 67 following)
htmlSuite = googleChrome: Google Chrome Portable can be started, but the Chrome browser cannot find some elements specified by the test, so we cannot use Chrome (altering the test is no option, as stated above)
htmlSuite = iexplore: Internet Explorer starts, but then a JavaScript error appears, referencing a custom Profile created by Selenium, so the test does not work in IE, either
htmlSuite = custom: the Portable Firefox is started (yeehaw), but does not have sufficient rights to execute the test.
You may use a Continuous Integration System like Jenkins, or TeamCity to execute your tests automatically.
we have now decided to support the customer in installing Firefox on the machines to test, so we can use our batchfile without problems.
As for the bug in selenium look here (code.google.com/p/selenium/issues/detail?id=5554#c14), there is a link to a nightly build that does work (at least for us) with Firefox v23, which Selenium 2.33 does not.
Thanks for everyone who contributed, but I think my first approach can not be achieved the way I thought it could :(
I solved this problem.
Visit this link: http://www.townx.org/blog/elliot/dealing-self-signed-ssl-certificates-when-running-selenium-server-firefox
Point 9:
Delete everything in the directory except for the cert_override.txt and cert8.db files.
Hope it helps
I've create a .bat file to open multiple Selenium tests (with Selenium RC), using url parameters (computername).
The problem is that the command parameter base-url is overwritten by the Test Suite open Command's url.
I know the parameter of the base-url file can be a dummy url since it's overwritten by the test suite but how can I manage to use that base-url parameter?
The app_path variable bellow is the base-url I want to use:
SET app_path="http://myApplication.com?Rank=%param%&Computer=%computername%"
START java.exe -jar %seleniumserver_path% -htmlSuite "*firefox" %app_path% %suite_path% %result_path% -port %unique_port%
From what I have red here http://www.yoyobrain.com/flashcards/show/64136:
purpose of baseURL GET parameter, what does it accept and what is
default
(Answer)
if the "open" command uses a relative URL, we'll make it absolute by
using this base URL.
This URL MUST be an absolute URL , i.e. it should start with "http://"
or "https://", and it should point to a directory, i.e. the URL path
should end with "/". (If the URL does NOT end in /, we'll
automatically chop off the last part of the path, e.g.
"http://foo/bar" will be treated as "http://foo/".)
Accepts absolute URL and defaults to the absolute URL of the test
suite specified in the test parameter
So now my question is: How can I achieve to pass a parameter FROM Selenium RC to my TestSuite?
I managed to find the answer and I'll share if anyone runs in the same issue:
In your first test case, you can manage to get the selenium base-url that was used.
To do so, store the selenium.browserbot.baseUrl value and then use that value for you open command:
<tr>
<td>storeEval</td>
<td>selenium.browserbot.baseUrl</td>
<td>MyBaseUrl</td>
</tr>
<tr>
<td>open</td>
<td>${MyBaseUrl}</td>
<td></td>
</tr>