Currently I am using vodafone line(external) network which uses Ip address 10.10.x.x. I want to run the scrips on airtel line(internal network) with ip config 107.109.47.x. The syntax of many items have IP address. How can I change the syntax at a single go? I want to run the code on all networks. Please suggest some solution.
Eg: .//div[#'root']/div/div/div[1]/div[1]/form[@action='http://10.10.10.228:7001/MagicInfo/login']/div
I want to change the IP address to 107.109.226.85. There are multiple items which have similar syntax
How to change the path for all items at a single time when network line is changed?
-
- Posts: 1
- Joined: Tue Jul 13, 2021 8:31 am
Re: How to change the path for all items at a single time when network line is changed?
To keep it simple you have two choices:
#1.) You can either pass in the IP address as a variable if its important and needs to be tested... (I wouldn't do it like this myself...)
or
#2.) You can remove the ip address from the url that you have specified in your path. (this is what I would do...)
eg:
becomes
And on a side note - your rxpath is likely too specific and could probably be more a bit more robust if it were even less specific:
#1.) You can either pass in the IP address as a variable if its important and needs to be tested... (I wouldn't do it like this myself...)
or
#2.) You can remove the ip address from the url that you have specified in your path. (this is what I would do...)
eg:
Code: Select all
.//div[#'root']/div/div/div[1]/div[1]/form[@action='http://10.10.10.228:7001/MagicInfo/login']/div
Code: Select all
.//div[#'root']/div/div/div[1]/div[1]/form[@action~'MagicInfo/login']/div
Code: Select all
.//div[#'root']//form[@action~'MagicInfo/login']/div
Re: How to change the path for all items at a single time when network line is changed?
Hi,
I agree with dhale's comments. But if you insist on using the ip address (from whatever reason), the easiest way to replace a string on multiple places in repository, is to directly edit rxrep file in a good text editor (notepad++ or similar). Of course, make sure you have a backup copy of last working state in source control of your choice
I agree with dhale's comments. But if you insist on using the ip address (from whatever reason), the easiest way to replace a string on multiple places in repository, is to directly edit rxrep file in a good text editor (notepad++ or similar). Of course, make sure you have a backup copy of last working state in source control of your choice
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration