我想将以下xml存储在String变量中:
<?xml version="1.0" encoding="utf-8"?>
<PublishData>
<PublishProfile
PublishMethod="AzureServiceManagementAPI"
Url="https://management.core.windows.net"
ManagementCertificate="MIIKFAIBAzCCCdQGCSqGSIb3DQEHAaCCCcUEggnBMIIJvTCCBe4GCSqGSIb3DQEHAaCCBd8EggXbMIIF1zCCBdMGCyqGSIb3DQEMCgECoIIE7jCCBOowHAYKKoZIhvcNAQwBAzAOBAjqVDJW6A1sCAICB9AEggTIVMsNIWg9llVa/HZ+rSFiqkszEWVSCEUlnG6pUlm9HEHaBP0w6a8pzPI9b/RoK0nWpUfpjX2gIOSiELDH4va+bDT4JA177GDorjM81jnMo4i+vjuzIrXd16pihFEoQbCICwcHX+qczRK/gMv+EPujL56+b1HfeDcRUePcJlUbtGf/STD7LH8/l5Ilm6CblzgP6RvX+wBWkS7215GpT3YpWXnzP8L16UAW/M9ifVC1aQogJecmUHrDLNw3QnFQK/NN0jRa0jhflFEAw8kIsAyVMTsSE1z+jH5loiDH1g89ywZyrBISJWnrotv8Xo5dsaDSSh51Cln6ANgAFVmXpYng0p4y1IDTXtM8a8isUj+nWMGFLjmh+rwn7GHM3nV3NvACsX6gokfrZQiCUv479KTYvFW2Yly6cJrG9dp24JcDeOgQbGHAyj14U4sRJ0+kkb/sY6OCZgJLHg0eJr2JR6Nmt9owrOeFPQiQUT6XPB8B7Lj57+rOzBkeeNbKSmS/ljhMdx9DvnYJELjrMstXIEfwuK5LSlJjR70UlVTjZeEbysD5D07tVYTx4a6dyvjYWGJT1UV2vXHEHE1HNoGICquIz9tCYbdKZUUVnZLJXUjNQ2igvNtuRDWsIO0GVzz/aE6eDCE367bJmt6n7LOAJNCdrmxgQ6sLiBkBnzQ+uCn0A5szKzu3MrRTvK1/ilvfBuq4SSF7mhjCObuBzgE6rBLggU5PZ21i3W+e7aVDmJvcpRQP5gOOsJuQAxwdmhPEqZITX1W1MwJcQUJe7ZQ5rGiWLMZkwy9LqJ8dKP1O+rVT38TfU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EiVI2AFWGYQzaGrCGYNg46ccY20WLC+GfWfh9kvdhw1uK+9zyreVU0nPFcVhbNWsFzCBzG/dAJTMhquvyebxbTMrqd2frZq6ANIQJRev/BpEN7HdCDOdIkJ25VXUsai8/EbGKSnoSQpMku5WdbhtMZBvbWf9bLMBb6CftSb3curLgRGpUvuKRXazMFIqSlFmMYTA3MB8wBwYFKw4DAhoEFFPRnQ+fTrJeB5vkx1qNHsIJDUfuBBRxnLPy8VCPymFot7wDaFcEn3qVqw==">
<Subscription
Id="36eccef3-558a-4b-9e14-4efcf57ab86c"
Name="Enterprise" />
<Subscription
Id="12501f03-5b8c-448d-a342-24c5f8"
Name="Development" />
并使用
driver.findElement(By.id("ACPSIBDAzure.AccessKey")).sendKeys(/* String Variable */);
将xml内容传递给文本输入框。我怎么能用Java
来做到这一点答案 0 :(得分:0)
您将XML放入String变量中。如果您不知道如何,这可能会有所帮助:Java multiline string 然后在下一个.sendKeys()语句中引用该变量。