Skip to content
Advertisement

How to use starts-with() in xpath to switch to frame using Selenium

Can anyone help me understand how i use the following java code in python and selenium:

JavaScript

I tried using string formatting and couldnt find a way of using starts-with() in python.

Advertisement

Answer

starts-with() is a function used for finding the web element whose attribute value gets changed on refresh or by other dynamic operations on the webpage. It should remain identical irrespective of the language binding e.g. Java, Python, C#, etc.


The equivalent of the following Java based lines of code:

JavaScript

in Python would be as follows:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement