selenium

These blogposts are my opinions from reflections on topics relating to my current area of interest - Enterprise Agility, Leadership, Entreprenuership, Personal Development and Complexities of Africa.

Search for a single digit within a string using regex as provided in java api

In my current work, i have been writing a lot of test in Java, which obviously means i need to learn a lot more about the Java api, which is good i think?????Well i needed to match the single digit in this string “home-area-1” and return this digit. With a quick google i found this piece of code here.Pattern p = Pattern.compile(“ab”);Matcher m = p.matcher(“aaaaab”);boolean b = m.matches();System.out.println(b);A quick run of this code printed “true” which means the code works.

Selenium and Javascript events

Have you ver been in situation when you have typed a value into a text box and you expect a Javascript event to be triggered such as “OnBlur” Well selenium has a method “FireEvent” which triggers the event for you, but then the trick is you have to strip the “on” and name for the event wouldbe “OnBlur” I guess abit of example would make more sense, lol. This is what my html look like