Selenium: Taking forever to open browser - selenium

It is taking forever for Selenium to open browser. Command line shows the following:
It looks like your baseUrl (http://localhost/indico) is pointing to a file, not a directory (it doesn't end with a /). We're going to have to strip off the last part of the pathname.

Create a folder with name indico and then keep your html files in it.
Now give http://localhost/indico/ as base url and /main as absolute URL which appends the base url and become http://localhost/indico/main .
Regards

The firefox driver is much faster than the ie one. Maybe you should start off with that one and continue from there.

Related

Apache `host/~username/` opening `/host/directory/`

I have the following:
host/~username/
sends the browser the page /home/username/public_html/index.html. In another directory /home/username/site_root/ we have the root of a website starting with its own /home/username/site_root/index.html.
How to do this: I would like that host/~username/ sends the browser to /home/username/site_root/index.html, if possible keeping host/~username/ as the address in the address bar.
I have never done anything with Apache. Reading some answers it seems that I might be able to do this by adding a file /home/username/public_html/.htaccess with certain commands in it. I have tried imitating what they do with lines like
RewriteEngine on
Rewriterule <...>
but I haven't managed to produce any result.
I tried to avoid using the word redirect because I don't know if that is the name of what I want to do. I don't want it to load some page that then sends the browser to another location.
I saw another thing that is done modifying httpd.conf which changes the root directory of the Apache server. I don't have access to this file.
Have you tried something simpler like a symlink?

Issues with intern-runner and proxyUrl that contains subfolders

I need to setup intern to test ajax calls from a different server. I set everything up sort of following the official wiki in this address
https://github.com/theintern/intern/wiki/Using-Intern-to-unit-test-Ajax-calls
My config file has proxyUrl set to http://localhost:8080/sub
and http://localhost:8080/sub is setup as a reverse proxy to inter-runner in http://localhost:9000
When I run ./node_modules/.bin/intern-runner -config=tests/config from the tests root folder, the browser opens up and is able to request several files, until it tries to request the config file. That's when it receives a 404, because it requests the wrong address - http://localhost:8080/tests/config.js - without the sub folder.
I'm wondering if I'm missing something inside the config file, or if intern is not able to use proxies with subfolders. I tried to set the baseUrl parameter, but it had no effect.
Any ideas?
Update:
It seems that sometimes intern-runner uses the path provided in the config param, and sometimes it uses the one in the proxyUrl parameter inside the config file. As a workaround, what I did was to place the config file and the tests on 2 folders (actually I made a symbolic link). The first on tests/ and the second on sub/tests/ and ran it using ./node_modules/.bin/intern-runner -config=sub/tests/config.
It works, but it's kind of stupid and I really wished there was a better way to do it.
This is indeed a limitation/bug of intern. It assumes that the proxy sits at the root of the absolute domain name, i.e. that it has a pathname of /.
An issue has been created on intern's github repository here and the corresponding pull request that fixes the problem is here. Hopefully this gets merged into the upcoming 2.1 release of intern.

Selenium IDE Base URL and Open commands

What is the use of Base URL is Selenium IDE because even when I enter the wrong URL there or leave it blank, and run the script, it just runs fine.
I have this URL, as base URL http://test.info:50/test and in the open command when I use the part /test of the URL, so the URL to be opened should be http://test.info:50/test/test (which is not the actual URL) and selenium keeps running the script on the Base URL above and shows no error.
So, my question hear is what is the use of Base URL when it could be left blank or empty. What is the use of the Open command when I have used the full URL in the Base URL part.
Hope the question is clear. Please help.
The base URL should be the index of your site. NOT the directory under test.
For example,
BaseURL: http://google.com/
Open: /search
This will open http://google.com/search as the beginning Url. From then, you should continue testing.
In your case, specify
BaseURL: http://test.info:50/
Open: /test
And you'll be golden.
EDIT:
and selenium keeps running the script on the Base URL above and shows no error.
Selenium IDE will show no errors because Selenium IDE doesn't care where your test is ran.. it's not limited to that (nor should it be). It will only spit out an error for something is wrong in your script. Nothing to do with your opening of urls. You could open something like /somebullcrapdirectory and it'd still be fine. It'd fail at the point of performing any subsequent actions though, since /somebullcrapdirectory would actually be an invalid directory.
I hope you understand Abhi,
When user give the blank base url after that comes the error,
[warn] Base URL is not set. Updating base URL from current window.
[error] baseUrl wasn't absolute:
We can simply use the open command and leave the target section blank.
This will use the base URL and open it.
The URL specified in Base URL input field in de Selenium IDE, and the URL specified in the target parameter of the open command, will not just simply be concatenated. Opening /test/ will just be seen as an absolute URL for your domain.
You can, however, specify a target ./test/, which requests, as I experienced, requests http://test.info:50/test/test/. I find this very useful, as in some environments, my web application will reside on the root and in some other environments in a base path like /myapp/.
With respect to a blank Base URL, I assume that this worked because the browser page in which the test was run already showed a page from the correct domain. If you would have executed the open command on a page in any other site, the open command would have requested the page /test/ from that site. After that, that base URL would have pointed to that site.

Append file date to css file in apache

I am trying to find a way to make sure browsers dont cache versions of my css files everytime I push a new update.
I was thinking the best way would be to somehow get the file timestamp of the css file on the filesytem and append append it tot he css URL somehow like www.mysite.com/css/style.css?13245645434
Is this possible at all? If not, then any idea how i can make sure the browser gets a new version of the file when it is updated? I dont want to eliminate browser cache all together because if the file hasnt been touched then i would like it to be cached. However, when i push a new update i would like to someone tell the browser that.
I understand i can write server side code to put the style.css?2342343 in but i want to see if its possible through apache at all.
Thanks
everytime I push a new update
How do you push updates? If there is an automated build process you have then that is the right place to rewrite your URLs.
If you wanted to do the rewriting via apache you'd need a module which would parse the html and rewrite the links. That would not be optimal.
Lastly, consider rewriting to /css/42/style.css (where 42 is the current version) because in case you cache your site through a proxy or CDN, query parameters may not work.

View Long filenames with question mark in Browser

I have a file called 34.php?session=2534464a39a2c97cb7113689726a4e52 in my /var/www/html folder but I can't view this file in the browser. I want my browser to execute this code via PHP from the browser but It doesn't :(
Thanks..
You'll need to URL encode the ?, otherwise it won't be interpreted as a part of the filename. Try 34.php%3Fsession=2534464a39a2c97cb7113689726a4e52