Ranorex scripting; how do I send commands to the browser?
I would like to send a command string to the browser, i.e. instead of using the browser developer tools console input
I agree with theDarse. Take a look at the following website:
http://www.ranorex.com/support/user-guide-20/web-testing/samples.html#c1986
The following code should work.
webDocument.ExecuteScript("history.back();");
Related
Usually I make use of AutoITscript to upload a file in the Windows dialog box. This is useful while testing on Local Machines on any browsers. But,since I have now moved to use BrowserStack to tun my tests on cloud, I am finding it difficult to run the AutoIT script on the remote browser. Any help in this regards is much appreciated.
Thanks!
Note :I cannot directly enter the file path in the web UI as its disabled and the only way is to open the Windows dialog and browse to the actual path,which I used to do using the AutoIT script.
How do I use Robot Framework Selenium to control a regular browser that I can see, and that doesn't exit after finishing a test?
You can't. You cannot get a handle on an already open browser. You can, however, open your browser with the test and then not close it. The browser will remain open for you to interact with it.
If you absolutely must have this functionality, you could try using the remote library interface. The remote library could act as a proxy to the selenium keywords. It could open a browser and keep it open for as long as the remote library server is running. My guess is that this would take a lot of work, and I don't see any real benefit in doing it.
I have my resume online in an html page (www.mysite.com/resume.html). Every time I need a PDF version of it, I use Google Chrome's print dialog to save it as a PDF, which uses my print CSS stylesheet.
I want to be able to navigate to www.mysite.com/resume.pdf to always have an up to date PDF version without having to go through Google Chrome manually. Is there a way to programmatically and automatically create a resume.pdf from resume html? If I can write a script that runs once every 24 hours or something like that, that would be good.
PhantomJS is perfect for this. It invokes an instance of WebKit from the command line which can then be used to output to file such as PDF.
PhantomJS:
http://phantomjs.org/
Specific instructions for exporting screen output to a file:
http://phantomjs.org/screen-capture.html
e.g.:
phantomjs rasterize.js 'http://www.example.com/resume.html' resume.pdf
Chrome has started headless program.
With that, we can create a pdf. e.g. for windows navigate your commandline to
C:\Users\{{your_username}}\AppData\Local\Google\Chrome SxS\Application>
Then hit the command:
chrome --headless --print-to-pdf="d:\\{{path and file name}}.pdf" https://google.com
If you are looking to do this server-side via PHP might I recommend the Browsershot library which leverages the Puppeteer (NodeJS package) and Chrome / Chromium headless browser?
It works really well. Way easier to install and get going than wkhtmltopdf (which is another option that doesn't rely on a NodeJS package nor the Chrome/Chromium headless browser. Personally, I recommend Browsershot solution since wkhtmltopdf has some issues depending on the type of server (Linux distro and version) you're running. That is, the only reliable way to install wkhtmltopdf that I've found is to download and compile from source on the server that you're running and not through a package manager).
Also, if you happen to be needing a solution specifically while working on a Laravel project then there's a wrapper library for Browsershot available.
Check out this tutorial to get started.
Here's what I would like to do:
Cron execute an iMacro (or iMacro-like) script on a headless unix server - essentially doing my browser interactions for me.
Is this possible?
I'm sure cURL won't be able to traverse the DOM and trigger user events. iMacros would be perfect if I could run it in unix CLI, which you can, but I run a headless server without Xorg and obviously FF requires Xorg. iMacro with Lynx would be good but I doubt iMacro works with Lynx.
Anyone got any ideas?
Old question, but I was looking for about the same thing, and I found this post on Google. Here the answser :
There is some headless browser which can run on an Unix system without Xorg. You can try CasperJS, PhantomJS or Zombie by example.
How can i execute a command prompt command from ie9?
I know that this:
file:///c:\windows\system32\cmd.exe
loads it up but how to add a command to that?
The IE is not actually execute the command, is just transfer it to the windows shell - meaning that Microsoft have merge IE with Windows Shell to make the user interface more friendly - so calling this from the url, you are not actually do something with the browser.
This commands may execute only interactivity on the browser url and can not be call them programmatically for obvious reasons... like that:
file:///c:\windows\system32\cmd.exe del c:\*.*