How can I add two numbers and add those two numbers before enter into captcha?

@Samraat_Maharjan1 ,
1.Use “Get Text” Activity to Get the Text (3+3)
2.Then use assign activity to seperate both Values
FirstNumber = Split("YourRetrivedText","+")(0)
SecondNumber= Split("YourRetrivedText","+")(1)

3.Then Use another Assign activity to add these two numbers
Sum= Cint(FirstNumber)+Cint(SecondNumber)

Note:Sum is of type Integer
4.Then type into the SUm into Captcha

Regards,

I can’t select 3+3 only What is also get attached while I tried to capture

@Samraat_Maharjan1

  1. Use get text —>str1
  2. Assign -->text = str1.Substring(str1.IndexOf("is ")+3).Trim
  3. Assign -->num1 = convert.ToInt32(split(text,"+"c)(0))
  4. Assign -->num2 = convert.ToInt32(split(text,"+"c)(1))
  5. TypeInto -->num1+num2

Regards,

@Samraat_Maharjan1 ,
You can make a small change while splitting try this
FirstNumber = Split(Split("YourRetrivedText","What is ")(1),“+”)(0)

SecondNumber= Split((“YourRetrivedText”,“+”)(1)

Regards,

Hi @Samraat_Maharjan1 ,

After getting the whole text, use the substring function to get only the expression part. Try the following:

image

new DataTable().Compute(StringVariable.Substring(8),nothing)

Regards,

1 Like

Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled… It’s getting this error. What do I put in “YourRetrivedText” in this section? is this is a output of gettext

@Samraat_Maharjan1 ,
The retrieved text should contain “What is 3+3”
I have Mentioned that just for your reference
Please replace the “YourRetrivedText” with the Variable which is the output of the Get Text Activity.

Regards,

@vishal.kp
new DataTable().Compute(StringVariable.Substring(8),nothing) Can you explain this code a bit. Should I print this on log message to check?

It’s getting error. System.Data.EvaluateException: Cannot find column [What].

Yes you can use this in log message,

new DataTable().Compute(StringVariable.Substring(8),nothing).toString

Regards,

@Samraat_Maharjan1 ,Can you display the value of StringVariable.Substring(8)

Regards,

Split(Split(“What is 4+1”)(1),“+”)(0) So this will be my code in the firstnumber?
and Split(“What is 4+1”,“+”)(1) in the SecondNumber
Can I replace “What is 4+1” with the output value of get text which is retrievedtext

@vishal.kp here StringVariable is the output of get text, right?

@vishal.kp Yes, I got this value " What is 4+1"

Yes @Samraat_Maharjan1 it is the get text output,

Suppose your full text is What is 3+3, then the substring(8) function will give you only 3+3 from that string, which should be passed to the expression I have provided above.

Regards,

@Samraat_Maharjan1 ,
Yes.
FirstNumber = Split(Split("What is 4+1","What is ")(1) ,“+”)(0)

SecondNumber= Split("What is 4+1","+")(1)

Now you just pass the variable of Get text activity in place of “What is 4+1”

Regards,

will this code works if it’s two digits say 10+12?

Yes @Samraat_Maharjan1 ,

Let us know if you are facing any issue

Regards,

@Jithesh_R . It’s giving me this error. Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.