I need to URL encode/escape viewstate variables read from a page before posting the back to the server. I found this ticket in my search for options:
I looked into the source a bit and modified the web monitoring piece to include a new scenario variable prefix in the spirit of "regex:". My "regexenc:" does the same work as "regex:", but uses libcurl to URL escape the results of the regex match. This let me successfully automate a login to a legacy .NET webforms application I am maintaining.
Now, this was a small thing and it may be rough. I don't have a lot of experience with working on C, so tell me if I get some basic things wrong or if I should refactor a bit. For example, should the curl_easy_escape calling code be it's own method? Should I separate out the if block for testing for "regex:" or "regexenc:" into two if blocks? I think I did alright with cleaning up allocated strings, but a second set of eyes would be good. Thanks, and I hope this can be the start of a useful if small contribution.
I looked into the source a bit and modified the web monitoring piece to include a new scenario variable prefix in the spirit of "regex:". My "regexenc:" does the same work as "regex:", but uses libcurl to URL escape the results of the regex match. This let me successfully automate a login to a legacy .NET webforms application I am maintaining.
Now, this was a small thing and it may be rough. I don't have a lot of experience with working on C, so tell me if I get some basic things wrong or if I should refactor a bit. For example, should the curl_easy_escape calling code be it's own method? Should I separate out the if block for testing for "regex:" or "regexenc:" into two if blocks? I think I did alright with cleaning up allocated strings, but a second set of eyes would be good. Thanks, and I hope this can be the start of a useful if small contribution.
Comment