Thursday, February 6, 2014

Selenium in Google Chrome

In this tutorial, we will be going through the process of using Selenium Server (previously Selenium RC Server) to make the recorded trace to be able to run in chrome.


Download Selenium IDE (firefox plugin), it is to record the actions of firefox.

Download Selenium Server (selenium-server-standalone-2.39.0.jar), and Selenium Client (selenium-java-2.39.0.zip, link is below the Selenium Client & WebDriver Language Bindings).

Selenium IDE (firefox plugin) [Record the trace from firefox]
1.       1. In firefox, go to Selenium IDE.
2.       2. Click record to record the action
3.       3. File>Export Test Case as>Java|JUnit 4|Remote Control

Selenium Server (Running of JUnit test cases exported by Selenium IDE) [Replay the trace in Google Chrome]
1.       1. Open Eclipse, Create a Java Project, Add the Java Source file in (we will fix later)
2.       2. Configure Path - Right Click on the Project on left panel, and Select Build Path>Configure Build Path, Add JUnit, and two jar files in

3.    3. Open in Google chromeIn the selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://www.baidu.com/");
to
selenium = new DefaultSelenium("localhost", 4444, "*googlechrome", "http://www.baidu.com/");

4. Run it - Run the java file, it should prompt the chrome, and after running, it will prompts the status of the junit test cases.

P/S: Aside from SeleniumHQ, You may wish to lookout for iMacros for chrome

https://chrome.google.com/webstore/detail/imacros-for-chrome/cplklnmnlbnpmjogncfgfijoopmnlemp/details


===Self Reference===
To Try
1.       Capture Screenshot
selenium.captureScreenshot("C:\\a.jpg");
2.       To make it slower

selenium.waitForPageToLoad("30000"); or using slow flag

How to check page size for pdf in Acrobat Reader

File>properties,
under Description tab

Regarding changing page size, see here
http://tex.stackexchange.com/questions/156873/change-paper-size-in-winedt

How to check all fonts are embedded in pdf in Acrobat Reader

File>properties
Go to Font types tab

Make sure for all fonts, there are Embedded Subset beside it.


See How to embed all fonts in WinEdt 

Monday, January 27, 2014

\includegraphics{} in ps file not showing

If you are using pdf format in includegraphics, convert all of them to eps, then it will work.

Note: Remember to put \usepackage{epstopdf} in the preamble in case it prompts an error that eps is not foud.

Sunday, January 26, 2014

For my reference - Scanning in SUTD

To scan single pages to pdf, just use all default setting and scan it.

But to scan double pages, you need to 
1. Click on the pages to set the number of pages.
2. To ensure you have scanned both sided, scanning two papers of 4 pages need to ensure that it prompts you 4 pages after you click on start.


Tuesday, January 21, 2014

Reduce Space Around Floats (Algorithm, Figures, etc) in Latex

\setlength\floatsep{1.25\baselineskip plus 3pt minus 2pt}
\setlength\textfloatsep{1.25\baselineskip plus 3pt minus 2pt}
\setlength\intextsep{1.25\baselineskip plus 3pt minus 2 pt}
Put the above in the preamble, and change the 1.25 to desired one.

The First Line is for length between two adjacent floats

The Second Line -  for floats on top and bottom of text only
For floats at top - length between float and text below it
For floats at bottom - length between float and text above it

The Third Line- for floats in the middle of text only - length between text above it, and text below it.

Monday, January 20, 2014

Disable glue to geometry in Visio

Tools>Snap & Glue
Then unchecked Snap and unchecked Glue
That's it.