Selenium RC custom base-url - selenium

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>

Related

How to pass runtime parameter (params) in Selenium Side runner?

How to pass runtime parameter (params) in Selenium Side runner?
I want to execute the Side file from command prompt and also pass various urls and user names as parameters to run. i tried selenium-side-runner --params "a='example-value'", it didn't work.

How to Use Command Line Parameters by using JMeter?

I'm using Jmeter for testing APIs and I want to parametrize the project's path from the terminal and then I want to use this parameter in JMeter. I set testurl = test.com in basic terminal and i want to get this url by using testurl. The parameter that I've sent via Command Line : ./jmeter -n -t your_script.jmx -l -Jurl=$testurl in homebrew terminal. The parameter that I've used in httpsRequest --> Server name or IP; ${__P(url)}. But when I run my automation in the homebrew terminal, my test scripts are not going to URL that's been defined. Please help me!! Thanks.
From first impression it seems what you are trying should work, but devil is in the detail. I would suggest you try:
Verify if the environment variable is set correctly use export testurl=test.com (removed spaces). Try verify using echo $testurl
Try debug sampler which should help you verify if JMeter is picking up the var correctly: https://www.blazemeter.com/blog/how-debug-your-apache-jmeter-script/
Hope this helps.

Change default browser while using scrapy's shell view function

While on a scrapy shell, when I try to use the view(response) function, instead of opening a browser, it opens Visual Studio Code. How to make it open on a browser?
I read that webbrowser is the library used to view the page and that I could set the BROWSER variable to change its default. On a Linux Mint system, to which value should I change the BROWSER variable to in order to make the view command to open firefox?
Found the answer myself after some further searching.
The value of the BROWSER variable should be /usr/bin/firefox.
So, in my case, adding the following line to my ~/.bashrc file did the trick:
export BROWSER=/usr/bin/firefox.

Different locations of file downloads

I am using webdriver.io for my end-to-end testing. I want to check if proper files are being downloaded.
My problem is with the file download location. I want to use separate downloads directory for each test browser instance (hence for each test file), because I want to have fresh directory under test.
I tried to set (in wdio.conf.js):
chromeOptions.prefs['download.default_directory'] = path.join(__dirname, "/downloads/", browserName, process.pid.toString());
using PID of the process, but it does not work. But the process.pid is the same for all tests. So how can I accomplished that? How to set different download directory (for Chrome browser) for each test browser instance and then grab that directory path in the test itself?
You can use timestamp as it will be different for all tests.
chromeOptions.prefs['download.default_directory'] =
path.join(__dirname, "/downloads/", browserName, new Date().getTime());

Screenshot is not loaded in my Jenkins Result Page

My Testcase execution result will be displayed in the form of .html.
When I double click and open the .html file, the testcases results
along with the Pass or Fail screenshot will be displayed.
I am executing the selenium testcases in Mozilla Firefox browser
When I open the .html file from my local machine, the images for
every are loaded without any errors.
When I try to open the same .html file from any other system, images are not loaded.
Can somebody help me out in this issue?
I believe you are not able to view HTML properties of your HTML reports. This is working fine as per default Jenkins behavior.
Run below in Script Console (available in Manage Jenkins) to view HTML and CSS properties:
System.setProperty("hudson.model.DirectoryBrowserSupport.CSP", "")