Thanks for joining me!
Good company in a journey makes the way seem shorter. — Izaak Walton

Thanks for joining me!
Good company in a journey makes the way seem shorter. — Izaak Walton

When using Select2 Jquery plugin in my project, there is a problem in writing Geb functional tests because Geb does not understand Select2 via its default select mechanism.
Fortunately, Geb provides the mechanism to extend the default navigators to write our own method in a need of using third party library. Here is the solution.
2. Solution
2.1 Extend navigator classes NonEmptyNavigator and EmptyNavigator
Geb provides two navigators classes NonEmptyNavigator and EmptyNavigator. If the selector $(‘#fieldId’) returns an element, it will be bound to a NonEmptyNavigator, else it will use EmptyNavigator.
Thus, first of all, create two subclasses which extend from NonEmptyNavigator and EmptyNavigator as below:
import geb.Browser
import org.openqa.selenium.WebElement
class NonEmptyNavigator extends geb.navigator.NonEmptyNavigator {
NonEmptyNavigator(Browser browser, Collection<? extends WebElement> contextElements) {
super(browser, contextElements)
}
}
import geb.Browser
class EmptyNavigator extends geb.navigator.EmptyNavigator {
EmptyNavigator(Browser browser) {
super(browser)
}
}
2.2. In GebConfig.groovy, add the below code to use custom navigator
innerNavigatorFactory = { Browser browser, List<WebElement> elements ->
elements ? new NonEmptyNavigator(browser, elements) : new EmptyNavigator(browser)
}
2.3 Convert the select2 Jquery script to Geb friendly expression by using the built-in javascript executor.
To do this, add the corresponding method into NonEmptyNavigagor class above
void select(String value){
browser.js.exec(firstElement(), value, 'jQuery(arguments[0]).select2("val", arguments[1]);')
}
String getSelectedValue() {
browser.js.exec(firstElement(), ‘return jQuery(arguments[0]).select2(“val”);’)
}
2.4 Now in your Geb Test, you can call the new methods which have been added to choose the values and get the selected values from Select2
$(‘#fieldId’).select(‘California’)
$(‘#fieldId’).getSelectedValue()
3. References
https://fbflex.wordpress.com/2013/11/25/extending-geb-element/
Searching for the job over the last few weeks helps me to understand more the full hiring cycle in the US. As the time goes by, things may be easily forgotten. Therefore, I would like to write these wonderful hiring processes that I had great opportunity to experience down and share here.
Interview process
There are two cases: direct hire and indirect hire. In the direct hire, candidate applies for the job directly to the company and the hiring is processed by internal recruiter. In indirect hire, candidate will work mostly with external recruiter instead of the company.
1. Screening interview: involve coding & algorithm questions. This is as high as in-person interview. Coding will be conducted via many online synchronized document editors. Alternatively, interviewer may ask candidates to complete coding at home and send them the code when done. Screening interview can be conducted 2-3 times before onsite interview
2. Onsite interview: There are usually 4-6 in-person interview. Most of them are technical interviews about coding & algorithm. There are also questions about candidate’s resume. In addition, there is also one interview over the lunch which is not technical. This is a good chance to discuss candidate’s interest and ask about company cultures.
The internal/external recruiter will respond to the candidate within a week.
How to prepare for the interview
1. Large company: if you want to work for big company like Google, Facebook, Amazon, Microsoft, prepare algorithm and data structures. Big company concerns processing big data, scalability…so these are also the areas to be looked into.
2. Small & Mid-size company: Focus mostly technology and your experience. They will ask how you are good at java skills, spring/hibernate, HTML, CSS,….for example.
Steps
1. Prepare your profile, resume and profolio
2. Make a list of preferred company
3. Practice algorithm and data structures. Here are the good sites to practice
4. Practice interview questions at http://www.careercup.com. This is a delicate site to help candidate prepare for technical interview questions.
5. Do several mock interviews and then repeat step 3-4.
Hope these sharing are useful and I appreciate comments if I miss anything!
In this article, I would like to share the tips how to land the job offer in 3-4 weeks.
In order to land the job offer in the short period of time, it’s important that you practice algorithm and data structures problem frequently (either in your spare time or after work). The more you practice algorithms and data structures, the more chances you have to be offered the job.
There are many sites to practice algorithms and data structures such as hackerank, careercup, topcoder…In my experience, these two are efficient.
1.1 Buy a book “Cracking the code interview” and revise your knowledge on the data structure
1.2 Practice the problems on leetcode.com website
1.3 Practice system design: a good website is interviewbit
2. Market yourself
Make sure you write a very good and attractive resume. Your linkedin profile should cover your strength, experience, skills necessary for the job. In addition, it’s very important that you have your own project or websites which will attract more employers.
3. Prepare banking of questions
Per your experience and skills, prepare the list of possible questions and answers for each technology track. This is extremely useful when you have to interview with many companies. Going over the your note before each interview keep you always ready for every questions about your skills and experience.
4. Apply for the desired positions
If you come from another country, it’s a bit difficult to know a good website to apply for the job. Per my experience, these are very good websites
5. Tips for interview
6. Technology trend
At this time, for java track, the market requires developer skills in Spring Boot, microservices, python, Amazon Web services, React Js, Angular…so make sure to equip yourself with these technologies to get as many interviews as possible.
7. Organize your interview process
Normally the process to have job with direct hire takes about 3-4 weeks or more (up to 8 weeks). So if you are targeting direct hire or big companies, a good strategy is the best.
These are tips that I can think of write now. Will write more when having time.
Any comments, welcome!