我有一个使用旧登录身份验证方式的WPF桌面应用程序。现在我需要将登录机制更改为OpenId。以下是获取访问令牌的代码:
class DynamicWebTable1(unittest.TestCase):
@classmethod
def setUpClass(cls):
chrome_driver_path = os.path.abspath('..') + "\\Drivers\\chromedriver.exe"
cls.driver=webdriver.Chrome(chrome_driver_path)
cls.driver.implicitly_wait(30)
cls.driver.maximize_window()
# navigate to the application home page
cls.driver.get("http://qavalidation.com/demo/")
def test_get_table_data(self):
time.sleep(10)
columns = len(self.driver.find_elements_by_xpath(".//*[@id='table01']/tbody/tr[1]/td"))
rows = len(self.driver.find_elements_by_xpath(".//*[@id='table01']/tbody/tr"))
print("rows - ",rows) # rows - 3
print("columns - ",columns) #columns - 4
for row in range(rows):
for col in range(columns):
values = self.driver.find_element_by_xpath(".//*[@id='table01']/tbody/tr["+row+"]/td["+col+"]").text
print(" Dynamic web table index {row} ,{col} value is {values} ".format(row, col, values))
@classmethod
def tearDownClass(cls):
# close the browser window
cls.driver.quit()
1。当Web浏览器指向重定向URL时,我应该如何获取令牌字符串 2.我不熟悉OpenId,我甚至不确定我的登录代码是否正确。有人可以就此提出一些建议吗?