I have it all set up but can’t figure out how to go about copying the code within the email and pasting in the field. The email is the exact same format every time, but obviously a new email is sent with a new code for each. Any ideas?
Btw email I’m just using a browser based client (protonmail), which I’ll already be logged in with.
One idea I had was to run 2 separate scripts, one for copying the code in the email, storing in CSV, and then running another script to use the code in the CSV to paste into the field. Am I over complicating things with this?
Would this be correct? Sorry, kinda new to UI.vision and I can’t seem to find an example for this. The text I’m copying isn’t in a cell, just plain text on the page. Also the path portion I put in target does highlight the text it seems, just don’t know what to do from there to copy it. Thanks in advance.
Yeah I can - is the code I copied here supposed to work? And what do you mean by use an image exactly? To focus on? What I did was used auto mode to click the wanted area, and then just copied over that path to the click command.
Edit: I managed to get it to focus on the email, however when it does CTRL+A, it highlights everything on the page rather than just that one line. Also where in the code would I actually copy the text?
I would like to bump this old thread…I have the same issue. How can this be solved? Was this ever resolved? @Sourc3code
What is the standard selenium command to read an email and find the value? @newuserkantu I am also struggling with the OCR screen scraping - and I don’t think it is necessary since this is just text in an email. @ulrich
Assume all the other issues are solved - e.g. I have the correct email pulled in a browser tab. Just need to know how to copy and paste the verification code and ignore all the rest of the text.
The format is:
Your verification code is: 123456 (it is always 6 numbers, but random every time)
Thanks so much for this @uiuser. This is very helpful. I am still having some difficulty because the web service I am using seems to have a 3 panel frame layout - i.e on the left there are the folder names, then the middle is all the emails, and the right side the open email. I have gotten to the stage where I have the email selected and open, but I can’t get sourceextract to work as the main page’s html doesn’t contain that content. Any tips?
I’ve tried adding selectFrame | index=1 or 0,1,2,3, etc and it still doesn’t pick it up. Any other suggestions? The other option I can try is OCRExtract I guess?
relative=top doesn’t work either, this is when I recorded a click on the email window, I get:
xpath=//*[@id=“zm_centerHolder”]/div/div/div/div[3]/div/div[2]/div/div/div[2]/div/div/div[2]/div/div
I’m not sure if it is a frame or a different type of element, but when I navigate to my main browser’s source code, I can’t see the text of the email
EDIT: I seem to be able to get it to work with OCRExtract, but it is definitely slower than the regex sourceExtract finder you suggested, but it does the job. Not sure how else I can try to troubleshoot the sourceExtract to get it to work?
Thanks so much for the help with the regex code though you shared earlier, it really helped with the OCRExtract. I’m having a separate problem with OCRExtract only working online mode and not local, but I have created a separate thread for that.
@uiuser how would I exact all the text from the TAG if I can’t find the frame using selectFrame? can I DM you email credentials or I can post a demo account here? I imagine it should be relatively straight forward to use sourceExtract to get the text, but I am not sure what I am missing