1
Copyright © www.absofttrainings.c In Selenium automation, frequently you will see numbers on web pages that you want to get in your code and do some processing. For that: First get the string with the number using Selenium Delete all non digit characters using String class replaceAll() method Use Interger.parseInt() to parse the string with digits and to get the actual number How to get a number in a string message

How to get a number in a string message?

Embed Size (px)

Citation preview

Page 1: How to get a number in a string message?

Copyright © www.absofttrainings.com

In Selenium automation, frequently you will see numbers on web pages that you want to get in your code and do some processing. For that: First get the string with the number using

Selenium Delete all non digit characters using String

class replaceAll() method Use Interger.parseInt() to parse the string

with digits and to get the actual number

How to get a number in a string message